| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/options/chromeos/keyboard_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/keyboard_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ash/common/new_window_delegate.h" | 9 #include "ash/common/new_window_delegate.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 localized_strings->SetString("showKeyboardShortcuts", | 125 localized_strings->SetString("showKeyboardShortcuts", |
| 126 l10n_util::GetStringUTF16( | 126 l10n_util::GetStringUTF16( |
| 127 IDS_OPTIONS_SETTINGS_SHOW_KEYBOARD_SHORTCUTS)); | 127 IDS_OPTIONS_SETTINGS_SHOW_KEYBOARD_SHORTCUTS)); |
| 128 | 128 |
| 129 for (size_t i = 0; i < arraysize(kDataValuesNames); ++i) { | 129 for (size_t i = 0; i < arraysize(kDataValuesNames); ++i) { |
| 130 base::ListValue* list_value = new base::ListValue(); | 130 base::ListValue* list_value = new base::ListValue(); |
| 131 for (size_t j = 0; j < arraysize(kModifierKeysSelectItems); ++j) { | 131 for (size_t j = 0; j < arraysize(kModifierKeysSelectItems); ++j) { |
| 132 const input_method::ModifierKey value = | 132 const input_method::ModifierKey value = |
| 133 kModifierKeysSelectItems[j].value; | 133 kModifierKeysSelectItems[j].value; |
| 134 const int message_id = kModifierKeysSelectItems[j].message_id; | 134 const int message_id = kModifierKeysSelectItems[j].message_id; |
| 135 // Only the seach/caps-lock key can be remapped to the | |
| 136 // caps-lock/backspace key. | |
| 137 if (kDataValuesNames[i] != std::string("remapSearchKeyToValue") && | |
| 138 kDataValuesNames[i] != std::string("remapCapsLockKeyToValue") && | |
| 139 (value == input_method::kCapsLockKey || | |
| 140 value == input_method::kBackspaceKey)) { | |
| 141 continue; | |
| 142 } | |
| 143 base::ListValue* option = new base::ListValue(); | 135 base::ListValue* option = new base::ListValue(); |
| 144 option->Append(new base::FundamentalValue(value)); | 136 option->Append(new base::FundamentalValue(value)); |
| 145 option->Append(new base::StringValue(l10n_util::GetStringUTF16( | 137 option->Append(new base::StringValue(l10n_util::GetStringUTF16( |
| 146 message_id))); | 138 message_id))); |
| 147 list_value->Append(option); | 139 list_value->Append(option); |
| 148 } | 140 } |
| 149 localized_strings->Set(kDataValuesNames[i], list_value); | 141 localized_strings->Set(kDataValuesNames[i], list_value); |
| 150 } | 142 } |
| 151 } | 143 } |
| 152 | 144 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 179 } | 171 } |
| 180 | 172 |
| 181 void KeyboardHandler::UpdateCapsLockOptions() const { | 173 void KeyboardHandler::UpdateCapsLockOptions() const { |
| 182 const base::FundamentalValue show_caps_lock_options(HasExternalKeyboard()); | 174 const base::FundamentalValue show_caps_lock_options(HasExternalKeyboard()); |
| 183 web_ui()->CallJavascriptFunctionUnsafe( | 175 web_ui()->CallJavascriptFunctionUnsafe( |
| 184 "options.KeyboardOverlay.showCapsLockOptions", show_caps_lock_options); | 176 "options.KeyboardOverlay.showCapsLockOptions", show_caps_lock_options); |
| 185 } | 177 } |
| 186 | 178 |
| 187 } // namespace options | 179 } // namespace options |
| 188 } // namespace chromeos | 180 } // namespace chromeos |
| OLD | NEW |