summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_impl.cc
diff options
context:
space:
mode:
authorrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-28 00:24:25 +0000
committerrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-28 00:24:25 +0000
commit9e7f015f8d8e5bdb6b2061831a91067ad7ea597b (patch)
treeda225329fa1c3eb7178920108f0306027d677eda /chrome/browser/browser_process_impl.cc
parente4695f7bd6821bf4156863087e2acdd3e84befd2 (diff)
downloadchromium_src-9e7f015f8d8e5bdb6b2061831a91067ad7ea597b.zip
chromium_src-9e7f015f8d8e5bdb6b2061831a91067ad7ea597b.tar.gz
chromium_src-9e7f015f8d8e5bdb6b2061831a91067ad7ea597b.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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86726 Review URL: http://codereview.chromium.org/6914021 Review URL: http://codereview.chromium.org/7008026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87119 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r--chrome/browser/browser_process_impl.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 7f8b7e9..6337197 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"
@@ -628,6 +630,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());
@@ -962,6 +978,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();