Commit e415584f authored by thestig's avatar thestig Committed by Commit bot

Cleanup: Only include background_mode_manager.h when ENABLE_BACKGROUND is defined.

Also move some extension headers to ENABLE_EXTENSIONS sections.

BUG=424746

Review URL: https://codereview.chromium.org/662783002

Cr-Commit-Position: refs/heads/master@{#300306}
parent 18d0a569
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "base/time/default_tick_clock.h" #include "base/time/default_tick_clock.h"
#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/chrome_browser_main.h" #include "chrome/browser/chrome_browser_main.h"
#include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
...@@ -91,7 +90,6 @@ ...@@ -91,7 +90,6 @@
#include "content/public/browser/service_worker_context.h" #include "content/public/browser/service_worker_context.h"
#include "content/public/browser/storage_partition.h" #include "content/public/browser/storage_partition.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "extensions/common/extension_l10n_util.h"
#include "net/socket/client_socket_pool_manager.h" #include "net/socket/client_socket_pool_manager.h"
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -116,6 +114,10 @@ ...@@ -116,6 +114,10 @@
#include "ui/aura/env.h" #include "ui/aura/env.h"
#endif #endif
#if defined(ENABLE_BACKGROUND)
#include "chrome/browser/background/background_mode_manager.h"
#endif
#if defined(ENABLE_CONFIGURATION_POLICY) #if defined(ENABLE_CONFIGURATION_POLICY)
#include "components/policy/core/browser/browser_policy_connector.h" #include "components/policy/core/browser/browser_policy_connector.h"
#else #else
...@@ -128,6 +130,7 @@ ...@@ -128,6 +130,7 @@
#include "chrome/browser/extensions/extension_renderer_state.h" #include "chrome/browser/extensions/extension_renderer_state.h"
#include "chrome/browser/media_galleries/media_file_system_registry.h" #include "chrome/browser/media_galleries/media_file_system_registry.h"
#include "components/storage_monitor/storage_monitor.h" #include "components/storage_monitor/storage_monitor.h"
#include "extensions/common/extension_l10n_util.h"
#endif #endif
#if !defined(DISABLE_NACL) #if !defined(DISABLE_NACL)
...@@ -727,7 +730,9 @@ const std::string& BrowserProcessImpl::GetApplicationLocale() { ...@@ -727,7 +730,9 @@ const std::string& BrowserProcessImpl::GetApplicationLocale() {
void BrowserProcessImpl::SetApplicationLocale(const std::string& locale) { void BrowserProcessImpl::SetApplicationLocale(const std::string& locale) {
locale_ = locale; locale_ = locale;
#if defined(ENABLE_EXTENSIONS)
extension_l10n_util::SetProcessLocale(locale); extension_l10n_util::SetProcessLocale(locale);
#endif
chrome::ChromeContentBrowserClient::SetApplicationLocale(locale); chrome::ChromeContentBrowserClient::SetApplicationLocale(locale);
translate::TranslateDownloadManager::GetInstance()->set_application_locale( translate::TranslateDownloadManager::GetInstance()->set_application_locale(
locale); locale);
...@@ -841,7 +846,9 @@ BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { ...@@ -841,7 +846,9 @@ BackgroundModeManager* BrowserProcessImpl::background_mode_manager() {
void BrowserProcessImpl::set_background_mode_manager_for_test( void BrowserProcessImpl::set_background_mode_manager_for_test(
scoped_ptr<BackgroundModeManager> manager) { scoped_ptr<BackgroundModeManager> manager) {
#if defined(ENABLE_BACKGROUND)
background_mode_manager_ = manager.Pass(); background_mode_manager_ = manager.Pass();
#endif
} }
StatusTray* BrowserProcessImpl::status_tray() { StatusTray* BrowserProcessImpl::status_tray() {
...@@ -1085,10 +1092,12 @@ void BrowserProcessImpl::CreateNotificationUIManager() { ...@@ -1085,10 +1092,12 @@ void BrowserProcessImpl::CreateNotificationUIManager() {
} }
void BrowserProcessImpl::CreateBackgroundModeManager() { void BrowserProcessImpl::CreateBackgroundModeManager() {
#if defined(ENABLE_BACKGROUND)
DCHECK(background_mode_manager_.get() == NULL); DCHECK(background_mode_manager_.get() == NULL);
background_mode_manager_.reset( background_mode_manager_.reset(
new BackgroundModeManager(CommandLine::ForCurrentProcess(), new BackgroundModeManager(CommandLine::ForCurrentProcess(),
&profile_manager()->GetProfileInfoCache())); &profile_manager()->GetProfileInfoCache()));
#endif
} }
void BrowserProcessImpl::CreateStatusTray() { void BrowserProcessImpl::CreateStatusTray() {
......
...@@ -222,7 +222,9 @@ class BrowserProcessImpl : public BrowserProcess, ...@@ -222,7 +222,9 @@ class BrowserProcessImpl : public BrowserProcess,
scoped_ptr<StatusTray> status_tray_; scoped_ptr<StatusTray> status_tray_;
#if defined(ENABLE_BACKGROUND)
scoped_ptr<BackgroundModeManager> background_mode_manager_; scoped_ptr<BackgroundModeManager> background_mode_manager_;
#endif
bool created_safe_browsing_service_; bool created_safe_browsing_service_;
scoped_refptr<SafeBrowsingService> safe_browsing_service_; scoped_refptr<SafeBrowsingService> safe_browsing_service_;
......
...@@ -13,10 +13,7 @@ ...@@ -13,10 +13,7 @@
#include "base/prefs/scoped_user_pref_update.h" #include "base/prefs/scoped_user_pref_update.h"
#include "chrome/browser/about_flags.h" #include "chrome/browser/about_flags.h"
#include "chrome/browser/accessibility/invert_bubble_prefs.h" #include "chrome/browser/accessibility/invert_bubble_prefs.h"
#include "chrome/browser/apps/drive/drive_app_mapping.h"
#include "chrome/browser/apps/shortcut_manager.h"
#include "chrome/browser/autocomplete/zero_suggest_provider.h" #include "chrome/browser/autocomplete/zero_suggest_provider.h"
#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/browser_process_impl.h" #include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/browser_shutdown.h" #include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_content_browser_client.h"
...@@ -105,6 +102,10 @@ ...@@ -105,6 +102,10 @@
#include "chrome/browser/ui/autofill/autofill_dialog_controller.h" #include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
#endif #endif
#if defined(ENABLE_BACKGROUND)
#include "chrome/browser/background/background_mode_manager.h"
#endif
#if defined(ENABLE_CONFIGURATION_POLICY) #if defined(ENABLE_CONFIGURATION_POLICY)
#include "components/policy/core/browser/browser_policy_connector.h" #include "components/policy/core/browser/browser_policy_connector.h"
#include "components/policy/core/browser/url_blacklist_manager.h" #include "components/policy/core/browser/url_blacklist_manager.h"
...@@ -112,6 +113,8 @@ ...@@ -112,6 +113,8 @@
#endif #endif
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/apps/drive/drive_app_mapping.h"
#include "chrome/browser/apps/shortcut_manager.h"
#include "chrome/browser/extensions/activity_log/activity_log.h" #include "chrome/browser/extensions/activity_log/activity_log.h"
#include "chrome/browser/extensions/api/commands/command_service.h" #include "chrome/browser/extensions/api/commands/command_service.h"
#include "chrome/browser/extensions/api/tabs/tabs_api.h" #include "chrome/browser/extensions/api/tabs/tabs_api.h"
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "chrome/browser/autocomplete/autocomplete_classifier.h" #include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/autocomplete/shortcuts_backend.h" #include "chrome/browser/autocomplete/shortcuts_backend.h"
#include "chrome/browser/background/background_contents_service_factory.h" #include "chrome/browser/background/background_contents_service_factory.h"
#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
...@@ -117,6 +116,10 @@ ...@@ -117,6 +116,10 @@
#include "components/user_manager/user_manager.h" #include "components/user_manager/user_manager.h"
#endif #endif
#if defined(ENABLE_BACKGROUND)
#include "chrome/browser/background/background_mode_manager.h"
#endif
#if defined(ENABLE_CONFIGURATION_POLICY) #if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/policy/schema_registry_service.h" #include "chrome/browser/policy/schema_registry_service.h"
#include "chrome/browser/policy/schema_registry_service_factory.h" #include "chrome/browser/policy/schema_registry_service_factory.h"
...@@ -574,6 +577,7 @@ void ProfileImpl::DoFinalInit() { ...@@ -574,6 +577,7 @@ void ProfileImpl::DoFinalInit() {
ssl_config_service_manager_.reset( ssl_config_service_manager_.reset(
SSLConfigServiceManager::CreateDefaultManager(local_state)); SSLConfigServiceManager::CreateDefaultManager(local_state));
#if defined(ENABLE_BACKGROUND)
// Initialize the BackgroundModeManager - this has to be done here before // Initialize the BackgroundModeManager - this has to be done here before
// InitExtensions() is called because it relies on receiving notifications // InitExtensions() is called because it relies on receiving notifications
// when extensions are loaded. BackgroundModeManager is not needed under // when extensions are loaded. BackgroundModeManager is not needed under
...@@ -588,6 +592,7 @@ void ProfileImpl::DoFinalInit() { ...@@ -588,6 +592,7 @@ void ProfileImpl::DoFinalInit() {
if (g_browser_process->background_mode_manager()) if (g_browser_process->background_mode_manager())
g_browser_process->background_mode_manager()->RegisterProfile(this); g_browser_process->background_mode_manager()->RegisterProfile(this);
} }
#endif // defined(ENABLE_BACKGROUND)
base::FilePath cookie_path = GetPath(); base::FilePath cookie_path = GetPath();
cookie_path = cookie_path.Append(chrome::kCookieFilename); cookie_path = cookie_path.Append(chrome::kCookieFilename);
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/time/default_tick_clock.h" #include "base/time/default_tick_clock.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_impl.h" #include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/printing/print_job_manager.h" #include "chrome/browser/printing/print_job_manager.h"
...@@ -27,6 +26,10 @@ ...@@ -27,6 +26,10 @@
#include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h"
#endif #endif
#if defined(ENABLE_BACKGROUND)
#include "chrome/browser/background/background_mode_manager.h"
#endif
#if defined(ENABLE_CONFIGURATION_POLICY) #if defined(ENABLE_CONFIGURATION_POLICY)
#include "components/policy/core/browser/browser_policy_connector.h" #include "components/policy/core/browser/browser_policy_connector.h"
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment