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

Unified Diff: chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc

Issue 11421055: Add power-user keyboard mode for ChromeOS with Search key acting as a typical Fn key. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't avoid remapping Alt-Up etc when a PrefService isn't around Created 8 years, 1 month 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
Index: chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc b/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc
index 8d59859175ced16aec3d71f0e333fd30a655e05a..d639a6c2eb2ce06867fc5b8dd1c2c772d93ff872 100644
--- a/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc
@@ -63,6 +63,9 @@ void KeyboardHandler::GetLocalizedValues(DictionaryValue* localized_strings) {
localized_strings->SetString("remapCapsLockKeyToContent",
l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_CAPS_LOCK_LABEL));
+ localized_strings->SetString("searchKeyActsAsFunctionKey",
+ l10n_util::GetStringUTF16(
+ IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_SEARCH_AS_FUNCTION));
for (size_t i = 0; i < arraysize(kDataValuesNames); ++i) {
ListValue* list_value = new ListValue();
@@ -87,12 +90,22 @@ void KeyboardHandler::GetLocalizedValues(DictionaryValue* localized_strings) {
}
void KeyboardHandler::InitializePage() {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kHasChromeOSKeyboard))
- return;
+ bool chromeos_keyboard = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kHasChromeOSKeyboard);
+ bool chromeos_function_key = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableChromeOSFunctionKey);
+
const base::FundamentalValue show_options(true);
- web_ui()->CallJavascriptFunction(
- "options.KeyboardOverlay.showCapsLockOptions", show_options);
+
+ if (!chromeos_keyboard) {
+ web_ui()->CallJavascriptFunction(
+ "options.KeyboardOverlay.showCapsLockOptions", show_options);
+ }
+
+ if (chromeos_function_key) {
+ web_ui()->CallJavascriptFunction(
+ "options.KeyboardOverlay.showFunctionKeyOptions", show_options);
+ }
}
} // namespace options

Powered by Google App Engine
This is Rietveld 408576698