Skip to content

Commit

Permalink
Avoid profile_manager.h in most headers.
Browse files Browse the repository at this point in the history
It is almost always possible to forward declare ProfileManager instead.
Then add missing includes or forward declarations to fix the build.

Change-Id: Ia5f3f10ec8699b7cc0417b0c16c802b7b7c14866
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192966
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1098113}
  • Loading branch information
leizleiz authored and Chromium LUCI CQ committed Jan 27, 2023
1 parent 2ecc7fd commit 4ae3366
Show file tree
Hide file tree
Showing 22 changed files with 30 additions and 13 deletions.
3 changes: 2 additions & 1 deletion chrome/browser/download/download_ui_model.h
Expand Up @@ -15,7 +15,6 @@
#include "base/task/sequenced_task_runner.h"
#include "base/time/default_clock.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "components/download/public/common/download_item.h"
#include "components/offline_items_collection/core/offline_item.h"
#include "components/safe_browsing/buildflags.h"
Expand All @@ -30,6 +29,8 @@

using offline_items_collection::ContentId;

class Profile;

namespace content {
class WebContents;
} // namespace content
Expand Down
Expand Up @@ -34,6 +34,7 @@
#include "chrome/browser/extensions/install_tracker.h"
#include "chrome/browser/extensions/scoped_active_install.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_observer.h"
#include "chrome/browser/safe_browsing/safe_browsing_metrics_collector_factory.h"
#include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager_factory.h"
Expand Down
Expand Up @@ -8,14 +8,14 @@
#include "base/scoped_multi_source_observation.h"
#include "base/scoped_observation.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "chrome/browser/profiles/profile_observer.h"
#include "chrome/browser/ui/browser_list_observer.h"
#include "extensions/browser/process_manager_delegate.h"

class Browser;
class Profile;
class ProfileManager;

namespace extensions {

Expand Down
1 change: 1 addition & 0 deletions chrome/browser/extensions/extension_service.cc
Expand Up @@ -62,6 +62,7 @@
#include "chrome/browser/google/google_brand.h"
#include "chrome/browser/lifetime/termination_notification.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
#include "chrome/browser/ui/webui/favicon_source.h"
#include "chrome/browser/ui/webui/theme_source.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_service.h
Expand Up @@ -29,7 +29,6 @@
#include "chrome/browser/extensions/omaha_attributes_handler.h"
#include "chrome/browser/extensions/pending_extension_manager.h"
#include "chrome/browser/extensions/safe_browsing_verdict_handler.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "chrome/browser/upgrade_detector/upgrade_observer.h"
#include "components/sync/model/string_ordinal.h"
Expand Down Expand Up @@ -62,6 +61,7 @@

class BlocklistedExtensionSyncServiceTest;
class Profile;
class ProfileManager;

namespace base {
class CommandLine;
Expand Down
Expand Up @@ -17,6 +17,7 @@
#include "chrome/browser/extensions/updater/extension_update_client_base_browsertest.h"
#include "chrome/browser/extensions/updater/extension_updater.h"
#include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_switches.h"
#include "components/policy/core/browser/browser_policy_connector.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/lacros/force_installed_tracker_lacros.cc
Expand Up @@ -5,6 +5,7 @@
#include "chrome/browser/lacros/force_installed_tracker_lacros.h"

#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chromeos/lacros/lacros_service.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_registry_observer.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/metrics/chrome_metrics_service_client.cc
Expand Up @@ -56,6 +56,7 @@
#include "chrome/browser/privacy_budget/privacy_budget_metrics_provider.h"
#include "chrome/browser/privacy_budget/privacy_budget_prefs.h"
#include "chrome/browser/privacy_budget/privacy_budget_ukm_entry_filter.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/safe_browsing/certificate_reporting_metrics_provider.h"
#include "chrome/browser/safe_browsing/metrics/safe_browsing_metrics_provider.h"
#include "chrome/browser/sync/device_info_sync_service_factory.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/metrics/chrome_metrics_service_client.h
Expand Up @@ -24,7 +24,6 @@
#include "chrome/browser/metrics/incognito_observer.h"
#include "chrome/browser/metrics/metrics_memory_details.h"
#include "chrome/browser/privacy_budget/identifiability_study_state.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "components/metrics/file_metrics_provider.h"
#include "components/metrics/metrics_log_uploader.h"
Expand All @@ -46,6 +45,7 @@

class BrowserActivityWatcher;
class Profile;
class ProfileManager;
class PrefRegistrySimple;

namespace network_time {
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/performance_manager/extension_watcher.cc
Expand Up @@ -8,6 +8,7 @@
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/extensions/extension_constants.h"
#include "components/performance_manager/embedder/performance_manager_registry.h"
#include "extensions/browser/extension_host.h"
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/performance_manager/extension_watcher.h
Expand Up @@ -7,11 +7,12 @@

#include "base/scoped_multi_source_observation.h"
#include "base/scoped_observation.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_manager_observer.h"

class ProfileManager;

namespace performance_manager {

// Sets the `PageType::kExtension` type on `PageNodes` hosting extension
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/policy/cloud/user_policy_signin_service.h
Expand Up @@ -12,14 +12,14 @@
#include "base/memory/ref_counted.h"
#include "base/scoped_observation.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "components/policy/core/browser/cloud/user_policy_signin_service_base.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/signin/public/identity_manager/identity_manager.h"

class AccountId;
class Profile;
class ProfileManager;

namespace network {
class SharedURLLoaderFactory;
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/policy/extension_policy_browsertest.cc
Expand Up @@ -40,6 +40,7 @@
#include "chrome/browser/policy/policy_test_utils.h"
#include "chrome/browser/policy/profile_policy_connector_builder.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_test_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
Expand Down
Expand Up @@ -10,7 +10,6 @@
#include "base/scoped_observation.h"
#include "base/supports_user_data.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "chrome/browser/profiles/profile_observer.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/signin/signin_ui_util_unittest.cc
Expand Up @@ -14,6 +14,7 @@
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile_attributes_init_params.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/identity_test_environment_profile_adaptor.h"
#include "chrome/browser/signin/signin_promo.h"
Expand Down
7 changes: 3 additions & 4 deletions chrome/browser/ui/views/commander_frontend_views.h
Expand Up @@ -5,20 +5,19 @@
#ifndef CHROME_BROWSER_UI_VIEWS_COMMANDER_FRONTEND_VIEWS_H_
#define CHROME_BROWSER_UI_VIEWS_COMMANDER_FRONTEND_VIEWS_H_

#include "base/memory/raw_ptr.h"
#include "chrome/browser/ui/commander/commander_frontend.h"

#include <memory>

#include "base/callback_list.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser_list_observer.h"
#include "chrome/browser/ui/commander/commander_frontend.h"
#include "chrome/browser/ui/webui/commander/commander_handler.h"
#include "ui/views/widget/widget_observer.h"

class CommanderFocusLossWatcher;
class CommanderWebView;
class Profile;

namespace views {
class WidgetDelegate;
Expand Down
Expand Up @@ -9,6 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "chrome/browser/download/download_ui_model.h"
#include "chrome/browser/ui/download/download_item_mode.h"
#include "chrome/browser/ui/views/controls/hover_button.h"
Expand Down
Expand Up @@ -5,12 +5,13 @@
#include "chrome/browser/ui/views/extensions/extensions_dialogs_browsertest.h"

#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions_toolbar_container.h"
#include "ui/views/layout/animating_layout_manager_test_util.h"

scoped_refptr<const extensions::Extension>
Expand Down
Expand Up @@ -25,6 +25,7 @@
#include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h"
#include "chrome/browser/web_applications/policy/web_app_policy_manager.h"
#include "chrome/browser/web_applications/test/web_app_test_observers.h"
Expand Down
Expand Up @@ -20,6 +20,10 @@

class Profile;

namespace user_prefs {
class PrefRegistrySyncable;
}

namespace web_app {

class WebAppFileHandlerManager;
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/web_applications/web_app_registrar.h
Expand Up @@ -18,7 +18,6 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/scoped_observation.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h"
#include "chrome/browser/web_applications/proto/web_app_os_integration_state.pb.h"
Expand All @@ -33,6 +32,8 @@
#include "third_party/blink/public/common/permissions_policy/permissions_policy.h"
#include "third_party/skia/include/core/SkColor.h"

class ProfileManager;

namespace apps {
struct ShareTarget;
} // namespace apps
Expand Down
1 change: 1 addition & 0 deletions chrome/test/base/test_browser_window.h
Expand Up @@ -16,6 +16,7 @@
#include "chrome/browser/ui/autofill/test/test_autofill_bubble_handler.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_list_observer.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/location_bar/location_bar.h"
#include "chrome/browser/ui/translate/partial_translate_bubble_model.h"
Expand Down

0 comments on commit 4ae3366

Please sign in to comment.