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/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 return; | 60 return; |
61 } | 61 } |
62 | 62 |
63 ShowScreen(OobeUI::kScreenOobeNetwork, NULL); | 63 ShowScreen(OobeUI::kScreenOobeNetwork, NULL); |
64 } | 64 } |
65 | 65 |
66 void NetworkScreenHandler::Hide() { | 66 void NetworkScreenHandler::Hide() { |
67 } | 67 } |
68 | 68 |
69 void NetworkScreenHandler::ShowError(const string16& message) { | 69 void NetworkScreenHandler::ShowError(const string16& message) { |
70 CallJS("oobe.NetworkScreen.showError", base::StringValue(message)); | 70 CallJS("oobe.NetworkScreen.showError", message); |
71 } | 71 } |
72 | 72 |
73 void NetworkScreenHandler::ClearErrors() { | 73 void NetworkScreenHandler::ClearErrors() { |
74 if (page_is_ready()) | 74 if (page_is_ready()) |
75 CallJS("cr.ui.Oobe.clearErrors"); | 75 CallJS("cr.ui.Oobe.clearErrors"); |
76 } | 76 } |
77 | 77 |
78 void NetworkScreenHandler::ShowConnectingStatus( | 78 void NetworkScreenHandler::ShowConnectingStatus( |
79 bool connecting, | 79 bool connecting, |
80 const string16& network_id) { | 80 const string16& network_id) { |
81 // string16 connecting_label = | 81 // string16 connecting_label = |
82 // l10n_util::GetStringFUTF16(IDS_NETWORK_SELECTION_CONNECTING, | 82 // l10n_util::GetStringFUTF16(IDS_NETWORK_SELECTION_CONNECTING, |
83 // network_id); | 83 // network_id); |
84 // CallJS("cr.ui.Oobe.showConnectingStatus", | 84 // CallJS("cr.ui.Oobe.showConnectingStatus", |
85 // base::FundamentalValue(connecting), | 85 // base::FundamentalValue(connecting), |
86 // base::StringValue(network_id), | 86 // base::StringValue(network_id), |
87 // base::StringValue(connecting_label_value)); | 87 // base::StringValue(connecting_label_value)); |
88 } | 88 } |
89 | 89 |
90 void NetworkScreenHandler::EnableContinue(bool enabled) { | 90 void NetworkScreenHandler::EnableContinue(bool enabled) { |
91 is_continue_enabled_ = enabled; | 91 is_continue_enabled_ = enabled; |
92 if (!page_is_ready()) | 92 if (page_is_ready()) |
93 return; | 93 CallJS("cr.ui.Oobe.enableContinueButton", enabled); |
94 | |
95 CallJS("cr.ui.Oobe.enableContinueButton", base::FundamentalValue(enabled)); | |
96 } | 94 } |
97 | 95 |
98 // NetworkScreenHandler, BaseScreenHandler implementation: -------------------- | 96 // NetworkScreenHandler, BaseScreenHandler implementation: -------------------- |
99 | 97 |
100 void NetworkScreenHandler::DeclareLocalizedValues( | 98 void NetworkScreenHandler::DeclareLocalizedValues( |
101 LocalizedValuesBuilder* builder) { | 99 LocalizedValuesBuilder* builder) { |
102 builder->Add("networkScreenGreeting", IDS_WELCOME_SCREEN_GREETING); | 100 builder->Add("networkScreenGreeting", IDS_WELCOME_SCREEN_GREETING); |
103 builder->Add("networkScreenTitle", IDS_WELCOME_SCREEN_TITLE); | 101 builder->Add("networkScreenTitle", IDS_WELCOME_SCREEN_TITLE); |
104 builder->Add("selectLanguage", IDS_LANGUAGE_SELECTION_SELECT); | 102 builder->Add("selectLanguage", IDS_LANGUAGE_SELECTION_SELECT); |
105 builder->Add("selectKeyboard", IDS_KEYBOARD_SELECTION_SELECT); | 103 builder->Add("selectKeyboard", IDS_KEYBOARD_SELECTION_SELECT); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 "title", | 207 "title", |
210 util->GetInputMethodLongName(input_methods->at(i))); | 208 util->GetInputMethodLongName(input_methods->at(i))); |
211 input_method->SetBoolean("selected", | 209 input_method->SetBoolean("selected", |
212 ime_id == current_input_method_id); | 210 ime_id == current_input_method_id); |
213 input_methods_list->Append(input_method); | 211 input_methods_list->Append(input_method); |
214 } | 212 } |
215 return input_methods_list; | 213 return input_methods_list; |
216 } | 214 } |
217 | 215 |
218 } // namespace chromeos | 216 } // namespace chromeos |
OLD | NEW |