| 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/error_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 state_ = STATE_PROXY_ERROR; | 83 state_ = STATE_PROXY_ERROR; |
| 84 } | 84 } |
| 85 | 85 |
| 86 void ErrorScreenHandler::ShowCaptivePortalError(const std::string& network) { | 86 void ErrorScreenHandler::ShowCaptivePortalError(const std::string& network) { |
| 87 base::StringValue network_value(network); | 87 base::StringValue network_value(network); |
| 88 web_ui()->CallJavascriptFunction( | 88 web_ui()->CallJavascriptFunction( |
| 89 "login.ErrorMessageScreen.showCaptivePortalError", network_value); | 89 "login.ErrorMessageScreen.showCaptivePortalError", network_value); |
| 90 state_ = STATE_CAPTIVE_PORTAL_ERROR; | 90 state_ = STATE_CAPTIVE_PORTAL_ERROR; |
| 91 } | 91 } |
| 92 | 92 |
| 93 void ErrorScreenHandler::ShowTimeoutError() { |
| 94 web_ui()->CallJavascriptFunction("login.ErrorMessageScreen.showTimeoutError"); |
| 95 state_ = STATE_TIMEOUT_ERROR; |
| 96 } |
| 97 |
| 93 void ErrorScreenHandler::ShowOfflineError() { | 98 void ErrorScreenHandler::ShowOfflineError() { |
| 94 web_ui()->CallJavascriptFunction("login.ErrorMessageScreen.showOfflineError"); | 99 web_ui()->CallJavascriptFunction("login.ErrorMessageScreen.showOfflineError"); |
| 95 state_ = STATE_OFFLINE_ERROR; | 100 state_ = STATE_OFFLINE_ERROR; |
| 96 } | 101 } |
| 97 | 102 |
| 98 void ErrorScreenHandler::AllowGuestSignin(bool allowed) { | 103 void ErrorScreenHandler::AllowGuestSignin(bool allowed) { |
| 99 base::FundamentalValue allowed_value(allowed); | 104 base::FundamentalValue allowed_value(allowed); |
| 100 web_ui()->CallJavascriptFunction("login.ErrorMessageScreen.allowGuestSignin", | 105 web_ui()->CallJavascriptFunction("login.ErrorMessageScreen.allowGuestSignin", |
| 101 allowed_value); | 106 allowed_value); |
| 102 } | 107 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 localized_strings->SetString("offlineMessageTitle", | 150 localized_strings->SetString("offlineMessageTitle", |
| 146 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_TITLE)); | 151 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_TITLE)); |
| 147 localized_strings->SetString("offlineMessageBody", | 152 localized_strings->SetString("offlineMessageBody", |
| 148 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_MESSAGE)); | 153 l10n_util::GetStringUTF16(IDS_LOGIN_OFFLINE_MESSAGE)); |
| 149 localized_strings->SetString("captivePortalTitle", | 154 localized_strings->SetString("captivePortalTitle", |
| 150 l10n_util::GetStringUTF16(IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_TITLE)); | 155 l10n_util::GetStringUTF16(IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_TITLE)); |
| 151 localized_strings->SetString("captivePortalMessage", | 156 localized_strings->SetString("captivePortalMessage", |
| 152 l10n_util::GetStringUTF16(IDS_LOGIN_MAYBE_CAPTIVE_PORTAL)); | 157 l10n_util::GetStringUTF16(IDS_LOGIN_MAYBE_CAPTIVE_PORTAL)); |
| 153 localized_strings->SetString("captivePortalProxyMessage", | 158 localized_strings->SetString("captivePortalProxyMessage", |
| 154 l10n_util::GetStringUTF16(IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_PROXY)); | 159 l10n_util::GetStringUTF16(IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_PROXY)); |
| 160 localized_strings->SetString("timeoutMessageTitle", |
| 161 l10n_util::GetStringUTF16(IDS_LOGIN_TIMEOUT_TITLE)); |
| 155 localized_strings->SetString("captivePortalNetworkSelect", | 162 localized_strings->SetString("captivePortalNetworkSelect", |
| 156 l10n_util::GetStringUTF16(IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_NETWORK_SELECT)); | 163 l10n_util::GetStringUTF16(IDS_LOGIN_MAYBE_CAPTIVE_PORTAL_NETWORK_SELECT)); |
| 157 localized_strings->SetString("proxyMessageText", | 164 localized_strings->SetString("proxyMessageText", |
| 158 l10n_util::GetStringUTF16(IDS_LOGIN_PROXY_ERROR_MESSAGE)); | 165 l10n_util::GetStringUTF16(IDS_LOGIN_PROXY_ERROR_MESSAGE)); |
| 159 } | 166 } |
| 160 | 167 |
| 161 void ErrorScreenHandler::Initialize() { | 168 void ErrorScreenHandler::Initialize() { |
| 162 if (!page_is_ready()) | 169 if (!page_is_ready()) |
| 163 return; | 170 return; |
| 164 if (show_on_init_) { | 171 if (show_on_init_) { |
| 165 Show(parent_screen_, NULL); | 172 Show(parent_screen_, NULL); |
| 166 show_on_init_ = false; | 173 show_on_init_ = false; |
| 167 } | 174 } |
| 168 } | 175 } |
| 169 | 176 |
| 170 gfx::NativeWindow ErrorScreenHandler::GetNativeWindow() { | 177 gfx::NativeWindow ErrorScreenHandler::GetNativeWindow() { |
| 171 if (native_window_delegate_) | 178 if (native_window_delegate_) |
| 172 return native_window_delegate_->GetNativeWindow(); | 179 return native_window_delegate_->GetNativeWindow(); |
| 173 return NULL; | 180 return NULL; |
| 174 } | 181 } |
| 175 | 182 |
| 176 } // namespace chromeos | 183 } // namespace chromeos |
| OLD | NEW |