diff options
28 files changed, 12 insertions, 311 deletions
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index fc49ec0..b0c954f 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc @@ -147,10 +147,6 @@ class CrashNotificationDelegate : public NotificationDelegate { return kNotificationPrefix + extension_id_; } - virtual content::WebContents* GetWebContents() const override { - return NULL; - } - private: virtual ~CrashNotificationDelegate() {} diff --git a/chrome/browser/chromeos/policy/consumer_enrollment_handler.cc b/chrome/browser/chromeos/policy/consumer_enrollment_handler.cc index 5c31a12..aa1238e 100644 --- a/chrome/browser/chromeos/policy/consumer_enrollment_handler.cc +++ b/chrome/browser/chromeos/policy/consumer_enrollment_handler.cc @@ -75,7 +75,6 @@ class DesktopNotificationDelegate : public NotificationDelegate { // NotificationDelegate: virtual std::string id() const override; - virtual content::WebContents* GetWebContents() const override; virtual void Display() override; virtual void ButtonClick(int button_index) override; virtual void Error() override; @@ -104,10 +103,6 @@ std::string DesktopNotificationDelegate::id() const { return id_; } -content::WebContents* DesktopNotificationDelegate::GetWebContents() const { - return NULL; -} - void DesktopNotificationDelegate::Display() { } diff --git a/chrome/browser/chromeos/power/peripheral_battery_observer.cc b/chrome/browser/chromeos/power/peripheral_battery_observer.cc index a3f4b7f..2c6cf5a 100644 --- a/chrome/browser/chromeos/power/peripheral_battery_observer.cc +++ b/chrome/browser/chromeos/power/peripheral_battery_observer.cc @@ -79,11 +79,6 @@ class PeripheralBatteryNotificationDelegate : public NotificationDelegate { virtual void Close(bool by_user) override {} virtual void Click() override {} virtual std::string id() const override { return id_; } - // A NULL return value prevents loading image from URL. It is OK since our - // implementation loads image from system resource bundle. - virtual content::WebContents* GetWebContents() const override { - return NULL; - } private: virtual ~PeripheralBatteryNotificationDelegate() {} diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc index 8b280a3..1a2391d 100644 --- a/chrome/browser/extensions/api/notifications/notifications_api.cc +++ b/chrome/browser/extensions/api/notifications/notifications_api.cc @@ -122,23 +122,6 @@ class NotificationsApiDelegate : public NotificationDelegate { return scoped_id_; } - virtual content::WebContents* GetWebContents() const override { - // We're holding a reference to api_function_, so we know it'll be valid - // until ReleaseRVH is called, and api_function_ (as a - // AsyncExtensionFunction) will zero out its copy of render_view_host - // when the RVH goes away. - if (!api_function_.get()) - return NULL; - content::RenderViewHost* rvh = api_function_->render_view_host(); - if (!rvh) - return NULL; - return content::WebContents::FromRenderViewHost(rvh); - } - - virtual void ReleaseRenderViewHost() override { - api_function_ = NULL; - } - private: virtual ~NotificationsApiDelegate() {} diff --git a/chrome/browser/local_discovery/privet_notifications.cc b/chrome/browser/local_discovery/privet_notifications.cc index 3ec7fdb..cc7d65b 100644 --- a/chrome/browser/local_discovery/privet_notifications.cc +++ b/chrome/browser/local_discovery/privet_notifications.cc @@ -370,10 +370,6 @@ std::string PrivetNotificationDelegate::id() const { return kPrivetNotificationID; } -content::WebContents* PrivetNotificationDelegate::GetWebContents() const { - return NULL; -} - void PrivetNotificationDelegate::Display() { } diff --git a/chrome/browser/local_discovery/privet_notifications.h b/chrome/browser/local_discovery/privet_notifications.h index 646eff3..aae7cdd 100644 --- a/chrome/browser/local_discovery/privet_notifications.h +++ b/chrome/browser/local_discovery/privet_notifications.h @@ -133,7 +133,6 @@ class PrivetNotificationDelegate : public NotificationDelegate { // NotificationDelegate implementation. virtual std::string id() const override; - virtual content::WebContents* GetWebContents() const override; virtual void Display() override; virtual void Error() override; virtual void Close(bool by_user) override; diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc index 48dc1e5..c1434fd 100644 --- a/chrome/browser/notifications/desktop_notification_service.cc +++ b/chrome/browser/notifications/desktop_notification_service.cc @@ -159,8 +159,7 @@ void DesktopNotificationService::ShowDesktopNotification( base::Closure* cancel_callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); const GURL& origin = params.origin; - NotificationObjectProxy* proxy = - new NotificationObjectProxy(render_frame_host, delegate.Pass()); + NotificationObjectProxy* proxy = new NotificationObjectProxy(delegate.Pass()); base::string16 display_source = DisplayNameForOriginInProcessId( origin, render_frame_host->GetProcess()->GetID()); diff --git a/chrome/browser/notifications/extension_welcome_notification_unittest.cc b/chrome/browser/notifications/extension_welcome_notification_unittest.cc index b523376..4e6917b 100644 --- a/chrome/browser/notifications/extension_welcome_notification_unittest.cc +++ b/chrome/browser/notifications/extension_welcome_notification_unittest.cc @@ -217,10 +217,6 @@ class ExtensionWelcomeNotificationTest : public testing::Test { virtual std::string id() const override { return id_; } - virtual content::WebContents* GetWebContents() const override { - return NULL; - } - private: virtual ~TestNotificationDelegate() {} diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc index e4f20c2..b3deecb 100644 --- a/chrome/browser/notifications/message_center_notification_manager.cc +++ b/chrome/browser/notifications/message_center_notification_manager.cc @@ -158,7 +158,6 @@ void MessageCenterNotificationManager::Add(const Notification& notification, message_center_->AddNotification(make_scoped_ptr( new message_center::Notification(profile_notification->notification()))); - profile_notification->StartDownloads(); } bool MessageCenterNotificationManager::Update(const Notification& notification, @@ -203,7 +202,6 @@ bool MessageCenterNotificationManager::Update(const Notification& notification, make_scoped_ptr(new message_center::Notification( new_notification->notification()))); - new_notification->StartDownloads(); return true; } } @@ -362,116 +360,6 @@ MessageCenterNotificationManager::GetMessageCenterNotificationIdForTest( } //////////////////////////////////////////////////////////////////////////////// -// ImageDownloads - -MessageCenterNotificationManager::ImageDownloads::ImageDownloads( - message_center::MessageCenter* message_center, - ImageDownloadsObserver* observer) - : message_center_(message_center), - pending_downloads_(0), - observer_(observer) { -} - -MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { } - -void MessageCenterNotificationManager::ImageDownloads::StartDownloads( - const Notification& notification) { - // In case all downloads are synchronous, assume a pending download. - AddPendingDownload(); - - // Notification image. - StartDownloadWithImage( - notification, - NULL, - notification.image_url(), - base::Bind(&message_center::MessageCenter::SetNotificationImage, - base::Unretained(message_center_), - notification.id())); - - // Notification button icons. - StartDownloadWithImage( - notification, - NULL, - notification.button_one_icon_url(), - base::Bind(&message_center::MessageCenter::SetNotificationButtonIcon, - base::Unretained(message_center_), - notification.id(), - 0)); - StartDownloadWithImage( - notification, - NULL, - notification.button_two_icon_url(), - base::Bind(&message_center::MessageCenter::SetNotificationButtonIcon, - base::Unretained(message_center_), - notification.id(), - 1)); - - // This should tell the observer we're done if everything was synchronous. - PendingDownloadCompleted(); -} - -void MessageCenterNotificationManager::ImageDownloads::StartDownloadWithImage( - const Notification& notification, - const gfx::Image* image, - const GURL& url, - const SetImageCallback& callback) { - // Set the image directly if we have it. - if (image && !image->IsEmpty()) { - callback.Run(*image); - return; - } - - // Leave the image null if there's no URL. - if (url.is_empty()) - return; - - content::WebContents* contents = notification.delegate()->GetWebContents(); - if (!contents) { - LOG(WARNING) << "Notification needs an image but has no WebContents"; - return; - } - - AddPendingDownload(); - - contents->DownloadImage( - url, - false, // Not a favicon - 0, // No maximum size - base::Bind( - &MessageCenterNotificationManager::ImageDownloads::DownloadComplete, - AsWeakPtr(), - callback)); -} - -void MessageCenterNotificationManager::ImageDownloads::DownloadComplete( - const SetImageCallback& callback, - int download_id, - int http_status_code, - const GURL& image_url, - const std::vector<SkBitmap>& bitmaps, - const std::vector<gfx::Size>& original_bitmap_sizes) { - PendingDownloadCompleted(); - - if (bitmaps.empty()) - return; - gfx::Image image = gfx::Image::CreateFrom1xBitmap(bitmaps[0]); - callback.Run(image); -} - -// Private methods. - -void MessageCenterNotificationManager::ImageDownloads::AddPendingDownload() { - ++pending_downloads_; -} - -void -MessageCenterNotificationManager::ImageDownloads::PendingDownloadCompleted() { - DCHECK(pending_downloads_ > 0); - if (--pending_downloads_ == 0 && observer_) - observer_->OnDownloadsCompleted(); -} - -//////////////////////////////////////////////////////////////////////////////// // ProfileNotification MessageCenterNotificationManager::ProfileNotification::ProfileNotification( @@ -484,8 +372,7 @@ MessageCenterNotificationManager::ProfileNotification::ProfileNotification( // id, which should be unique for every profile + Notification pair. GetProfileNotificationId(notification.delegate_id(), GetProfileID(profile)), - notification), - downloads_(new ImageDownloads(message_center, this)) { + notification) { DCHECK(profile); #if defined(OS_CHROMEOS) notification_.set_profile_id(multi_user_util::GetUserIDFromProfile(profile)); @@ -495,15 +382,6 @@ MessageCenterNotificationManager::ProfileNotification::ProfileNotification( MessageCenterNotificationManager::ProfileNotification::~ProfileNotification() { } -void MessageCenterNotificationManager::ProfileNotification::StartDownloads() { - downloads_->StartDownloads(notification_); -} - -void -MessageCenterNotificationManager::ProfileNotification::OnDownloadsCompleted() { - notification_.delegate()->ReleaseRenderViewHost(); -} - void MessageCenterNotificationManager::ProfileNotification::AddToAlternateProvider( const std::string extension_id) { diff --git a/chrome/browser/notifications/message_center_notification_manager.h b/chrome/browser/notifications/message_center_notification_manager.h index af449a7..e3c5929 100644 --- a/chrome/browser/notifications/message_center_notification_manager.h +++ b/chrome/browser/notifications/message_center_notification_manager.h @@ -97,55 +97,6 @@ class MessageCenterNotificationManager private: FRIEND_TEST_ALL_PREFIXES(message_center::WebNotificationTrayTest, ManuallyCloseMessageCenter); - class ImageDownloadsObserver { - public: - virtual void OnDownloadsCompleted() = 0; - }; - - typedef base::Callback<void(const gfx::Image&)> SetImageCallback; - class ImageDownloads - : public base::SupportsWeakPtr<ImageDownloads> { - public: - ImageDownloads( - message_center::MessageCenter* message_center, - ImageDownloadsObserver* observer); - virtual ~ImageDownloads(); - - void StartDownloads(const Notification& notification); - void StartDownloadWithImage(const Notification& notification, - const gfx::Image* image, - const GURL& url, - const SetImageCallback& callback); - void StartDownloadByKey(const Notification& notification, - const char* key, - int size, - const SetImageCallback& callback); - - // FaviconHelper callback. - void DownloadComplete(const SetImageCallback& callback, - int download_id, - int http_status_code, - const GURL& image_url, - const std::vector<SkBitmap>& bitmaps, - const std::vector<gfx::Size>& original_bitmap_sizes); - private: - // Used to keep track of the number of pending downloads. Once this - // reaches zero, we can tell the delegate that we don't need the - // RenderViewHost anymore. - void AddPendingDownload(); - void PendingDownloadCompleted(); - - // Weak reference to global message center. - message_center::MessageCenter* message_center_; - - // Count of downloads that remain. - size_t pending_downloads_; - - // Weak. - ImageDownloadsObserver* observer_; - - DISALLOW_COPY_AND_ASSIGN(ImageDownloads); - }; // This class keeps a set of original Notification objects and corresponding // Profiles, so when MessageCenter calls back with a notification_id, this @@ -159,18 +110,13 @@ class MessageCenterNotificationManager // TODO(dimich): Consider merging all 4 types (Notification, // QueuedNotification, ProfileNotification and NotificationList::Notification) // into a single class. - class ProfileNotification : public ImageDownloadsObserver { + class ProfileNotification { public: ProfileNotification(Profile* profile, const Notification& notification, message_center::MessageCenter* message_center); virtual ~ProfileNotification(); - void StartDownloads(); - - // Overridden from ImageDownloadsObserver. - virtual void OnDownloadsCompleted() override; - Profile* profile() const { return profile_; } const Notification& notification() const { return notification_; } @@ -181,9 +127,6 @@ class MessageCenterNotificationManager // Weak, guaranteed not to be used after profile removal by parent class. Profile* profile_; Notification notification_; - // Track the downloads for this notification so the notification can be - // updated properly. - scoped_ptr<ImageDownloads> downloads_; }; scoped_ptr<message_center::MessageCenterTrayDelegate> tray_; diff --git a/chrome/browser/notifications/message_center_notifications_browsertest.cc b/chrome/browser/notifications/message_center_notifications_browsertest.cc index 3b0fcd0..87c00c4 100644 --- a/chrome/browser/notifications/message_center_notifications_browsertest.cc +++ b/chrome/browser/notifications/message_center_notifications_browsertest.cc @@ -84,9 +84,6 @@ class MessageCenterNotificationsTest : public InProcessBrowserTest { log_ += base::IntToString(button_index) + "_"; } virtual std::string id() const override { return id_; } - virtual content::WebContents* GetWebContents() const override { - return NULL; - } const std::string& log() { return log_; } diff --git a/chrome/browser/notifications/notification.cc b/chrome/browser/notifications/notification.cc index 22e79e4..d182c6b 100644 --- a/chrome/browser/notifications/notification.cc +++ b/chrome/browser/notifications/notification.cc @@ -53,9 +53,6 @@ Notification::Notification(const std::string& id, const Notification& notification) : message_center::Notification(id, notification), origin_url_(notification.origin_url()), - button_one_icon_url_(notification.button_one_icon_url()), - button_two_icon_url_(notification.button_two_icon_url()), - image_url_(notification.image_url()), replace_id_(notification.replace_id()), delegate_(notification.delegate()) { } @@ -63,9 +60,6 @@ Notification::Notification(const std::string& id, Notification::Notification(const Notification& notification) : message_center::Notification(notification), origin_url_(notification.origin_url()), - button_one_icon_url_(notification.button_one_icon_url()), - button_two_icon_url_(notification.button_two_icon_url()), - image_url_(notification.image_url()), replace_id_(notification.replace_id()), delegate_(notification.delegate()) {} @@ -74,9 +68,6 @@ Notification::~Notification() {} Notification& Notification::operator=(const Notification& notification) { message_center::Notification::operator=(notification); origin_url_ = notification.origin_url(); - button_one_icon_url_ = notification.button_one_icon_url(); - button_two_icon_url_ = notification.button_two_icon_url(); - image_url_ = notification.image_url(); replace_id_ = notification.replace_id(); delegate_ = notification.delegate(); return *this; diff --git a/chrome/browser/notifications/notification.h b/chrome/browser/notifications/notification.h index c2db1f2..dbf3898 100644 --- a/chrome/browser/notifications/notification.h +++ b/chrome/browser/notifications/notification.h @@ -57,13 +57,6 @@ class Notification : public message_center::Notification { // A unique identifier used to update (replace) or remove a notification. const base::string16& replace_id() const { return replace_id_; } - // A url for the button icons to be shown (optional). - const GURL& button_one_icon_url() const { return button_one_icon_url_; } - const GURL& button_two_icon_url() const { return button_two_icon_url_; } - - // A url for the image to be shown (optional). - const GURL& image_url() const { return image_url_; } - // Id of the delegate embedded inside this instance. std::string delegate_id() const { return delegate()->id(); } @@ -73,13 +66,6 @@ class Notification : public message_center::Notification { // The Origin of the page/worker which created this notification. GURL origin_url_; - // The URLs of the button images for a rich notification. - GURL button_one_icon_url_; - GURL button_two_icon_url_; - - // The URL of a large image to be displayed for a a rich notification. - GURL image_url_; - // The user-supplied replace ID for the notification. base::string16 replace_id_; diff --git a/chrome/browser/notifications/notification_delegate.cc b/chrome/browser/notifications/notification_delegate.cc deleted file mode 100644 index 0c3b446..0000000 --- a/chrome/browser/notifications/notification_delegate.cc +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/notifications/notification_delegate.h" - -void NotificationDelegate::ReleaseRenderViewHost() {} diff --git a/chrome/browser/notifications/notification_delegate.h b/chrome/browser/notifications/notification_delegate.h index a8efacd..afd3911 100644 --- a/chrome/browser/notifications/notification_delegate.h +++ b/chrome/browser/notifications/notification_delegate.h @@ -22,12 +22,6 @@ class NotificationDelegate : public message_center::NotificationDelegate { // Returns unique id of the notification. virtual std::string id() const = 0; - // Returns the WebContents that generated the notification, or NULL. - virtual content::WebContents* GetWebContents() const = 0; - - // Lets the delegate know that no more rendering will be necessary. - virtual void ReleaseRenderViewHost(); - protected: virtual ~NotificationDelegate() {} }; diff --git a/chrome/browser/notifications/notification_object_proxy.cc b/chrome/browser/notifications/notification_object_proxy.cc index a21b4c0..0c54952 100644 --- a/chrome/browser/notifications/notification_object_proxy.cc +++ b/chrome/browser/notifications/notification_object_proxy.cc @@ -12,11 +12,8 @@ #include "content/public/browser/web_contents.h" NotificationObjectProxy::NotificationObjectProxy( - content::RenderFrameHost* render_frame_host, scoped_ptr<content::DesktopNotificationDelegate> delegate) - : render_process_id_(render_frame_host->GetProcess()->GetID()), - render_frame_id_(render_frame_host->GetRoutingID()), - delegate_(delegate.Pass()), + : delegate_(delegate.Pass()), displayed_(false), id_(base::GenerateGUID()) { } @@ -48,8 +45,3 @@ void NotificationObjectProxy::Click() { std::string NotificationObjectProxy::id() const { return id_; } - -content::WebContents* NotificationObjectProxy::GetWebContents() const { - return content::WebContents::FromRenderFrameHost( - content::RenderFrameHost::FromID(render_process_id_, render_frame_id_)); -} diff --git a/chrome/browser/notifications/notification_object_proxy.h b/chrome/browser/notifications/notification_object_proxy.h index f35c756..937c535 100644 --- a/chrome/browser/notifications/notification_object_proxy.h +++ b/chrome/browser/notifications/notification_object_proxy.h @@ -25,7 +25,6 @@ class NotificationObjectProxy // Creates a Proxy object with the necessary callback information. The Proxy // will take ownership of |delegate|. NotificationObjectProxy( - content::RenderFrameHost* render_frame_host, scoped_ptr<content::DesktopNotificationDelegate> delegate); // NotificationDelegate implementation. @@ -34,7 +33,6 @@ class NotificationObjectProxy virtual void Close(bool by_user) override; virtual void Click() override; virtual std::string id() const override; - virtual content::WebContents* GetWebContents() const override; protected: friend class base::RefCountedThreadSafe<NotificationObjectProxy>; @@ -42,9 +40,6 @@ class NotificationObjectProxy virtual ~NotificationObjectProxy(); private: - // Callback information to find the JS Notification object where it lives. - int render_process_id_; - int render_frame_id_; scoped_ptr<content::DesktopNotificationDelegate> delegate_; bool displayed_; std::string id_; diff --git a/chrome/browser/notifications/notification_test_util.cc b/chrome/browser/notifications/notification_test_util.cc index 71a0d06..fa8bdd4 100644 --- a/chrome/browser/notifications/notification_test_util.cc +++ b/chrome/browser/notifications/notification_test_util.cc @@ -11,10 +11,6 @@ MockNotificationDelegate::~MockNotificationDelegate() {} std::string MockNotificationDelegate::id() const { return id_; } -content::WebContents* MockNotificationDelegate::GetWebContents() const { - return NULL; -} - // TODO(peter): |notification_| should be initialized with the correct origin. StubNotificationUIManager::StubNotificationUIManager(const GURL& welcome_origin) : notification_(GURL(), diff --git a/chrome/browser/notifications/notification_test_util.h b/chrome/browser/notifications/notification_test_util.h index ff3b2f6..c01634a 100644 --- a/chrome/browser/notifications/notification_test_util.h +++ b/chrome/browser/notifications/notification_test_util.h @@ -27,7 +27,6 @@ class MockNotificationDelegate : public NotificationDelegate { virtual void Close(bool by_user) override {} virtual void Click() override {} virtual std::string id() const override; - virtual content::WebContents* GetWebContents() const override; private: virtual ~MockNotificationDelegate(); @@ -70,9 +69,6 @@ class LoggingNotificationDelegate : public NotificationDelegate { virtual std::string id() const override { return notification_id_; } - virtual content::WebContents* GetWebContents() const override { - return NULL; - } private: std::string notification_id_; diff --git a/chrome/browser/signin/signin_error_notifier_ash.cc b/chrome/browser/signin/signin_error_notifier_ash.cc index 155b824..cd61bb0 100644 --- a/chrome/browser/signin/signin_error_notifier_ash.cc +++ b/chrome/browser/signin/signin_error_notifier_ash.cc @@ -57,7 +57,6 @@ class SigninNotificationDelegate : public NotificationDelegate { virtual void Click() override; virtual void ButtonClick(int button_index) override; virtual std::string id() const override; - virtual content::WebContents* GetWebContents() const override; protected: virtual ~SigninNotificationDelegate(); @@ -108,10 +107,6 @@ std::string SigninNotificationDelegate::id() const { return id_; } -content::WebContents* SigninNotificationDelegate::GetWebContents() const { - return NULL; -} - void SigninNotificationDelegate::FixSignIn() { #if defined(OS_CHROMEOS) chrome::AttemptUserExit(); diff --git a/chrome/browser/status_icons/desktop_notification_balloon.cc b/chrome/browser/status_icons/desktop_notification_balloon.cc index 76e5f56..528df58 100644 --- a/chrome/browser/status_icons/desktop_notification_balloon.cc +++ b/chrome/browser/status_icons/desktop_notification_balloon.cc @@ -49,9 +49,6 @@ class DummyNotificationDelegate : public NotificationDelegate { virtual void Close(bool by_user) override {} virtual void Click() override {} virtual std::string id() const override { return id_; } - virtual content::WebContents* GetWebContents() const override { - return NULL; - } private: virtual ~DummyNotificationDelegate() {} diff --git a/chrome/browser/sync/sync_error_notifier_ash.cc b/chrome/browser/sync/sync_error_notifier_ash.cc index e52b511..2c01485 100644 --- a/chrome/browser/sync/sync_error_notifier_ash.cc +++ b/chrome/browser/sync/sync_error_notifier_ash.cc @@ -52,7 +52,6 @@ class SyncNotificationDelegate : public NotificationDelegate { virtual void Click() override; virtual void ButtonClick(int button_index) override; virtual std::string id() const override; - virtual content::WebContents* GetWebContents() const override; protected: virtual ~SyncNotificationDelegate(); @@ -103,10 +102,6 @@ std::string SyncNotificationDelegate::id() const { return id_; } -content::WebContents* SyncNotificationDelegate::GetWebContents() const { - return NULL; -} - void SyncNotificationDelegate::ShowSyncSetup() { LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_); if (login_ui->current_login_ui()) { diff --git a/chrome/browser/ui/ash/screenshot_taker.cc b/chrome/browser/ui/ash/screenshot_taker.cc index 0a85d7c..f0e91c6 100644 --- a/chrome/browser/ui/ash/screenshot_taker.cc +++ b/chrome/browser/ui/ash/screenshot_taker.cc @@ -162,9 +162,6 @@ class ScreenshotTakerNotificationDelegate : public NotificationDelegate { virtual std::string id() const override { return std::string(kNotificationId); } - virtual content::WebContents* GetWebContents() const override { - return NULL; - } private: virtual ~ScreenshotTakerNotificationDelegate() {} diff --git a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc index d2d1ac2..21875af 100644 --- a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc +++ b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc @@ -95,10 +95,6 @@ void QuitWithAppsController::ButtonClick(int button_index) { } } -content::WebContents* QuitWithAppsController::GetWebContents() const { - return NULL; -} - std::string QuitWithAppsController::id() const { return kQuitWithAppsNotificationID; } diff --git a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h index c056cf1..6a342dd 100644 --- a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h +++ b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h @@ -26,7 +26,6 @@ class QuitWithAppsController : public NotificationDelegate { virtual void Close(bool by_user) override; virtual void Click() override; virtual void ButtonClick(int button_index) override; - virtual content::WebContents* GetWebContents() const override; virtual std::string id() const override; // Attempt to quit Chrome. This will display a notification and return false diff --git a/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc b/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc index e2d1c6d..73b7f0e 100644 --- a/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc +++ b/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc @@ -52,9 +52,6 @@ class WebNotificationTrayTest : public InProcessBrowserTest { virtual void Close(bool by_user) override {} virtual void Click() override {} virtual std::string id() const override { return id_; } - virtual content::WebContents* GetWebContents() const override { - return NULL; - } private: virtual ~TestNotificationDelegate() {} diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 8f6cd62..e97c9422 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1769,7 +1769,6 @@ 'browser/notifications/fullscreen_notification_blocker.h', 'browser/notifications/login_state_notification_blocker_chromeos.cc', 'browser/notifications/login_state_notification_blocker_chromeos.h', - 'browser/notifications/notification_delegate.cc', 'browser/notifications/notification_delegate.h', 'browser/notifications/notification_object_proxy.cc', 'browser/notifications/notification_object_proxy.h', diff --git a/ui/message_center/notifier_settings.h b/ui/message_center/notifier_settings.h index 3e4af89..68ec9fd 100644 --- a/ui/message_center/notifier_settings.h +++ b/ui/message_center/notifier_settings.h @@ -13,7 +13,9 @@ #include "ui/message_center/message_center_export.h" #include "url/gurl.h" +class MessageCenterNotificationsTest; class MessageCenterTrayBridgeTest; +class StubNotificationUIManager; namespace ash { class WebNotificationTrayTest; @@ -24,6 +26,7 @@ namespace test { class MessagePopupCollectionTest; } +class MessageCenterNotificationManagerTest; class NotifierSettingsDelegate; class NotifierSettingsProvider; @@ -65,13 +68,16 @@ struct MESSAGE_CENTER_EXPORT NotifierId { std::string profile_id; private: - friend class ::MessageCenterTrayBridgeTest; + friend class MessageCenterNotificationManagerTest; friend class MessageCenterTrayTest; - friend class test::MessagePopupCollectionTest; friend class NotificationControllerTest; friend class PopupCollectionTest; friend class TrayViewControllerTest; + friend class ::MessageCenterNotificationsTest; + friend class ::MessageCenterTrayBridgeTest; + friend class ::StubNotificationUIManager; friend class ash::WebNotificationTrayTest; + friend class test::MessagePopupCollectionTest; FRIEND_TEST_ALL_PREFIXES(PopupControllerTest, Creation); FRIEND_TEST_ALL_PREFIXES(NotificationListTest, UnreadCountNoNegative); FRIEND_TEST_ALL_PREFIXES(NotificationListTest, TestHasNotificationOfType); |