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

Unified Diff: chrome/browser/chromeos/login/ui/webui_login_view.cc

Issue 1194053003: Close tray bubble before disabling UI for sign-in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment. Created 5 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/ui/webui_login_view.cc
diff --git a/chrome/browser/chromeos/login/ui/webui_login_view.cc b/chrome/browser/chromeos/login/ui/webui_login_view.cc
index 65b2c75fcb42aa20f6fed4507b9b4d90cb94da78..34e9f185836634c2106b692caa57f5d9c9c655ea 100644
--- a/chrome/browser/chromeos/login/ui/webui_login_view.cc
+++ b/chrome/browser/chromeos/login/ui/webui_login_view.cc
@@ -348,7 +348,19 @@ void WebUILoginView::SetStatusAreaVisible(bool visible) {
void WebUILoginView::SetUIEnabled(bool enabled) {
forward_keyboard_event_ = enabled;
- ash::Shell::GetInstance()->GetPrimarySystemTray()->SetEnabled(enabled);
+ ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
+
+ // We disable the UI to prevent user from interracting with UI elements,
+ // particullary with the system tray menu. However, in case if the system tray
+ // bubble is opened at this point, it remains opened and interactictive even
+ // after SystemTray::SetEnabled(false) call, which can be dangerous
+ // (http://crbug.com/497080). Close the menu to fix it. Calling
+ // SystemTray::SetEnabled(false) guarantees, that the menu will not be opened
+ // until the UI is enabled again.
+ if (!enabled && tray->HasSystemBubble())
+ tray->CloseSystemBubble();
+
+ tray->SetEnabled(enabled);
}
void WebUILoginView::AddFrameObserver(FrameObserver* frame_observer) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698