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

Unified Diff: chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc

Issue 6273010: [linux] When the user has the notification options menu, delay system-initiat... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 months 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/ui/gtk/notifications/balloon_view_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc (revision 72341)
+++ chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc (working copy)
@@ -102,16 +102,24 @@
html_container_(NULL),
method_factory_(this),
close_button_(NULL),
- animation_(NULL) {
+ animation_(NULL),
+ menu_showing_(false),
+ pending_close_(false) {
}
BalloonViewImpl::~BalloonViewImpl() {
}
void BalloonViewImpl::Close(bool by_user) {
- MessageLoop::current()->PostTask(FROM_HERE,
- method_factory_.NewRunnableMethod(
- &BalloonViewImpl::DelayedClose, by_user));
+ // Delay a system-initiated close if the menu is showing.
+ if (!by_user && menu_showing_) {
+ pending_close_ = true;
+ } else {
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ method_factory_.NewRunnableMethod(
+ &BalloonViewImpl::DelayedClose, by_user));
+ }
}
gfx::Size BalloonViewImpl::GetSize() const {
@@ -417,9 +425,17 @@
}
void BalloonViewImpl::OnOptionsMenuButton(GtkWidget* widget) {
+ menu_showing_ = true;
options_menu_->PopupAsContext(gtk_get_current_event_time());
}
+// Called when the menu stops showing.
+void BalloonViewImpl::StoppedShowing() {
+ if (pending_close_)
+ DelayedClose(false);
+ menu_showing_ = false;
+}
+
gboolean BalloonViewImpl::OnDestroy(GtkWidget* widget) {
frame_container_ = NULL;
Close(false);
« no previous file with comments | « chrome/browser/ui/gtk/notifications/balloon_view_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698