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

Unified Diff: ash/system/ime_menu/ime_menu_tray.cc

Issue 2821363002: cros: Disable system tray help/lock buttons during supervised user creation (Closed)
Patch Set: fix browser test Created 3 years, 8 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/system/ime/tray_ime_chromeos.cc ('k') | ash/system/tiles/tiles_default_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/ime_menu/ime_menu_tray.cc
diff --git a/ash/system/ime_menu/ime_menu_tray.cc b/ash/system/ime_menu/ime_menu_tray.cc
index daa09b1426c43a2f30730e1d9db0e70a0f75b0b7..7913d0fdba4bd42e59ff45cf7565532816316bb3 100644
--- a/ash/system/ime_menu/ime_menu_tray.cc
+++ b/ash/system/ime_menu/ime_menu_tray.cc
@@ -9,7 +9,7 @@
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/resources/grit/ash_resources.h"
#include "ash/root_window_controller.h"
-#include "ash/session/session_state_delegate.h"
+#include "ash/session/session_controller.h"
#include "ash/shelf/wm_shelf.h"
#include "ash/shelf/wm_shelf_util.h"
#include "ash/shell.h"
@@ -27,6 +27,7 @@
#include "ash/wm_window.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
+#include "components/session_manager/session_manager_types.h"
#include "ui/base/ime/chromeos/input_method_manager.h"
#include "ui/base/ime/ime_bridge.h"
#include "ui/base/ime/text_input_client.h"
@@ -85,9 +86,11 @@ void RecordButtonsClicked(const std::string& button_name) {
// Returns true if the current screen is login or lock screen.
bool IsInLoginOrLockScreen() {
- LoginStatus login =
- Shell::Get()->system_tray_delegate()->GetUserLoginStatus();
- return !TrayPopupUtils::CanOpenWebUISettings(login);
+ using session_manager::SessionState;
+ SessionState state = Shell::Get()->session_controller()->GetSessionState();
+ return state == SessionState::LOGIN_PRIMARY ||
+ state == SessionState::LOCKED ||
+ state == SessionState::LOGIN_SECONDARY;
}
// Returns true if the current input context type is password.
@@ -150,7 +153,7 @@ class ImeTitleView : public views::View, public views::ButtonListener {
if (show_settings_button) {
settings_button_ = CreateImeMenuButton(
this, kSystemMenuSettingsIcon, IDS_ASH_STATUS_TRAY_IME_SETTINGS, 0);
- if (IsInLoginOrLockScreen())
+ if (!TrayPopupUtils::CanOpenWebUISettings())
settings_button_->SetEnabled(false);
AddChildView(settings_button_);
}
@@ -243,6 +246,8 @@ class ImeButtonsView : public views::View, public views::ButtonListener {
settings_button_ = CreateImeMenuButton(this, kSystemMenuSettingsIcon,
IDS_ASH_STATUS_TRAY_IME_SETTINGS, 0);
AddChildView(settings_button_);
+ if (!TrayPopupUtils::CanOpenWebUISettings())
+ settings_button_->SetEnabled(false);
}
ImeMenuTray* ime_menu_tray_;
« no previous file with comments | « ash/system/ime/tray_ime_chromeos.cc ('k') | ash/system/tiles/tiles_default_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698