summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/notifications/message_center_notification_manager.cc22
-rw-r--r--chrome/browser/notifications/message_center_notification_manager.h14
-rw-r--r--chrome/browser/notifications/message_center_notifications_browsertest.cc27
3 files changed, 1 insertions, 62 deletions
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc
index 46d22de..5ea8d24 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -9,7 +9,6 @@
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
#include "base/stl_util.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/api/notification_provider/notification_provider_api.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/desktop_notification_service_factory.h"
@@ -21,17 +20,11 @@
#include "chrome/browser/notifications/notification_conversion_helper.h"
#include "chrome/browser/notifications/screen_lock_notification_blocker.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/chrome_pages.h"
-#include "chrome/browser/ui/host_desktop.h"
#include "chrome/common/extensions/api/notification_provider.h"
#include "chrome/common/pref_names.h"
-#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/extension_system.h"
-#include "extensions/browser/info_map.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/permissions/permissions_data.h"
#include "ui/gfx/image/image_skia.h"
@@ -94,9 +87,6 @@ MessageCenterNotificationManager::MessageCenterNotificationManager(
// views.Other platforms have global ownership and Create will return NULL.
tray_.reset(message_center::CreateMessageCenterTray());
#endif
- registrar_.Add(this,
- chrome::NOTIFICATION_FULLSCREEN_CHANGED,
- content::NotificationService::AllSources());
}
MessageCenterNotificationManager::~MessageCenterNotificationManager() {
@@ -325,18 +315,6 @@ void MessageCenterNotificationManager::SetMessageCenterTrayDelegateForTest(
tray_.reset(delegate);
}
-void MessageCenterNotificationManager::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_FULLSCREEN_CHANGED) {
- const bool is_fullscreen = *content::Details<bool>(details).ptr();
-
- if (is_fullscreen && tray_.get() && tray_->GetMessageCenterTray())
- tray_->GetMessageCenterTray()->HidePopupBubble();
- }
-}
-
////////////////////////////////////////////////////////////////////////////////
// ImageDownloads
diff --git a/chrome/browser/notifications/message_center_notification_manager.h b/chrome/browser/notifications/message_center_notification_manager.h
index 918fb11..6ae1ad8 100644
--- a/chrome/browser/notifications/message_center_notification_manager.h
+++ b/chrome/browser/notifications/message_center_notification_manager.h
@@ -19,8 +19,6 @@
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_system_observer.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/message_center_observer.h"
#include "ui/message_center/message_center_tray_delegate.h"
@@ -41,8 +39,7 @@ FORWARD_DECLARE_TEST(WebNotificationTrayTest, ManuallyCloseMessageCenter);
// of notifications to MessageCenter, doing necessary conversions.
class MessageCenterNotificationManager
: public NotificationUIManager,
- public message_center::MessageCenterObserver,
- public content::NotificationObserver {
+ public message_center::MessageCenterObserver {
public:
MessageCenterNotificationManager(
message_center::MessageCenter* message_center,
@@ -91,12 +88,6 @@ class MessageCenterNotificationManager
void SetMessageCenterTrayDelegateForTest(
message_center::MessageCenterTrayDelegate* delegate);
- protected:
- // content::NotificationObserver override.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
private:
FRIEND_TEST_ALL_PREFIXES(message_center::WebNotificationTrayTest,
ManuallyCloseMessageCenter);
@@ -236,9 +227,6 @@ class MessageCenterNotificationManager
// To own the blockers.
ScopedVector<message_center::NotificationBlocker> blockers_;
- // Registrar for the other kind of notifications (event signaling).
- content::NotificationRegistrar registrar_;
-
NotificationSystemObserver system_observer_;
// Keeps track of all notification statistics for UMA purposes.
diff --git a/chrome/browser/notifications/message_center_notifications_browsertest.cc b/chrome/browser/notifications/message_center_notifications_browsertest.cc
index 40a3b49..237d62e 100644
--- a/chrome/browser/notifications/message_center_notifications_browsertest.cc
+++ b/chrome/browser/notifications/message_center_notifications_browsertest.cc
@@ -11,7 +11,6 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/notifications/message_center_notification_manager.h"
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
@@ -19,9 +18,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/test_switches.h"
-#include "content/public/browser/notification_details.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_source.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/message_center_types.h"
@@ -345,27 +341,4 @@ IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest,
delegate->Release();
}
-#if !defined(OS_CHROMEOS)
-#define MAYBE_HideWhenFullscreenEnabled HideWhenFullscreenEnabled
-#else
-#define MAYBE_HideWhenFullscreenEnabled DISABLED_HideWhenFullscreenEnabled
-#endif
-
-IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest,
- MAYBE_HideWhenFullscreenEnabled) {
- TestDelegate* delegate;
- manager()->Add(CreateTestNotification("n", &delegate), profile());
-
- EXPECT_EQ("Display_", delegate->log());
- EXPECT_TRUE(message_center()->HasPopupNotifications());
- bool is_fullscreen = true;
- // Cast so that Observe() is public.
- content::NotificationObserver* observer =
- static_cast<content::NotificationObserver*>(manager());
- observer->Observe(chrome::NOTIFICATION_FULLSCREEN_CHANGED,
- content::Source<Profile>(profile()),
- content::Details<bool>(&is_fullscreen));
- EXPECT_FALSE(message_center()->HasPopupNotifications());
-}
-
#endif // !defined(OS_MACOSX)