OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/gtk/notifications/balloon_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/notifications/balloon_view_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 return FALSE; | 424 return FALSE; |
425 } | 425 } |
426 | 426 |
427 void BalloonViewImpl::OnOptionsMenuButton(GtkWidget* widget) { | 427 void BalloonViewImpl::OnOptionsMenuButton(GtkWidget* widget) { |
428 menu_showing_ = true; | 428 menu_showing_ = true; |
429 options_menu_->PopupAsContext(gtk_get_current_event_time()); | 429 options_menu_->PopupAsContext(gtk_get_current_event_time()); |
430 } | 430 } |
431 | 431 |
432 // Called when the menu stops showing. | 432 // Called when the menu stops showing. |
433 void BalloonViewImpl::StoppedShowing() { | 433 void BalloonViewImpl::StoppedShowing() { |
434 if (pending_close_) | |
435 DelayedClose(false); | |
436 menu_showing_ = false; | 434 menu_showing_ = false; |
| 435 if (pending_close_) { |
| 436 MessageLoop::current()->PostTask( |
| 437 FROM_HERE, |
| 438 method_factory_.NewRunnableMethod( |
| 439 &BalloonViewImpl::DelayedClose, false)); |
| 440 } |
437 } | 441 } |
438 | 442 |
439 gboolean BalloonViewImpl::OnDestroy(GtkWidget* widget) { | 443 gboolean BalloonViewImpl::OnDestroy(GtkWidget* widget) { |
440 frame_container_ = NULL; | 444 frame_container_ = NULL; |
441 Close(false); | 445 Close(false); |
442 return FALSE; // Propagate. | 446 return FALSE; // Propagate. |
443 } | 447 } |
OLD | NEW |