OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/signin_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 18 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
19 #include "chrome/browser/browser_shutdown.h" | 19 #include "chrome/browser/browser_shutdown.h" |
20 #include "chrome/browser/chromeos/cros/cros_library.h" | |
21 #include "chrome/browser/chromeos/cros/network_library.h" | |
22 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 20 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
23 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 21 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
24 #include "chrome/browser/chromeos/login/hwid_checker.h" | 22 #include "chrome/browser/chromeos/login/hwid_checker.h" |
25 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 23 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
26 #include "chrome/browser/chromeos/login/screen_locker.h" | 24 #include "chrome/browser/chromeos/login/screen_locker.h" |
27 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" | 25 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" |
28 #include "chrome/browser/chromeos/login/user.h" | 26 #include "chrome/browser/chromeos/login/user.h" |
29 #include "chrome/browser/chromeos/login/webui_login_display.h" | 27 #include "chrome/browser/chromeos/login/webui_login_display.h" |
30 #include "chrome/browser/chromeos/login/wizard_controller.h" | 28 #include "chrome/browser/chromeos/login/wizard_controller.h" |
31 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 29 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
32 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 30 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
33 #include "chrome/browser/chromeos/settings/cros_settings.h" | 31 #include "chrome/browser/chromeos/settings/cros_settings.h" |
34 #include "chrome/browser/io_thread.h" | 32 #include "chrome/browser/io_thread.h" |
35 #include "chrome/browser/policy/browser_policy_connector.h" | 33 #include "chrome/browser/policy/browser_policy_connector.h" |
36 #include "chrome/browser/profiles/profile.h" | 34 #include "chrome/browser/profiles/profile.h" |
37 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" | 35 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
38 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" | 36 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" |
39 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 37 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
40 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 38 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
41 #include "chrome/common/chrome_notification_types.h" | 39 #include "chrome/common/chrome_notification_types.h" |
42 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
43 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
44 #include "chrome/common/url_constants.h" | 42 #include "chrome/common/url_constants.h" |
45 #include "chromeos/chromeos_switches.h" | 43 #include "chromeos/chromeos_switches.h" |
46 #include "chromeos/dbus/dbus_thread_manager.h" | 44 #include "chromeos/dbus/dbus_thread_manager.h" |
47 #include "chromeos/dbus/power_manager_client.h" | 45 #include "chromeos/dbus/power_manager_client.h" |
48 #include "chromeos/ime/input_method_manager.h" | 46 #include "chromeos/ime/input_method_manager.h" |
49 #include "chromeos/ime/xkeyboard.h" | 47 #include "chromeos/ime/xkeyboard.h" |
| 48 #include "chromeos/network/network_state.h" |
| 49 #include "chromeos/network/network_state_handler.h" |
50 #include "content/public/browser/render_view_host.h" | 50 #include "content/public/browser/render_view_host.h" |
51 #include "content/public/browser/web_contents.h" | 51 #include "content/public/browser/web_contents.h" |
52 #include "google_apis/gaia/gaia_auth_util.h" | 52 #include "google_apis/gaia/gaia_auth_util.h" |
53 #include "google_apis/gaia/gaia_switches.h" | 53 #include "google_apis/gaia/gaia_switches.h" |
54 #include "google_apis/gaia/gaia_urls.h" | 54 #include "google_apis/gaia/gaia_urls.h" |
55 #include "grit/chromium_strings.h" | 55 #include "grit/chromium_strings.h" |
56 #include "grit/generated_resources.h" | 56 #include "grit/generated_resources.h" |
| 57 #include "third_party/cros_system_api/dbus/service_constants.h" |
57 #include "ui/base/l10n/l10n_util.h" | 58 #include "ui/base/l10n/l10n_util.h" |
58 | 59 |
59 #if defined(USE_AURA) | 60 #if defined(USE_AURA) |
60 #include "ash/shell.h" | 61 #include "ash/shell.h" |
61 #include "ash/wm/session_state_controller.h" | 62 #include "ash/wm/session_state_controller.h" |
62 #endif | 63 #endif |
63 | 64 |
64 using content::BrowserThread; | 65 using content::BrowserThread; |
65 using content::RenderViewHost; | 66 using content::RenderViewHost; |
66 | 67 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 screen == OobeUI::SCREEN_ACCOUNT_PICKER; | 179 screen == OobeUI::SCREEN_ACCOUNT_PICKER; |
179 } | 180 } |
180 | 181 |
181 bool IsSigninScreenError(ErrorScreen::ErrorState error_state) { | 182 bool IsSigninScreenError(ErrorScreen::ErrorState error_state) { |
182 return error_state == ErrorScreen::ERROR_STATE_PORTAL || | 183 return error_state == ErrorScreen::ERROR_STATE_PORTAL || |
183 error_state == ErrorScreen::ERROR_STATE_OFFLINE || | 184 error_state == ErrorScreen::ERROR_STATE_OFFLINE || |
184 error_state == ErrorScreen::ERROR_STATE_PROXY || | 185 error_state == ErrorScreen::ERROR_STATE_PROXY || |
185 error_state == ErrorScreen::ERROR_STATE_AUTH_EXT_TIMEOUT; | 186 error_state == ErrorScreen::ERROR_STATE_AUTH_EXT_TIMEOUT; |
186 } | 187 } |
187 | 188 |
188 // Returns a pointer to a Network instance by service path or NULL if | |
189 // network can not be found. | |
190 Network* FindNetworkByPath(const std::string& service_path) { | |
191 CrosLibrary* cros = CrosLibrary::Get(); | |
192 if (!cros) | |
193 return NULL; | |
194 NetworkLibrary* network_library = cros->GetNetworkLibrary(); | |
195 if (!network_library) | |
196 return NULL; | |
197 return network_library->FindNetworkByPath(service_path); | |
198 } | |
199 | |
200 // Returns network name by service path. | 189 // Returns network name by service path. |
201 std::string GetNetworkName(const std::string& service_path) { | 190 std::string GetNetworkName(const std::string& service_path) { |
202 Network* network = FindNetworkByPath(service_path); | 191 const NetworkState* network = |
| 192 NetworkStateHandler::Get()->GetNetworkState(service_path); |
203 if (!network) | 193 if (!network) |
204 return std::string(); | 194 return std::string(); |
205 return network->name(); | 195 return network->name(); |
206 } | 196 } |
207 | 197 |
208 // Returns network unique id by service path. | 198 // Returns network unique id by service path. |
209 std::string GetNetworkUniqueId(const std::string& service_path) { | 199 std::string GetNetworkUniqueId(const std::string& service_path) { |
210 Network* network = FindNetworkByPath(service_path); | 200 const NetworkState* network = |
| 201 NetworkStateHandler::Get()->GetNetworkState(service_path); |
211 if (!network) | 202 if (!network) |
212 return std::string(); | 203 return std::string(); |
213 return network->unique_id(); | 204 return network->guid(); |
214 } | 205 } |
215 | 206 |
216 // Returns captive portal state for a network by its service path. | 207 // Returns captive portal state for a network by its service path. |
217 NetworkPortalDetector::CaptivePortalState GetCaptivePortalState( | 208 NetworkPortalDetector::CaptivePortalState GetCaptivePortalState( |
218 const std::string& service_path) { | 209 const std::string& service_path) { |
219 NetworkPortalDetector* detector = NetworkPortalDetector::GetInstance(); | 210 NetworkPortalDetector* detector = NetworkPortalDetector::GetInstance(); |
220 Network* network = FindNetworkByPath(service_path); | 211 const NetworkState* network = |
| 212 NetworkStateHandler::Get()->GetNetworkState(service_path); |
221 if (!detector || !network) | 213 if (!detector || !network) |
222 return NetworkPortalDetector::CaptivePortalState(); | 214 return NetworkPortalDetector::CaptivePortalState(); |
223 return detector->GetCaptivePortalState(network); | 215 return detector->GetCaptivePortalState(network); |
224 } | 216 } |
225 | 217 |
226 void RecordDiscrepancyWithShill( | 218 void RecordDiscrepancyWithShill( |
227 const Network* network, | 219 const NetworkState* network, |
228 const NetworkPortalDetector::CaptivePortalStatus status) { | 220 const NetworkPortalDetector::CaptivePortalStatus status) { |
229 if (network->online()) { | 221 if (network->connection_state() == flimflam::kStateOnline) { |
230 UMA_HISTOGRAM_ENUMERATION( | 222 UMA_HISTOGRAM_ENUMERATION( |
231 "CaptivePortal.OOBE.DiscrepancyWithShill_Online", | 223 "CaptivePortal.OOBE.DiscrepancyWithShill_Online", |
232 status, | 224 status, |
233 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT); | 225 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT); |
234 } else if (network->restricted_pool()) { | 226 } else if (network->connection_state() == flimflam::kStatePortal) { |
235 UMA_HISTOGRAM_ENUMERATION( | 227 UMA_HISTOGRAM_ENUMERATION( |
236 "CaptivePortal.OOBE.DiscrepancyWithShill_RestrictedPool", | 228 "CaptivePortal.OOBE.DiscrepancyWithShill_RestrictedPool", |
237 status, | 229 status, |
238 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT); | 230 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT); |
239 } else { | 231 } else { |
240 UMA_HISTOGRAM_ENUMERATION( | 232 UMA_HISTOGRAM_ENUMERATION( |
241 "CaptivePortal.OOBE.DiscrepancyWithShill_Offline", | 233 "CaptivePortal.OOBE.DiscrepancyWithShill_Offline", |
242 status, | 234 status, |
243 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT); | 235 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT); |
244 } | 236 } |
245 } | 237 } |
246 | 238 |
247 // Record state and descripancies with shill (e.g. shill thinks that | 239 // Record state and descripancies with shill (e.g. shill thinks that |
248 // network is online but NetworkPortalDetector claims that it's behind | 240 // network is online but NetworkPortalDetector claims that it's behind |
249 // portal) for the network identified by |service_path|. | 241 // portal) for the network identified by |service_path|. |
250 void RecordNetworkPortalDetectorStats(const std::string& service_path) { | 242 void RecordNetworkPortalDetectorStats(const std::string& service_path) { |
251 const Network* network = FindNetworkByPath(service_path); | 243 const NetworkState* network = |
| 244 NetworkStateHandler::Get()->GetNetworkState(service_path); |
252 if (!network) | 245 if (!network) |
253 return; | 246 return; |
254 NetworkPortalDetector::CaptivePortalState state = | 247 NetworkPortalDetector::CaptivePortalState state = |
255 GetCaptivePortalState(service_path); | 248 GetCaptivePortalState(service_path); |
256 if (state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN) | 249 if (state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN) |
257 return; | 250 return; |
258 | 251 |
259 UMA_HISTOGRAM_ENUMERATION("CaptivePortal.OOBE.DetectionResult", | 252 UMA_HISTOGRAM_ENUMERATION("CaptivePortal.OOBE.DetectionResult", |
260 state.status, | 253 state.status, |
261 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT); | 254 NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT); |
262 | 255 |
263 switch (state.status) { | 256 switch (state.status) { |
264 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN: | 257 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN: |
265 NOTREACHED(); | 258 NOTREACHED(); |
266 break; | 259 break; |
267 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE: | 260 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE: |
268 if (network->online() || network->restricted_pool()) | 261 if (network->connection_state() == flimflam::kStateOnline || |
| 262 network->connection_state() == flimflam::kStatePortal) |
269 RecordDiscrepancyWithShill(network, state.status); | 263 RecordDiscrepancyWithShill(network, state.status); |
270 break; | 264 break; |
271 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE: | 265 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE: |
272 if (!network->online()) | 266 if (network->connection_state() != flimflam::kStateOnline) |
273 RecordDiscrepancyWithShill(network, state.status); | 267 RecordDiscrepancyWithShill(network, state.status); |
274 break; | 268 break; |
275 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL: | 269 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL: |
276 if (!network->restricted_pool()) | 270 if (network->connection_state() != flimflam::kStatePortal) |
277 RecordDiscrepancyWithShill(network, state.status); | 271 RecordDiscrepancyWithShill(network, state.status); |
278 break; | 272 break; |
279 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED: | 273 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED: |
280 if (!network->online()) | 274 if (network->connection_state() != flimflam::kStateOnline) |
281 RecordDiscrepancyWithShill(network, state.status); | 275 RecordDiscrepancyWithShill(network, state.status); |
282 break; | 276 break; |
283 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT: | 277 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT: |
284 NOTREACHED(); | 278 NOTREACHED(); |
285 break; | 279 break; |
286 } | 280 } |
287 } | 281 } |
288 | 282 |
289 } // namespace | 283 } // namespace |
290 | 284 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 NativeWindowDelegate* native_window_delegate) { | 445 NativeWindowDelegate* native_window_delegate) { |
452 native_window_delegate_ = native_window_delegate; | 446 native_window_delegate_ = native_window_delegate; |
453 } | 447 } |
454 | 448 |
455 void SigninScreenHandler::OnNetworkReady() { | 449 void SigninScreenHandler::OnNetworkReady() { |
456 MaybePreloadAuthExtension(); | 450 MaybePreloadAuthExtension(); |
457 } | 451 } |
458 | 452 |
459 void SigninScreenHandler::UpdateState(NetworkStateInformer::State state, | 453 void SigninScreenHandler::UpdateState(NetworkStateInformer::State state, |
460 const std::string& service_path, | 454 const std::string& service_path, |
461 ConnectionType connection_type, | 455 const std::string& connection_type, |
462 const std::string& reason) { | 456 const std::string& reason) { |
463 UpdateStateInternal(state, service_path, connection_type, reason, false); | 457 UpdateStateInternal(state, service_path, connection_type, reason, false); |
464 } | 458 } |
465 | 459 |
466 // SigninScreenHandler, private: ----------------------------------------------- | 460 // SigninScreenHandler, private: ----------------------------------------------- |
467 | 461 |
468 void SigninScreenHandler::UpdateUIState(UIState ui_state, | 462 void SigninScreenHandler::UpdateUIState(UIState ui_state, |
469 DictionaryValue* params) { | 463 DictionaryValue* params) { |
470 switch (ui_state) { | 464 switch (ui_state) { |
471 case UI_STATE_GAIA_SIGNIN: | 465 case UI_STATE_GAIA_SIGNIN: |
(...skipping 10 matching lines...) Expand all Loading... |
482 break; | 476 break; |
483 default: | 477 default: |
484 NOTREACHED(); | 478 NOTREACHED(); |
485 break; | 479 break; |
486 } | 480 } |
487 } | 481 } |
488 | 482 |
489 // TODO (ygorshenin@): split this method into small parts. | 483 // TODO (ygorshenin@): split this method into small parts. |
490 void SigninScreenHandler::UpdateStateInternal( | 484 void SigninScreenHandler::UpdateStateInternal( |
491 NetworkStateInformer::State state, | 485 NetworkStateInformer::State state, |
492 const std::string service_path, | 486 const std::string& service_path, |
493 ConnectionType connection_type, | 487 const std::string& connection_type, |
494 std::string reason, | 488 const std::string& reason, |
495 bool force_update) { | 489 bool force_update) { |
496 // Skip "update" notification about OFFLINE state from | 490 // Skip "update" notification about OFFLINE state from |
497 // NetworkStateInformer if previous notification already was | 491 // NetworkStateInformer if previous notification already was |
498 // delayed. | 492 // delayed. |
499 if (state == NetworkStateInformer::OFFLINE && | 493 if (state == NetworkStateInformer::OFFLINE && |
500 reason == ErrorScreenActor::kErrorReasonUpdate && | 494 reason == ErrorScreenActor::kErrorReasonUpdate && |
501 !update_state_closure_.IsCancelled()) { | 495 !update_state_closure_.IsCancelled()) { |
502 return; | 496 return; |
503 } | 497 } |
504 | 498 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 LOG(WARNING) << "Retry page load due to reason: " << reason; | 591 LOG(WARNING) << "Retry page load due to reason: " << reason; |
598 ReloadGaiaScreen(); | 592 ReloadGaiaScreen(); |
599 is_gaia_reloaded = true; | 593 is_gaia_reloaded = true; |
600 } | 594 } |
601 | 595 |
602 if (is_online || !is_under_captive_portal) | 596 if (is_online || !is_under_captive_portal) |
603 error_screen_actor_->HideCaptivePortal(); | 597 error_screen_actor_->HideCaptivePortal(); |
604 | 598 |
605 if ((!is_online || is_gaia_loading_timeout) && is_gaia_signin && | 599 if ((!is_online || is_gaia_loading_timeout) && is_gaia_signin && |
606 !offline_login_active_) { | 600 !offline_login_active_) { |
607 SetupAndShowOfflineMessage(state, service_path, connection_type, reason, | 601 SetupAndShowOfflineMessage(state, service_path, reason, |
608 is_proxy_error, is_under_captive_portal, | 602 is_proxy_error, is_under_captive_portal, |
609 is_gaia_loading_timeout); | 603 is_gaia_loading_timeout); |
610 } else { | 604 } else { |
611 HideOfflineMessage(state, service_path, reason, is_gaia_signin, | 605 HideOfflineMessage(state, service_path, reason, is_gaia_signin, |
612 is_gaia_reloaded); | 606 is_gaia_reloaded); |
613 } | 607 } |
614 } | 608 } |
615 | 609 |
616 void SigninScreenHandler::SetupAndShowOfflineMessage( | 610 void SigninScreenHandler::SetupAndShowOfflineMessage( |
617 NetworkStateInformer:: State state, | 611 NetworkStateInformer:: State state, |
618 const std::string& service_path, | 612 const std::string& service_path, |
619 ConnectionType connection_type, | |
620 const std::string& reason, | 613 const std::string& reason, |
621 bool is_proxy_error, | 614 bool is_proxy_error, |
622 bool is_under_captive_portal, | 615 bool is_under_captive_portal, |
623 bool is_gaia_loading_timeout) { | 616 bool is_gaia_loading_timeout) { |
624 std::string network_id = GetNetworkUniqueId(service_path); | 617 std::string network_id = GetNetworkUniqueId(service_path); |
625 LOG(WARNING) << "Show offline message: " | 618 LOG(WARNING) << "Show offline message: " |
626 << "state=" << NetworkStateStatusString(state) << ", " | 619 << "state=" << NetworkStateStatusString(state) << ", " |
627 << "network_id=" << network_id << ", " | 620 << "network_id=" << network_id << ", " |
628 << "reason=" << reason << ", " | 621 << "reason=" << reason << ", " |
629 << "is_under_captive_portal=" << is_under_captive_portal; | 622 << "is_under_captive_portal=" << is_under_captive_portal; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 error_screen_actor_->AllowGuestSignin(guest_signin_allowed); | 654 error_screen_actor_->AllowGuestSignin(guest_signin_allowed); |
662 | 655 |
663 bool offline_login_allowed = IsOfflineLoginAllowed() && | 656 bool offline_login_allowed = IsOfflineLoginAllowed() && |
664 IsSigninScreenError(error_screen_actor_->error_state()) && | 657 IsSigninScreenError(error_screen_actor_->error_state()) && |
665 error_screen_actor_->error_state() != | 658 error_screen_actor_->error_state() != |
666 ErrorScreen::ERROR_STATE_AUTH_EXT_TIMEOUT; | 659 ErrorScreen::ERROR_STATE_AUTH_EXT_TIMEOUT; |
667 error_screen_actor_->AllowOfflineLogin(offline_login_allowed); | 660 error_screen_actor_->AllowOfflineLogin(offline_login_allowed); |
668 | 661 |
669 if (GetCurrentScreen() != OobeUI::SCREEN_ERROR_MESSAGE) { | 662 if (GetCurrentScreen() != OobeUI::SCREEN_ERROR_MESSAGE) { |
670 DictionaryValue params; | 663 DictionaryValue params; |
671 params.SetInteger("lastNetworkType", static_cast<int>(connection_type)); | |
672 error_screen_actor_->SetUIState(ErrorScreen::UI_STATE_SIGNIN); | 664 error_screen_actor_->SetUIState(ErrorScreen::UI_STATE_SIGNIN); |
673 error_screen_actor_->Show(OobeUI::SCREEN_GAIA_SIGNIN, ¶ms); | 665 error_screen_actor_->Show(OobeUI::SCREEN_GAIA_SIGNIN, ¶ms); |
674 } | 666 } |
675 } | 667 } |
676 | 668 |
677 void SigninScreenHandler::HideOfflineMessage(NetworkStateInformer::State state, | 669 void SigninScreenHandler::HideOfflineMessage(NetworkStateInformer::State state, |
678 const std::string& service_path, | 670 const std::string& service_path, |
679 const std::string& reason, | 671 const std::string& reason, |
680 bool is_gaia_signin, | 672 bool is_gaia_signin, |
681 bool is_gaia_reloaded) { | 673 bool is_gaia_reloaded) { |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 if (!cros_settings) | 1551 if (!cros_settings) |
1560 return false; | 1552 return false; |
1561 | 1553 |
1562 // Offline login is allowed only when user pods are hidden. | 1554 // Offline login is allowed only when user pods are hidden. |
1563 bool show_pods; | 1555 bool show_pods; |
1564 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); | 1556 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); |
1565 return !show_pods; | 1557 return !show_pods; |
1566 } | 1558 } |
1567 | 1559 |
1568 } // namespace chromeos | 1560 } // namespace chromeos |
OLD | NEW |