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

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

Issue 11415226: webui/options: Do not use Value::CreateStringValue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/chromeos/input_method/xkeyboard.h" 9 #include "chrome/browser/chromeos/input_method/xkeyboard.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 kModifierKeysSelectItems[j].value; 74 kModifierKeysSelectItems[j].value;
75 const int message_id = kModifierKeysSelectItems[j].message_id; 75 const int message_id = kModifierKeysSelectItems[j].message_id;
76 // Only the seach key can be remapped to the caps lock key. 76 // Only the seach key can be remapped to the caps lock key.
77 if (kDataValuesNames[i] != std::string("remapSearchKeyToValue") && 77 if (kDataValuesNames[i] != std::string("remapSearchKeyToValue") &&
78 kDataValuesNames[i] != std::string("remapCapsLockKeyToValue") && 78 kDataValuesNames[i] != std::string("remapCapsLockKeyToValue") &&
79 value == input_method::kCapsLockKey) { 79 value == input_method::kCapsLockKey) {
80 continue; 80 continue;
81 } 81 }
82 ListValue* option = new ListValue(); 82 ListValue* option = new ListValue();
83 option->Append(Value::CreateIntegerValue(value)); 83 option->Append(Value::CreateIntegerValue(value));
84 option->Append(Value::CreateStringValue(l10n_util::GetStringUTF16( 84 option->Append(new base::StringValue(l10n_util::GetStringUTF16(
85 message_id))); 85 message_id)));
86 list_value->Append(option); 86 list_value->Append(option);
87 } 87 }
88 localized_strings->Set(kDataValuesNames[i], list_value); 88 localized_strings->Set(kDataValuesNames[i], list_value);
89 } 89 }
90 } 90 }
91 91
92 void KeyboardHandler::InitializePage() { 92 void KeyboardHandler::InitializePage() {
93 bool chromeos_keyboard = CommandLine::ForCurrentProcess()->HasSwitch( 93 bool chromeos_keyboard = CommandLine::ForCurrentProcess()->HasSwitch(
94 switches::kHasChromeOSKeyboard); 94 switches::kHasChromeOSKeyboard);
95 bool chromebook_function_key = CommandLine::ForCurrentProcess()->HasSwitch( 95 bool chromebook_function_key = CommandLine::ForCurrentProcess()->HasSwitch(
96 switches::kEnableChromebookFunctionKey); 96 switches::kEnableChromebookFunctionKey);
97 97
98 const base::FundamentalValue show_options(true); 98 const base::FundamentalValue show_options(true);
99 99
100 if (!chromeos_keyboard) { 100 if (!chromeos_keyboard) {
101 web_ui()->CallJavascriptFunction( 101 web_ui()->CallJavascriptFunction(
102 "options.KeyboardOverlay.showCapsLockOptions", show_options); 102 "options.KeyboardOverlay.showCapsLockOptions", show_options);
103 } 103 }
104 104
105 if (chromeos_keyboard && chromebook_function_key) { 105 if (chromeos_keyboard && chromebook_function_key) {
106 web_ui()->CallJavascriptFunction( 106 web_ui()->CallJavascriptFunction(
107 "options.KeyboardOverlay.showFunctionKeyOptions", show_options); 107 "options.KeyboardOverlay.showFunctionKeyOptions", show_options);
108 } 108 }
109 } 109 }
110 110
111 } // namespace options 111 } // namespace options
112 } // namespace chromeos 112 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698