summaryrefslogtreecommitdiffstats
path: root/chrome/browser/notifications
diff options
context:
space:
mode:
authordewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-31 06:07:33 +0000
committerdewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-31 06:07:33 +0000
commitc404bd8b7f13cb246d6537cd6ab9d2caa5ff4012 (patch)
tree38f000ab2a0b0c3b45790fd93dcb96cdd3a8cdd9 /chrome/browser/notifications
parent360ef9f95352c591a2c07b384f4b9cd9a8d6974a (diff)
downloadchromium_src-c404bd8b7f13cb246d6537cd6ab9d2caa5ff4012.zip
chromium_src-c404bd8b7f13cb246d6537cd6ab9d2caa5ff4012.tar.gz
chromium_src-c404bd8b7f13cb246d6537cd6ab9d2caa5ff4012.tar.bz2
Implement message center on Windows.
This takes the existing message center code for Ash, and refactors it into two layers - a system-specific layer (WebNotificationTray) and a platform-independent (modulo Views) layer (MessageCenterTray). The WebNotificationTray is responsible for rendering the tray icon and noticing system changes that cause differences in rendering. The MessageCenterTray delegates responsibility for rendering the message center and notification bubbles to the WebNotificationTray. This patch also adds a Windows port of MessageCenterTray - MessageCenterTrayWin. BUG=168605 TEST: message_center_unittests browser_tests (WebNotificationTrayWinTest.*) ash_unittests (WebNotificationTrayTest.*) Review URL: https://chromiumcodereview.appspot.com/11819048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179807 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications')
-rw-r--r--chrome/browser/notifications/message_center_notification_manager.cc7
-rw-r--r--chrome/browser/notifications/message_center_notification_manager.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc
index c6e3dcc..44f3352 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -17,11 +17,18 @@
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/common/extensions/extension_set.h"
#include "chrome/common/pref_names.h"
+#include "ui/message_center/message_center_tray.h"
MessageCenterNotificationManager::MessageCenterNotificationManager(
message_center::MessageCenter* message_center)
: message_center_(message_center) {
message_center_->SetDelegate(this);
+
+#if !defined(OS_CHROMEOS)
+ // On Windows, the notification manager owns the tray icon and views. Other
+ // platforms have global ownership and Create will return NULL.
+ tray_.reset(message_center::CreateMessageCenterTray());
+#endif
}
MessageCenterNotificationManager::~MessageCenterNotificationManager() {
diff --git a/chrome/browser/notifications/message_center_notification_manager.h b/chrome/browser/notifications/message_center_notification_manager.h
index 00d111d..0f4939b 100644
--- a/chrome/browser/notifications/message_center_notification_manager.h
+++ b/chrome/browser/notifications/message_center_notification_manager.h
@@ -13,6 +13,7 @@
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/browser/notifications/notification_ui_manager_impl.h"
#include "ui/message_center/message_center.h"
+#include "ui/message_center/message_center_tray_delegate.h"
class Notification;
class Profile;
@@ -52,6 +53,7 @@ class MessageCenterNotificationManager
int button_index) OVERRIDE;
private:
+ scoped_ptr<message_center::MessageCenterTrayDelegate> tray_;
message_center::MessageCenter* message_center_; // Weak, global.
// This class keeps a set of original Notification objects and corresponding