diff options
author | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-05 22:15:35 +0000 |
---|---|---|
committer | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-05 22:15:35 +0000 |
commit | 84685520948dcbf750736faa3e2bcc9dc430e861 (patch) | |
tree | 4bfc4086238f2f94355a689c142c5543b9664a09 /ash/system/web_notification | |
parent | f84973412773063d475d1b9f91540e6f6fa6e4da (diff) | |
download | chromium_src-84685520948dcbf750736faa3e2bcc9dc430e861.zip chromium_src-84685520948dcbf750736faa3e2bcc9dc430e861.tar.gz chromium_src-84685520948dcbf750736faa3e2bcc9dc430e861.tar.bz2 |
Add synchronous Widget closing event
Adds a WidgetObserver event that is guaranteed to be invoked synchronously
when a Widget is requested to close. Rename the existing event, which
is invoked at Widget destruction time, typically via a task on the event
loop, to OnWidgetDestroying.
The new event will be used in Views-specific WebContentsModalDialogManager
functionality to get close events for Widgets, so that we don't risk
adverse interleaving of Widget close events with other relevant events
(e.g. IPC). This will allow us to avoids test flakiness observed
in https://codereview.chromium.org/12045037 due to event races in
PrintPreviewTest.PrintCommands
BUG=157161
Review URL: https://chromiumcodereview.appspot.com/12089061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180796 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/web_notification')
-rw-r--r-- | ash/system/web_notification/web_notification_tray.cc | 2 | ||||
-rw-r--r-- | ash/system/web_notification/web_notification_tray.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc index f5672d8..4cb6f3b 100644 --- a/ash/system/web_notification/web_notification_tray.cc +++ b/ash/system/web_notification/web_notification_tray.cc @@ -343,7 +343,7 @@ void WebNotificationTray::ButtonPressed(views::Button* sender, PerformAction(event); } -void WebNotificationTray::OnWidgetClosing(views::Widget* widget) { +void WebNotificationTray::OnWidgetDestroying(views::Widget* widget) { if (quiet_mode_bubble() && quiet_mode_bubble()->GetBubbleWidget() == widget) { widget->RemoveObserver(this); } diff --git a/ash/system/web_notification/web_notification_tray.h b/ash/system/web_notification/web_notification_tray.h index 585f457..1466c29 100644 --- a/ash/system/web_notification/web_notification_tray.h +++ b/ash/system/web_notification/web_notification_tray.h @@ -89,7 +89,7 @@ class ASH_EXPORT WebNotificationTray const ui::Event& event) OVERRIDE; // Overridden from WidgetObserver. - virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; + virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; // Overridden from MessageCenterTrayDelegate. virtual void OnMessageCenterTrayChanged() OVERRIDE; |