Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 11958025: Start delegating notifications to MessageCenter on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix androif build Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index eee6b04af4302511d7e17d5c5a54490a496c8834..eb14c3ea3070f7912fe851d9b2bc75927964323b 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -91,6 +91,10 @@
#include "chrome/browser/policy/policy_service_stub.h"
#endif // defined(ENABLE_CONFIGURATION_POLICY)
+#if defined(ENABLE_MESSAGE_CENTER)
+#include "ui/message_center/message_center.h"
+#endif
+
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#include "ui/views/focus/view_storage.h"
@@ -149,6 +153,7 @@ BrowserProcessImpl::BrowserProcessImpl(
created_local_state_(false),
created_icon_manager_(false),
created_notification_ui_manager_(false),
+ created_message_center_(false),
created_safe_browsing_service_(false),
module_ref_count_(0),
did_start_(false),
@@ -442,6 +447,17 @@ NotificationUIManager* BrowserProcessImpl::notification_ui_manager() {
return notification_ui_manager_.get();
}
+message_center::MessageCenter* BrowserProcessImpl::message_center() {
+#ifdef ENABLE_MESSAGE_CENTER
+ DCHECK(CalledOnValidThread());
+ if (!created_message_center_)
+ CreateMessageCenter();
+ return message_center_.get();
+#else
+ return NULL;
+#endif
+}
+
policy::BrowserPolicyConnector* BrowserProcessImpl::browser_policy_connector() {
DCHECK(CalledOnValidThread());
#if defined(ENABLE_CONFIGURATION_POLICY)
@@ -848,6 +864,14 @@ void BrowserProcessImpl::CreateNotificationUIManager() {
#endif
}
+void BrowserProcessImpl::CreateMessageCenter() {
+#if defined(ENABLE_MESSAGE_CENTER)
+ DCHECK(message_center_.get() == NULL);
+ message_center_.reset(new message_center::MessageCenter());
+ created_message_center_ = true;
+#endif
+}
+
void BrowserProcessImpl::CreateBackgroundModeManager() {
DCHECK(background_mode_manager_.get() == NULL);
background_mode_manager_.reset(

Powered by Google App Engine
This is Rietveld 408576698