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

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

Issue 2625473002: Connect Login UI to SystemTray (Closed)
Patch Set: nits Created 3 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 | « ash/public/interfaces/system_tray.mojom ('k') | chrome/browser/ui/ash/system_tray_client.h » ('j') | 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 3cc07a5321bd0d417f86eee2aed56a3c4c6903ce..5afb639e8648e33bb94ba20563f81828d002d390 100644
--- a/chrome/browser/chromeos/login/ui/webui_login_view.cc
+++ b/chrome/browser/chromeos/login/ui/webui_login_view.cc
@@ -37,6 +37,7 @@
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/ui/ash/ash_util.h"
+#include "chrome/browser/ui/ash/system_tray_client.h"
#include "chrome/browser/ui/autofill/chrome_autofill_client.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chromeos/dbus/dbus_thread_manager.h"
@@ -449,40 +450,13 @@ void WebUILoginView::OnPostponedShow() {
}
void WebUILoginView::SetStatusAreaVisible(bool visible) {
- if (!chrome::IsRunningInMash() &&
- ash::Shell::GetInstance()->HasPrimaryStatusArea()) {
- ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
- tray->SetVisible(visible);
- tray->GetWidget()->SetOpacity(visible ? 1.0 : 0.0);
- if (visible) {
- tray->GetWidget()->Show();
- } else {
- tray->GetWidget()->Hide();
- }
- } else {
- NOTIMPLEMENTED();
- }
+ SystemTrayClient::Get()->SetPrimaryTrayVisible(visible);
}
void WebUILoginView::SetUIEnabled(bool enabled) {
forward_keyboard_event_ = enabled;
- if (chrome::IsRunningInMash()) {
- NOTIMPLEMENTED();
- return;
- }
- 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 interactive 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);
+ SystemTrayClient::Get()->SetPrimaryTrayEnabled(enabled);
}
// WebUILoginView protected: ---------------------------------------------------
« no previous file with comments | « ash/public/interfaces/system_tray.mojom ('k') | chrome/browser/ui/ash/system_tray_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698