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

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: fix typo 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const input_method::ModifierKey value = 76 const input_method::ModifierKey value =
77 kModifierKeysSelectItems[j].value; 77 kModifierKeysSelectItems[j].value;
78 const int message_id = kModifierKeysSelectItems[j].message_id; 78 const int message_id = kModifierKeysSelectItems[j].message_id;
79 // Only the seach key can be remapped to the caps lock key. 79 // Only the seach key can be remapped to the caps lock key.
80 if (kDataValuesNames[i] != std::string("remapSearchKeyToValue") && 80 if (kDataValuesNames[i] != std::string("remapSearchKeyToValue") &&
81 kDataValuesNames[i] != std::string("remapCapsLockKeyToValue") && 81 kDataValuesNames[i] != std::string("remapCapsLockKeyToValue") &&
82 value == input_method::kCapsLockKey) { 82 value == input_method::kCapsLockKey) {
83 continue; 83 continue;
84 } 84 }
85 ListValue* option = new ListValue(); 85 ListValue* option = new ListValue();
86 option->Append(Value::CreateIntegerValue(value)); 86 option->Append(new base::FundamentalValue(value));
87 option->Append(Value::CreateStringValue(l10n_util::GetStringUTF16( 87 option->Append(new base::StringValue(l10n_util::GetStringUTF16(
88 message_id))); 88 message_id)));
89 list_value->Append(option); 89 list_value->Append(option);
90 } 90 }
91 localized_strings->Set(kDataValuesNames[i], list_value); 91 localized_strings->Set(kDataValuesNames[i], list_value);
92 } 92 }
93 } 93 }
94 94
95 void KeyboardHandler::InitializePage() { 95 void KeyboardHandler::InitializePage() {
96 bool chromeos_keyboard = CommandLine::ForCurrentProcess()->HasSwitch( 96 bool chromeos_keyboard = CommandLine::ForCurrentProcess()->HasSwitch(
97 switches::kHasChromeOSKeyboard); 97 switches::kHasChromeOSKeyboard);
98 bool chromebook_function_key = CommandLine::ForCurrentProcess()->HasSwitch( 98 bool chromebook_function_key = CommandLine::ForCurrentProcess()->HasSwitch(
99 switches::kEnableChromebookFunctionKey); 99 switches::kEnableChromebookFunctionKey);
100 100
101 const base::FundamentalValue show_options(true); 101 const base::FundamentalValue show_options(true);
102 102
103 if (!chromeos_keyboard) { 103 if (!chromeos_keyboard) {
104 web_ui()->CallJavascriptFunction( 104 web_ui()->CallJavascriptFunction(
105 "options.KeyboardOverlay.showCapsLockOptions", show_options); 105 "options.KeyboardOverlay.showCapsLockOptions", show_options);
106 } 106 }
107 107
108 if (chromeos_keyboard && chromebook_function_key) { 108 if (chromeos_keyboard && chromebook_function_key) {
109 web_ui()->CallJavascriptFunction( 109 web_ui()->CallJavascriptFunction(
110 "options.KeyboardOverlay.showFunctionKeyOptions", show_options); 110 "options.KeyboardOverlay.showFunctionKeyOptions", show_options);
111 } 111 }
112 } 112 }
113 113
114 } // namespace options 114 } // namespace options
115 } // namespace chromeos 115 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698