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

Unified Diff: chrome/browser/views/notifications/balloon_view.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/views/notifications/balloon_view.h ('k') | chrome/renderer/notification_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/notifications/balloon_view.cc
===================================================================
--- chrome/browser/views/notifications/balloon_view.cc (revision 30967)
+++ chrome/browser/views/notifications/balloon_view.cc (working copy)
@@ -71,7 +71,7 @@
// The only button currently is the close button.
virtual void ButtonPressed(views::Button* sender, const views::Event&) {
- view_->Close();
+ view_->Close(true);
}
private:
@@ -110,16 +110,17 @@
BalloonViewImpl::~BalloonViewImpl() {
}
-void BalloonViewImpl::Close() {
+void BalloonViewImpl::Close(bool by_user) {
MessageLoop::current()->PostTask(FROM_HERE,
- method_factory_.NewRunnableMethod(&BalloonViewImpl::DelayedClose));
+ method_factory_.NewRunnableMethod(
+ &BalloonViewImpl::DelayedClose, by_user));
}
-void BalloonViewImpl::DelayedClose() {
+void BalloonViewImpl::DelayedClose(bool by_user) {
html_contents_->Shutdown();
html_container_->CloseNow();
frame_container_->CloseNow();
- balloon_->Close(true);
+ balloon_->OnClose(by_user);
}
void BalloonViewImpl::DidChangeBounds(const gfx::Rect& previous,
@@ -339,8 +340,8 @@
}
void BalloonViewImpl::Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details) {
+ const NotificationSource& source,
+ const NotificationDetails& details) {
if (type != NotificationType::NOTIFY_BALLOON_DISCONNECTED) {
NOTREACHED();
return;
@@ -350,5 +351,5 @@
// (e.g., because of a crash), we want to close the balloon.
notification_registrar_.Remove(this,
NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_));
- Close();
+ Close(false);
}
« no previous file with comments | « chrome/browser/views/notifications/balloon_view.h ('k') | chrome/renderer/notification_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698