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

Unified Diff: chrome/browser/extensions/api/input/input.cc

Issue 411463007: Noop gear button in VK menu popup if not logged in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 5 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/extensions/api/input/input.cc
diff --git a/chrome/browser/extensions/api/input/input.cc b/chrome/browser/extensions/api/input/input.cc
index 2e2772b08f5308aa932953d2cf6c091efa5c498e..a3939ad791c08d2eafd7b4bc7fb4f16f08c2cfdf 100644
--- a/chrome/browser/extensions/api/input/input.cc
+++ b/chrome/browser/extensions/api/input/input.cc
@@ -18,6 +18,12 @@
#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_switches.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/login/lock/screen_locker.h"
+#include "chrome/browser/chromeos/login/ui/user_adding_screen.h"
+#include "chrome/browser/chromeos/login/users/user_manager.h"
+#endif // OS_CHROMEOS
+
#if defined(USE_ASH)
#include "ash/root_window_controller.h"
#include "ash/shell.h"
@@ -168,6 +174,16 @@ bool VirtualKeyboardPrivateGetKeyboardConfigFunction::RunSync() {
bool VirtualKeyboardPrivateOpenSettingsFunction::RunSync() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
#if defined(USE_ASH)
+#if defined(OS_CHROMEOS)
+ // Do not try to open language options page if user is not logged in or
+ // locked.
+ if (!chromeos::UserManager::Get()->IsUserLoggedIn() ||
+ chromeos::UserAddingScreen::Get()->IsRunning() ||
+ (chromeos::ScreenLocker::default_screen_locker() &&
+ chromeos::ScreenLocker::default_screen_locker()->locked()))
+ return true;
+#endif // OS_CHROMEOS
+
content::RecordAction(base::UserMetricsAction("OpenLanguageOptionsDialog"));
chrome::ShowSettingsSubPageForProfile(
ProfileManager::GetActiveUserProfile(), chrome::kLanguageOptionsSubPage);
« 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