diff options
author | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 22:26:28 +0000 |
---|---|---|
committer | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-25 22:26:28 +0000 |
commit | df3d71d622f8c0c2b716872705358d3f3c928ffb (patch) | |
tree | 2a0fc0a16f0d2506107b2bf29c1db7d464c33ce8 /chrome/browser/browser_process_impl.cc | |
parent | 5ecfbdd7b3f61d372536bd68cc9a372beeec9dfb (diff) | |
download | chromium_src-df3d71d622f8c0c2b716872705358d3f3c928ffb.zip chromium_src-df3d71d622f8c0c2b716872705358d3f3c928ffb.tar.gz chromium_src-df3d71d622f8c0c2b716872705358d3f3c928ffb.tar.bz2 |
Modifying the BackgroundModeManager to handle multiple profiles.
The background mode manager is now owned by the broser
The status tray is also owned by the browser process since there is only one per browser. Previously it was owned by the profile, but now that there are multiple profiles, it makes sense to have the browser process own it.
Note: This CL does not unify the status tray into one icon.
TEST=unittests (added BackgroundModeManagerTest::MultiProfile)
BUG=80069,82215
Review URL: http://codereview.chromium.org/6914021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 481fa18..da43113 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -16,6 +16,7 @@ #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" #include "chrome/browser/automation/automation_provider_list.h" +#include "chrome/browser/background_mode_manager.h" #include "chrome/browser/browser_main.h" #include "chrome/browser/browser_process_sub_thread.h" #include "chrome/browser/browser_trial.h" @@ -55,6 +56,7 @@ #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/sidebar/sidebar_manager.h" +#include "chrome/browser/status_icons/status_tray.h" #include "chrome/browser/tab_closeable_state_watcher.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/common/chrome_constants.h" @@ -637,6 +639,20 @@ TabCloseableStateWatcher* BrowserProcessImpl::tab_closeable_state_watcher() { return tab_closeable_state_watcher_.get(); } +BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { + DCHECK(CalledOnValidThread()); + if (!background_mode_manager_.get()) + CreateBackgroundModeManager(); + return background_mode_manager_.get(); +} + +StatusTray* BrowserProcessImpl::status_tray() { + DCHECK(CalledOnValidThread()); + if (!status_tray_.get()) + CreateStatusTray(); + return status_tray_.get(); +} + safe_browsing::ClientSideDetectionService* BrowserProcessImpl::safe_browsing_detection_service() { DCHECK(CalledOnValidThread()); @@ -989,6 +1005,17 @@ void BrowserProcessImpl::CreateTabCloseableStateWatcher() { tab_closeable_state_watcher_.reset(TabCloseableStateWatcher::Create()); } +void BrowserProcessImpl::CreateBackgroundModeManager() { + DCHECK(background_mode_manager_.get() == NULL); + background_mode_manager_.reset( + new BackgroundModeManager(CommandLine::ForCurrentProcess())); +} + +void BrowserProcessImpl::CreateStatusTray() { + DCHECK(status_tray_.get() == NULL); + status_tray_.reset(StatusTray::Create()); +} + void BrowserProcessImpl::CreatePrintPreviewTabController() { DCHECK(print_preview_tab_controller_.get() == NULL); print_preview_tab_controller_ = new printing::PrintPreviewTabController(); |