Chromium Code Reviews| 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/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/chromeos/base/locale_util.h" | 14 #include "chrome/browser/chromeos/base/locale_util.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/input_events_blocker.h" | 16 #include "chrome/browser/chromeos/login/input_events_blocker.h" |
| 17 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" | 17 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" |
| 18 #include "chrome/browser/chromeos/system/input_device_settings.h" | 18 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 19 #include "chrome/browser/chromeos/system/timezone_util.h" | 19 #include "chrome/browser/chromeos/system/timezone_util.h" |
| 20 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 20 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 21 #include "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler .h" | 21 #include "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler .h" |
| 22 #include "chromeos/ime/input_method_manager.h" | 22 #include "chromeos/ime/input_method_manager.h" |
| 23 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
| 24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | |
| 25 #include "ui/gfx/rect.h" | 26 #include "ui/gfx/rect.h" |
| 26 #include "ui/views/layout/fill_layout.h" | 27 #include "ui/views/layout/fill_layout.h" |
| 27 #include "ui/views/widget/widget.h" | 28 #include "ui/views/widget/widget.h" |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| 31 const char kJsScreenPath[] = "login.NetworkScreen"; | 32 const char kJsScreenPath[] = "login.NetworkScreen"; |
| 32 | 33 |
| 33 // JS API callbacks names. | 34 // JS API callbacks names. |
| 34 const char kJsApiNetworkOnExit[] = "networkOnExit"; | 35 const char kJsApiNetworkOnExit[] = "networkOnExit"; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 if (!languages_list->GetDictionary(i, &language_info)) | 247 if (!languages_list->GetDictionary(i, &language_info)) |
| 247 NOTREACHED(); | 248 NOTREACHED(); |
| 248 | 249 |
| 249 std::string value; | 250 std::string value; |
| 250 language_info->GetString("code", &value); | 251 language_info->GetString("code", &value); |
| 251 std::string display_name; | 252 std::string display_name; |
| 252 language_info->GetString("displayName", &display_name); | 253 language_info->GetString("displayName", &display_name); |
| 253 std::string native_name; | 254 std::string native_name; |
| 254 language_info->GetString("nativeDisplayName", &native_name); | 255 language_info->GetString("nativeDisplayName", &native_name); |
| 255 | 256 |
| 257 // If it's option group divider, add field name. | |
| 258 if (value.empty()) | |
|
Dmitry Polukhin
2014/01/28 19:40:30
Please add {} because it if(true) statement has tw
Alexander Alekseev
2014/01/29 15:39:00
Done.
| |
| 259 language_info->SetString("optionGroupName", | |
| 260 l10n_util::GetStringUTF16(IDS_OTHER_LANGUAGES)); | |
| 256 if (display_name != native_name) | 261 if (display_name != native_name) |
| 257 display_name = base::StringPrintf("%s - %s", | 262 display_name = base::StringPrintf("%s - %s", |
| 258 display_name.c_str(), | 263 display_name.c_str(), |
| 259 native_name.c_str()); | 264 native_name.c_str()); |
| 260 | 265 |
| 261 language_info->SetString("value", value); | 266 language_info->SetString("value", value); |
| 262 language_info->SetString("title", display_name); | 267 language_info->SetString("title", display_name); |
| 263 language_info->SetBoolean("selected", value == app_locale); | 268 language_info->SetBoolean("selected", value == app_locale); |
| 264 } | 269 } |
| 265 return languages_list; | 270 return languages_list; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 timezone_option->SetString("value", timezone_id); | 315 timezone_option->SetString("value", timezone_id); |
| 311 timezone_option->SetString("title", timezone_name); | 316 timezone_option->SetString("title", timezone_name); |
| 312 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); | 317 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); |
| 313 timezone_list->Append(timezone_option.release()); | 318 timezone_list->Append(timezone_option.release()); |
| 314 } | 319 } |
| 315 | 320 |
| 316 return timezone_list.release(); | 321 return timezone_list.release(); |
| 317 } | 322 } |
| 318 | 323 |
| 319 } // namespace chromeos | 324 } // namespace chromeos |
| OLD | NEW |