| 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" |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // up and network stack isn't ready now. | 559 // up and network stack isn't ready now. |
| 560 // 2. proxy auth ui is displayed. UpdateStateCall() is delayed to | 560 // 2. proxy auth ui is displayed. UpdateStateCall() is delayed to |
| 561 // prevent screen change behind proxy auth ui. | 561 // prevent screen change behind proxy auth ui. |
| 562 if ((state == NetworkStateInformer::OFFLINE && is_first_update_state_call_) || | 562 if ((state == NetworkStateInformer::OFFLINE && is_first_update_state_call_) || |
| 563 has_pending_auth_ui_) { | 563 has_pending_auth_ui_) { |
| 564 is_first_update_state_call_ = false; | 564 is_first_update_state_call_ = false; |
| 565 update_state_closure_.Reset( | 565 update_state_closure_.Reset( |
| 566 base::Bind( | 566 base::Bind( |
| 567 &SigninScreenHandler::UpdateStateInternal, | 567 &SigninScreenHandler::UpdateStateInternal, |
| 568 weak_factory_.GetWeakPtr(), state, reason, force_update)); | 568 weak_factory_.GetWeakPtr(), state, reason, force_update)); |
| 569 MessageLoop::current()->PostDelayedTask( | 569 base::MessageLoop::current()->PostDelayedTask( |
| 570 FROM_HERE, | 570 FROM_HERE, |
| 571 update_state_closure_.callback(), | 571 update_state_closure_.callback(), |
| 572 base::TimeDelta::FromSeconds(kOfflineTimeoutSec)); | 572 base::TimeDelta::FromSeconds(kOfflineTimeoutSec)); |
| 573 return; | 573 return; |
| 574 } | 574 } |
| 575 is_first_update_state_call_ = false; | 575 is_first_update_state_call_ = false; |
| 576 | 576 |
| 577 // Don't show or hide error screen if we're in connecting state. | 577 // Don't show or hide error screen if we're in connecting state. |
| 578 if (state == NetworkStateInformer::CONNECTING && !force_update) { | 578 if (state == NetworkStateInformer::CONNECTING && !force_update) { |
| 579 if (connecting_closure_.IsCancelled()) { | 579 if (connecting_closure_.IsCancelled()) { |
| 580 // First notification about CONNECTING state. | 580 // First notification about CONNECTING state. |
| 581 connecting_closure_.Reset( | 581 connecting_closure_.Reset( |
| 582 base::Bind(&SigninScreenHandler::UpdateStateInternal, | 582 base::Bind(&SigninScreenHandler::UpdateStateInternal, |
| 583 weak_factory_.GetWeakPtr(), state, reason, true)); | 583 weak_factory_.GetWeakPtr(), state, reason, true)); |
| 584 MessageLoop::current()->PostDelayedTask( | 584 base::MessageLoop::current()->PostDelayedTask( |
| 585 FROM_HERE, | 585 FROM_HERE, |
| 586 connecting_closure_.callback(), | 586 connecting_closure_.callback(), |
| 587 base::TimeDelta::FromSeconds(kConnectingTimeoutSec)); | 587 base::TimeDelta::FromSeconds(kConnectingTimeoutSec)); |
| 588 } | 588 } |
| 589 return; | 589 return; |
| 590 } | 590 } |
| 591 connecting_closure_.Cancel(); | 591 connecting_closure_.Cancel(); |
| 592 | 592 |
| 593 const bool is_online = IsOnline(state, reason); | 593 const bool is_online = IsOnline(state, reason); |
| 594 const bool is_under_captive_portal = IsUnderCaptivePortal(state, reason); | 594 const bool is_under_captive_portal = IsUnderCaptivePortal(state, reason); |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 if (!cros_settings) | 1589 if (!cros_settings) |
| 1590 return false; | 1590 return false; |
| 1591 | 1591 |
| 1592 // Offline login is allowed only when user pods are hidden. | 1592 // Offline login is allowed only when user pods are hidden. |
| 1593 bool show_pods; | 1593 bool show_pods; |
| 1594 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); | 1594 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); |
| 1595 return !show_pods; | 1595 return !show_pods; |
| 1596 } | 1596 } |
| 1597 | 1597 |
| 1598 } // namespace chromeos | 1598 } // namespace chromeos |
| OLD | NEW |