From 24c5013fa5b10020a929af1e44eb7bde3c63b309 Mon Sep 17 00:00:00 2001 From: "johnnyg@chromium.org" Date: Fri, 19 Nov 2010 22:21:08 +0000 Subject: When an extension is uninstalled, close all desktop notifications from that extension. This change also refactors the balloon collection code to remove duplication between chrome and chromeos. Removes some gross removal code which was using fake notifications just to get the right ID. BUG=58266 TEST=open notifications from extension, uninstall extensions Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=65879 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=66571 Review URL: http://codereview.chromium.org/4635007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66829 0039d316-1c4b-4281-b951-d872f2087c98 --- .../desktop_notifications_unittest.cc | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'chrome/browser/notifications/desktop_notifications_unittest.cc') diff --git a/chrome/browser/notifications/desktop_notifications_unittest.cc b/chrome/browser/notifications/desktop_notifications_unittest.cc index 99466901..ebb6ab8 100644 --- a/chrome/browser/notifications/desktop_notifications_unittest.cc +++ b/chrome/browser/notifications/desktop_notifications_unittest.cc @@ -16,26 +16,18 @@ std::string DesktopNotificationsTest::log_output_; void MockBalloonCollection::Add(const Notification& notification, Profile* profile) { - // Swap in the logging proxy for the purpose of logging calls that + // Swap in a logging proxy for the purpose of logging calls that // would be made into javascript, then pass this down to the // balloon collection. - Notification test_notification(notification.origin_url(), - notification.content_url(), - notification.display_source(), - string16(), /* replace_id */ - log_proxy_.get()); + Notification test_notification( + notification.origin_url(), + notification.content_url(), + notification.display_source(), + notification.replace_id(), + new LoggingNotificationProxy(notification.notification_id())); BalloonCollectionImpl::Add(test_notification, profile); } -bool MockBalloonCollection::Remove(const Notification& notification) { - Notification test_notification(notification.origin_url(), - notification.content_url(), - notification.display_source(), - string16(), /* replace_id */ - log_proxy_.get()); - return BalloonCollectionImpl::Remove(test_notification); -} - Balloon* MockBalloonCollection::MakeBalloon(const Notification& notification, Profile* profile) { // Start with a normal balloon but mock out the view. -- cgit v1.1