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

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: 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..37ca6ea990aaa0ddbe4c2f1f260ea970a4288dc1 100644
--- a/chrome/browser/extensions/api/input/input.cc
+++ b/chrome/browser/extensions/api/input/input.cc
@@ -8,6 +8,8 @@
#include "base/lazy_instance.h"
#include "base/metrics/histogram.h"
#include "base/strings/string16.h"
+#include "chrome/browser/chromeos/login/lock/screen_locker.h"
+#include "chrome/browser/chromeos/login/users/user_manager.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/common/url_constants.h"
@@ -168,6 +170,13 @@ bool VirtualKeyboardPrivateGetKeyboardConfigFunction::RunSync() {
bool VirtualKeyboardPrivateOpenSettingsFunction::RunSync() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
#if defined(USE_ASH)
+ // Do not try to open language options page if user is not logged in or
+ // locked.
+ bool locked = chromeos::ScreenLocker::default_screen_locker() &&
+ chromeos::ScreenLocker::default_screen_locker()->locked();
+ if (!chromeos::UserManager::Get()->IsUserLoggedIn() || locked)
+ return true;
Shu Chen 2014/07/23 02:57:39 nits: avoid getting lock state when user is not lo
bshe 2014/07/23 02:59:49 Done.
+
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