summaryrefslogtreecommitdiffstats
path: root/chrome/browser/task_manager
diff options
context:
space:
mode:
authordimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-18 04:26:40 +0000
committerdimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-18 04:26:40 +0000
commita93e63f51978209ca3bef8e92c3ec11ce162153f (patch)
tree5b321866bf554c0726100e51dbb2402f72f363e6 /chrome/browser/task_manager
parent7a3adb111a6cd0d35fdca47c8938e78086a5f64a (diff)
downloadchromium_src-a93e63f51978209ca3bef8e92c3ec11ce162153f.zip
chromium_src-a93e63f51978209ca3bef8e92c3ec11ce162153f.tar.gz
chromium_src-a93e63f51978209ca3bef8e92c3ec11ce162153f.tar.bz2
Add initial plumbing to route Notifications to MessageCenter on Windows.
NotificationUIManager interface now does not expose BallonCollection and any Balloon-related data. Also it splits the existing NotificationUIManagerImpl into 2 classes: 1. NotificationUIManagerImpl - contains 'wait_queue', where incoming notifications sit while screen is locked or in fullscreen etc, waiting for display. 2. BalloonNotificationUIManager (subclass of NotificationUIManagerImpl) - the BalloonCollection-based display manager, supporting Balloons and related logic. Still used on Win/Mac/Linux and ChromeOS (temporarily). Also, introduces a new class, MessageCenterBridge (subclass of NotificationUIManager), which is empty in this CL, in next it will delegate the work to MessageCenter instance. Tests that expect to see BalloonCollection now use BalloonNotificationUIManager::GetInstanceForTest() which logs an error and returns NULL if MessageCenter is used. This should not happen on bots as new code is under a flag. R=stevenjb@chromium.org TBR=ben@chromium.org (gypi changes) Review URL: https://chromiumcodereview.appspot.com/11543011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173645 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager')
-rw-r--r--chrome/browser/task_manager/task_manager_notification_resource_provider.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/chrome/browser/task_manager/task_manager_notification_resource_provider.cc b/chrome/browser/task_manager/task_manager_notification_resource_provider.cc
index db61f13..8fbbce0 100644
--- a/chrome/browser/task_manager/task_manager_notification_resource_provider.cc
+++ b/chrome/browser/task_manager/task_manager_notification_resource_provider.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/notifications/balloon.h"
#include "chrome/browser/notifications/balloon_collection.h"
#include "chrome/browser/notifications/balloon_host.h"
+#include "chrome/browser/notifications/balloon_notification_ui_manager.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
@@ -114,20 +115,26 @@ TaskManager::Resource* TaskManagerNotificationResourceProvider::GetResource(
}
void TaskManagerNotificationResourceProvider::StartUpdating() {
+ // MessageCenter does not use Balloons.
+ if (NotificationUIManager::DelegatesToMessageCenter())
+ return;
+
DCHECK(!updating_);
updating_ = true;
// Add all the existing BalloonHosts.
- BalloonCollection* collection =
- g_browser_process->notification_ui_manager()->balloon_collection();
- const BalloonCollection::Balloons& balloons = collection->GetActiveBalloons();
+ BalloonNotificationUIManager* balloon_manager =
+ static_cast<BalloonNotificationUIManager*>(
+ g_browser_process->notification_ui_manager());
+ BalloonCollection* collection = balloon_manager->balloon_collection();
+ const BalloonCollection::Balloons& balloons =
+ collection->GetActiveBalloons();
for (BalloonCollection::Balloons::const_iterator it = balloons.begin();
it != balloons.end(); ++it) {
BalloonHost* balloon_host = (*it)->balloon_view()->GetHost();
if (balloon_host)
AddToTaskManager(balloon_host);
}
-
// Register for notifications about extension process changes.
registrar_.Add(this, chrome::NOTIFICATION_NOTIFY_BALLOON_CONNECTED,
content::NotificationService::AllSources());
@@ -136,6 +143,10 @@ void TaskManagerNotificationResourceProvider::StartUpdating() {
}
void TaskManagerNotificationResourceProvider::StopUpdating() {
+ // MessageCenter does not use Balloons.
+ if (NotificationUIManager::DelegatesToMessageCenter())
+ return;
+
DCHECK(updating_);
updating_ = false;