| 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_shutdown.h" | 18 #include "chrome/browser/browser_shutdown.h" |
| 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 21 #include "chrome/browser/chromeos/cros/cros_library.h" | |
| 22 #include "chrome/browser/chromeos/cros/network_library.h" | |
| 23 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 21 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
| 24 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 22 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
| 25 #include "chrome/browser/chromeos/login/hwid_checker.h" | 23 #include "chrome/browser/chromeos/login/hwid_checker.h" |
| 26 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 24 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 27 #include "chrome/browser/chromeos/login/screen_locker.h" | 25 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 28 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" | 26 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" |
| 29 #include "chrome/browser/chromeos/login/user.h" | 27 #include "chrome/browser/chromeos/login/user.h" |
| 30 #include "chrome/browser/chromeos/login/webui_login_display.h" | 28 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 31 #include "chrome/browser/chromeos/login/wizard_controller.h" | 29 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 32 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 30 #include "chrome/browser/chromeos/net/network_portal_detector.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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 NativeWindowDelegate* native_window_delegate) { | 448 NativeWindowDelegate* native_window_delegate) { |
| 455 native_window_delegate_ = native_window_delegate; | 449 native_window_delegate_ = native_window_delegate; |
| 456 } | 450 } |
| 457 | 451 |
| 458 void SigninScreenHandler::OnNetworkReady() { | 452 void SigninScreenHandler::OnNetworkReady() { |
| 459 MaybePreloadAuthExtension(); | 453 MaybePreloadAuthExtension(); |
| 460 } | 454 } |
| 461 | 455 |
| 462 void SigninScreenHandler::UpdateState(NetworkStateInformer::State state, | 456 void SigninScreenHandler::UpdateState(NetworkStateInformer::State state, |
| 463 const std::string& service_path, | 457 const std::string& service_path, |
| 464 ConnectionType connection_type, | 458 const std::string& connection_type, |
| 465 const std::string& reason) { | 459 const std::string& reason) { |
| 466 UpdateStateInternal(state, service_path, connection_type, reason, false); | 460 UpdateStateInternal(state, service_path, connection_type, reason, false); |
| 467 } | 461 } |
| 468 | 462 |
| 469 // SigninScreenHandler, private: ----------------------------------------------- | 463 // SigninScreenHandler, private: ----------------------------------------------- |
| 470 | 464 |
| 471 void SigninScreenHandler::UpdateUIState(UIState ui_state, | 465 void SigninScreenHandler::UpdateUIState(UIState ui_state, |
| 472 DictionaryValue* params) { | 466 DictionaryValue* params) { |
| 473 switch (ui_state) { | 467 switch (ui_state) { |
| 474 case UI_STATE_GAIA_SIGNIN: | 468 case UI_STATE_GAIA_SIGNIN: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 485 break; | 479 break; |
| 486 default: | 480 default: |
| 487 NOTREACHED(); | 481 NOTREACHED(); |
| 488 break; | 482 break; |
| 489 } | 483 } |
| 490 } | 484 } |
| 491 | 485 |
| 492 // TODO (ygorshenin@): split this method into small parts. | 486 // TODO (ygorshenin@): split this method into small parts. |
| 493 void SigninScreenHandler::UpdateStateInternal( | 487 void SigninScreenHandler::UpdateStateInternal( |
| 494 NetworkStateInformer::State state, | 488 NetworkStateInformer::State state, |
| 495 const std::string service_path, | 489 const std::string& service_path, |
| 496 ConnectionType connection_type, | 490 const std::string& connection_type, |
| 497 std::string reason, | 491 const std::string& reason, |
| 498 bool force_update) { | 492 bool force_update) { |
| 499 // Skip "update" notification about OFFLINE state from | 493 // Skip "update" notification about OFFLINE state from |
| 500 // NetworkStateInformer if previous notification already was | 494 // NetworkStateInformer if previous notification already was |
| 501 // delayed. | 495 // delayed. |
| 502 if (state == NetworkStateInformer::OFFLINE && | 496 if (state == NetworkStateInformer::OFFLINE && |
| 503 reason == ErrorScreenActor::kErrorReasonUpdate && | 497 reason == ErrorScreenActor::kErrorReasonUpdate && |
| 504 !update_state_closure_.IsCancelled()) { | 498 !update_state_closure_.IsCancelled()) { |
| 505 return; | 499 return; |
| 506 } | 500 } |
| 507 | 501 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 LOG(WARNING) << "Retry page load due to reason: " << reason; | 594 LOG(WARNING) << "Retry page load due to reason: " << reason; |
| 601 ReloadGaiaScreen(); | 595 ReloadGaiaScreen(); |
| 602 is_gaia_reloaded = true; | 596 is_gaia_reloaded = true; |
| 603 } | 597 } |
| 604 | 598 |
| 605 if (is_online || !is_under_captive_portal) | 599 if (is_online || !is_under_captive_portal) |
| 606 error_screen_actor_->HideCaptivePortal(); | 600 error_screen_actor_->HideCaptivePortal(); |
| 607 | 601 |
| 608 if ((!is_online || is_gaia_loading_timeout) && is_gaia_signin && | 602 if ((!is_online || is_gaia_loading_timeout) && is_gaia_signin && |
| 609 !offline_login_active_) { | 603 !offline_login_active_) { |
| 610 SetupAndShowOfflineMessage(state, service_path, connection_type, reason, | 604 SetupAndShowOfflineMessage(state, service_path, reason, |
| 611 is_proxy_error, is_under_captive_portal, | 605 is_proxy_error, is_under_captive_portal, |
| 612 is_gaia_loading_timeout); | 606 is_gaia_loading_timeout); |
| 613 } else { | 607 } else { |
| 614 HideOfflineMessage(state, service_path, reason, is_gaia_signin, | 608 HideOfflineMessage(state, service_path, reason, is_gaia_signin, |
| 615 is_gaia_reloaded); | 609 is_gaia_reloaded); |
| 616 } | 610 } |
| 617 } | 611 } |
| 618 | 612 |
| 619 void SigninScreenHandler::SetupAndShowOfflineMessage( | 613 void SigninScreenHandler::SetupAndShowOfflineMessage( |
| 620 NetworkStateInformer:: State state, | 614 NetworkStateInformer:: State state, |
| 621 const std::string& service_path, | 615 const std::string& service_path, |
| 622 ConnectionType connection_type, | |
| 623 const std::string& reason, | 616 const std::string& reason, |
| 624 bool is_proxy_error, | 617 bool is_proxy_error, |
| 625 bool is_under_captive_portal, | 618 bool is_under_captive_portal, |
| 626 bool is_gaia_loading_timeout) { | 619 bool is_gaia_loading_timeout) { |
| 627 std::string network_id = GetNetworkUniqueId(service_path); | 620 std::string network_id = GetNetworkUniqueId(service_path); |
| 628 LOG(WARNING) << "Show offline message: " | 621 LOG(WARNING) << "Show offline message: " |
| 629 << "state=" << NetworkStateStatusString(state) << ", " | 622 << "state=" << NetworkStateStatusString(state) << ", " |
| 630 << "network_id=" << network_id << ", " | 623 << "network_id=" << network_id << ", " |
| 631 << "reason=" << reason << ", " | 624 << "reason=" << reason << ", " |
| 632 << "is_under_captive_portal=" << is_under_captive_portal; | 625 << "is_under_captive_portal=" << is_under_captive_portal; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 error_screen_actor_->AllowGuestSignin(guest_signin_allowed); | 657 error_screen_actor_->AllowGuestSignin(guest_signin_allowed); |
| 665 | 658 |
| 666 bool offline_login_allowed = IsOfflineLoginAllowed() && | 659 bool offline_login_allowed = IsOfflineLoginAllowed() && |
| 667 IsSigninScreenError(error_screen_actor_->error_state()) && | 660 IsSigninScreenError(error_screen_actor_->error_state()) && |
| 668 error_screen_actor_->error_state() != | 661 error_screen_actor_->error_state() != |
| 669 ErrorScreen::ERROR_STATE_AUTH_EXT_TIMEOUT; | 662 ErrorScreen::ERROR_STATE_AUTH_EXT_TIMEOUT; |
| 670 error_screen_actor_->AllowOfflineLogin(offline_login_allowed); | 663 error_screen_actor_->AllowOfflineLogin(offline_login_allowed); |
| 671 | 664 |
| 672 if (GetCurrentScreen() != OobeUI::SCREEN_ERROR_MESSAGE) { | 665 if (GetCurrentScreen() != OobeUI::SCREEN_ERROR_MESSAGE) { |
| 673 DictionaryValue params; | 666 DictionaryValue params; |
| 674 params.SetInteger("lastNetworkType", static_cast<int>(connection_type)); | |
| 675 error_screen_actor_->SetUIState(ErrorScreen::UI_STATE_SIGNIN); | 667 error_screen_actor_->SetUIState(ErrorScreen::UI_STATE_SIGNIN); |
| 676 error_screen_actor_->Show(OobeUI::SCREEN_GAIA_SIGNIN, ¶ms); | 668 error_screen_actor_->Show(OobeUI::SCREEN_GAIA_SIGNIN, ¶ms); |
| 677 } | 669 } |
| 678 } | 670 } |
| 679 | 671 |
| 680 void SigninScreenHandler::HideOfflineMessage(NetworkStateInformer::State state, | 672 void SigninScreenHandler::HideOfflineMessage(NetworkStateInformer::State state, |
| 681 const std::string& service_path, | 673 const std::string& service_path, |
| 682 const std::string& reason, | 674 const std::string& reason, |
| 683 bool is_gaia_signin, | 675 bool is_gaia_signin, |
| 684 bool is_gaia_reloaded) { | 676 bool is_gaia_reloaded) { |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 if (!cros_settings) | 1559 if (!cros_settings) |
| 1568 return false; | 1560 return false; |
| 1569 | 1561 |
| 1570 // Offline login is allowed only when user pods are hidden. | 1562 // Offline login is allowed only when user pods are hidden. |
| 1571 bool show_pods; | 1563 bool show_pods; |
| 1572 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); | 1564 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); |
| 1573 return !show_pods; | 1565 return !show_pods; |
| 1574 } | 1566 } |
| 1575 | 1567 |
| 1576 } // namespace chromeos | 1568 } // namespace chromeos |
| OLD | NEW |