Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2180)

Unified Diff: chrome/browser/notifications/balloon.cc

Issue 363003: Implement cancel() API on a Notification object so that script can cancel or ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/notifications/balloon.h ('k') | chrome/browser/notifications/balloon_collection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/balloon.cc
===================================================================
--- chrome/browser/notifications/balloon.cc (revision 30967)
+++ chrome/browser/notifications/balloon.cc (working copy)
@@ -36,8 +36,15 @@
}
}
-void Balloon::Close(bool by_user) {
+void Balloon::OnClose(bool by_user) {
notification_.Close(by_user);
if (close_listener_)
close_listener_->OnBalloonClosed(this);
}
+
+void Balloon::CloseByScript() {
+ // A user-initiated close begins with the view and then closes this object;
+ // we simulate that with a script-initiated close but pass |by_user|=false.
+ DCHECK(balloon_view_.get());
+ balloon_view_->Close(false);
+}
« no previous file with comments | « chrome/browser/notifications/balloon.h ('k') | chrome/browser/notifications/balloon_collection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698