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

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..65cc61a6744dd9c183c9e88aa48495a5ad303f23 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.
+ if (!chromeos::UserManager::Get()->IsUserLoggedIn() ||
Shu Chen 2014/07/23 14:23:19 I think you need to guard this code block in #ifde
bshe 2014/07/24 17:24:16 Done.
+ (chromeos::ScreenLocker::default_screen_locker() &&
+ chromeos::ScreenLocker::default_screen_locker()->locked()))
+ return true;
+
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