| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/options/chromeos/cros_language_options_handler
.h" |
| 20 #include "content/browser/webui/web_ui.h" | 20 #include "content/browser/webui/web_ui.h" |
| 21 #include "content/browser/webui/web_ui.h" | |
| 22 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" |
| 23 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
| 26 #include "ui/views/layout/fill_layout.h" | 25 #include "ui/views/layout/fill_layout.h" |
| 27 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| 28 | 27 |
| 29 #if defined(TOOLKIT_USES_GTK) | 28 #if defined(TOOLKIT_USES_GTK) |
| 30 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" | 29 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" |
| 31 #endif | 30 #endif |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void NetworkScreenHandler::HandleOnLanguageChanged(const ListValue* args) { | 160 void NetworkScreenHandler::HandleOnLanguageChanged(const ListValue* args) { |
| 162 DCHECK(args->GetSize() == 1); | 161 DCHECK(args->GetSize() == 1); |
| 163 std::string locale; | 162 std::string locale; |
| 164 if (!args->GetString(0, &locale)) | 163 if (!args->GetString(0, &locale)) |
| 165 NOTREACHED(); | 164 NOTREACHED(); |
| 166 | 165 |
| 167 // TODO(altimofeev): make language change async. | 166 // TODO(altimofeev): make language change async. |
| 168 LanguageSwitchMenu::SwitchLanguageAndEnableKeyboardLayouts(locale); | 167 LanguageSwitchMenu::SwitchLanguageAndEnableKeyboardLayouts(locale); |
| 169 | 168 |
| 170 DictionaryValue localized_strings; | 169 DictionaryValue localized_strings; |
| 171 static_cast<OobeUI*>(web_ui())->GetLocalizedStrings(&localized_strings); | 170 static_cast<OobeUI*>(web_ui()->GetController())->GetLocalizedStrings( |
| 171 &localized_strings); |
| 172 web_ui()->CallJavascriptFunction("cr.ui.Oobe.reloadContent", | 172 web_ui()->CallJavascriptFunction("cr.ui.Oobe.reloadContent", |
| 173 localized_strings); | 173 localized_strings); |
| 174 // Buttons are recreated, updated "Continue" button state. | 174 // Buttons are recreated, updated "Continue" button state. |
| 175 EnableContinue(is_continue_enabled_); | 175 EnableContinue(is_continue_enabled_); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void NetworkScreenHandler::HandleOnInputMethodChanged(const ListValue* args) { | 178 void NetworkScreenHandler::HandleOnInputMethodChanged(const ListValue* args) { |
| 179 DCHECK(args->GetSize() == 1); | 179 DCHECK(args->GetSize() == 1); |
| 180 std::string id; | 180 std::string id; |
| 181 if (!args->GetString(0, &id)) | 181 if (!args->GetString(0, &id)) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 input_method->SetString( | 229 input_method->SetString( |
| 230 "title", InputMethodMenu::GetTextForMenu(input_methods->at(i))); | 230 "title", InputMethodMenu::GetTextForMenu(input_methods->at(i))); |
| 231 input_method->SetBoolean("selected", | 231 input_method->SetBoolean("selected", |
| 232 input_methods->at(i).id() == current_input_method_id); | 232 input_methods->at(i).id() == current_input_method_id); |
| 233 input_methods_list->Append(input_method); | 233 input_methods_list->Append(input_method); |
| 234 } | 234 } |
| 235 return input_methods_list; | 235 return input_methods_list; |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace chromeos | 238 } // namespace chromeos |
| OLD | NEW |