| 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/chromeos/login/network_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chromeos/cros/cros_library.h" | 13 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 14 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 14 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 15 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 15 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 16 #include "chrome/browser/chromeos/login/language_switch_menu.h" | 16 #include "chrome/browser/chromeos/login/language_switch_menu.h" |
| 17 #include "chrome/browser/chromeos/status/input_method_menu.h" | |
| 18 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 17 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 19 #include "chrome/browser/ui/webui/options2/chromeos/cros_language_options_handle
r2.h" | 18 #include "chrome/browser/ui/webui/options2/chromeos/cros_language_options_handle
r2.h" |
| 20 #include "content/public/browser/web_ui.h" | 19 #include "content/public/browser/web_ui.h" |
| 21 #include "grit/chromium_strings.h" | 20 #include "grit/chromium_strings.h" |
| 22 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 23 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 24 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
| 25 #include "ui/views/layout/fill_layout.h" | 24 #include "ui/views/layout/fill_layout.h" |
| 26 #include "ui/views/widget/widget.h" | 25 #include "ui/views/widget/widget.h" |
| 27 | 26 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 language_info->SetString("title", display_name); | 208 language_info->SetString("title", display_name); |
| 210 language_info->SetBoolean("selected", value == app_locale); | 209 language_info->SetBoolean("selected", value == app_locale); |
| 211 } | 210 } |
| 212 return languages_list; | 211 return languages_list; |
| 213 } | 212 } |
| 214 | 213 |
| 215 ListValue* NetworkScreenHandler::GetInputMethods() { | 214 ListValue* NetworkScreenHandler::GetInputMethods() { |
| 216 ListValue* input_methods_list = new ListValue; | 215 ListValue* input_methods_list = new ListValue; |
| 217 input_method::InputMethodManager* manager = | 216 input_method::InputMethodManager* manager = |
| 218 input_method::InputMethodManager::GetInstance(); | 217 input_method::InputMethodManager::GetInstance(); |
| 218 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); |
| 219 scoped_ptr<input_method::InputMethodDescriptors> input_methods( | 219 scoped_ptr<input_method::InputMethodDescriptors> input_methods( |
| 220 manager->GetActiveInputMethods()); | 220 manager->GetActiveInputMethods()); |
| 221 std::string current_input_method_id = manager->GetCurrentInputMethod().id(); | 221 std::string current_input_method_id = manager->GetCurrentInputMethod().id(); |
| 222 for (size_t i = 0; i < input_methods->size(); ++i) { | 222 for (size_t i = 0; i < input_methods->size(); ++i) { |
| 223 const std::string ime_id = input_methods->at(i).id(); |
| 223 DictionaryValue* input_method = new DictionaryValue; | 224 DictionaryValue* input_method = new DictionaryValue; |
| 224 input_method->SetString("value", input_methods->at(i).id()); | 225 input_method->SetString("value", ime_id); |
| 225 input_method->SetString( | 226 input_method->SetString( |
| 226 "title", InputMethodMenu::GetTextForMenu(input_methods->at(i))); | 227 "title", |
| 228 util->GetInputMethodLongName(input_methods->at(i))); |
| 227 input_method->SetBoolean("selected", | 229 input_method->SetBoolean("selected", |
| 228 input_methods->at(i).id() == current_input_method_id); | 230 ime_id == current_input_method_id); |
| 229 input_methods_list->Append(input_method); | 231 input_methods_list->Append(input_method); |
| 230 } | 232 } |
| 231 return input_methods_list; | 233 return input_methods_list; |
| 232 } | 234 } |
| 233 | 235 |
| 234 } // namespace chromeos | 236 } // namespace chromeos |
| OLD | NEW |