summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/notifications/desktop_notifications_unittest.cc
diff options
context:
space:
mode:
authorjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 00:24:12 +0000
committerjohnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 00:24:12 +0000
commit521b6efb91ea0c7cf11f4fc49c92fc32d8850595 (patch)
treeaf1c68798d74de08ec141b05ad65b1732dfae320 /chrome/browser/chromeos/notifications/desktop_notifications_unittest.cc
parent16b59d5636b47694e846961165c5cd66e1f16976 (diff)
downloadchromium_src-521b6efb91ea0c7cf11f4fc49c92fc32d8850595.zip
chromium_src-521b6efb91ea0c7cf11f4fc49c92fc32d8850595.tar.gz
chromium_src-521b6efb91ea0c7cf11f4fc49c92fc32d8850595.tar.bz2
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 Review URL: http://codereview.chromium.org/4635007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65879 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/notifications/desktop_notifications_unittest.cc')
-rw-r--r--chrome/browser/chromeos/notifications/desktop_notifications_unittest.cc25
1 files changed, 8 insertions, 17 deletions
diff --git a/chrome/browser/chromeos/notifications/desktop_notifications_unittest.cc b/chrome/browser/chromeos/notifications/desktop_notifications_unittest.cc
index 8c0a4be..377828b 100644
--- a/chrome/browser/chromeos/notifications/desktop_notifications_unittest.cc
+++ b/chrome/browser/chromeos/notifications/desktop_notifications_unittest.cc
@@ -24,33 +24,24 @@ class MockNotificationUI : public BalloonCollectionImpl::NotificationUI {
virtual void SetActiveView(BalloonViewImpl* view) {}
};
-MockBalloonCollection::MockBalloonCollection()
- : log_proxy_(new LoggingNotificationProxy()) {
+MockBalloonCollection::MockBalloonCollection() {
set_notification_ui(new MockNotificationUI());
}
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.