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" | 17 #include "chrome/browser/chromeos/status/input_method_menu.h" |
18 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 18 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
19 #include "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler
.h" | 19 #include "chrome/browser/ui/webui/options2/chromeos/cros_language_options_handle
r2.h" |
20 #include "content/public/browser/web_ui.h" | 20 #include "content/public/browser/web_ui.h" |
21 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" |
22 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
24 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
25 #include "ui/views/layout/fill_layout.h" | 25 #include "ui/views/layout/fill_layout.h" |
26 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 | 181 |
182 ListValue* NetworkScreenHandler::GetLanguageList() { | 182 ListValue* NetworkScreenHandler::GetLanguageList() { |
183 const std::string app_locale = g_browser_process->GetApplicationLocale(); | 183 const std::string app_locale = g_browser_process->GetApplicationLocale(); |
184 input_method::InputMethodManager* manager = | 184 input_method::InputMethodManager* manager = |
185 input_method::InputMethodManager::GetInstance(); | 185 input_method::InputMethodManager::GetInstance(); |
186 // GetSupportedInputMethods() never returns NULL. | 186 // GetSupportedInputMethods() never returns NULL. |
187 scoped_ptr<input_method::InputMethodDescriptors> descriptors( | 187 scoped_ptr<input_method::InputMethodDescriptors> descriptors( |
188 manager->GetSupportedInputMethods()); | 188 manager->GetSupportedInputMethods()); |
189 ListValue* languages_list = | 189 ListValue* languages_list = |
190 CrosLanguageOptionsHandler::GetLanguageList(*descriptors); | 190 options2::CrosLanguageOptionsHandler::GetLanguageList(*descriptors); |
191 for (size_t i = 0; i < languages_list->GetSize(); ++i) { | 191 for (size_t i = 0; i < languages_list->GetSize(); ++i) { |
192 DictionaryValue* language_info = NULL; | 192 DictionaryValue* language_info = NULL; |
193 if (!languages_list->GetDictionary(i, &language_info)) | 193 if (!languages_list->GetDictionary(i, &language_info)) |
194 NOTREACHED(); | 194 NOTREACHED(); |
195 | 195 |
196 std::string value; | 196 std::string value; |
197 language_info->GetString("code", &value); | 197 language_info->GetString("code", &value); |
198 std::string display_name; | 198 std::string display_name; |
199 language_info->GetString("displayName", &display_name); | 199 language_info->GetString("displayName", &display_name); |
200 std::string native_name; | 200 std::string native_name; |
(...skipping 24 matching lines...) Expand all Loading... |
225 input_method->SetString( | 225 input_method->SetString( |
226 "title", InputMethodMenu::GetTextForMenu(input_methods->at(i))); | 226 "title", InputMethodMenu::GetTextForMenu(input_methods->at(i))); |
227 input_method->SetBoolean("selected", | 227 input_method->SetBoolean("selected", |
228 input_methods->at(i).id() == current_input_method_id); | 228 input_methods->at(i).id() == current_input_method_id); |
229 input_methods_list->Append(input_method); | 229 input_methods_list->Append(input_method); |
230 } | 230 } |
231 return input_methods_list; | 231 return input_methods_list; |
232 } | 232 } |
233 | 233 |
234 } // namespace chromeos | 234 } // namespace chromeos |
OLD | NEW |