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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 // up and network stack isn't ready now. | 551 // up and network stack isn't ready now. |
552 // 2. proxy auth ui is displayed. UpdateStateCall() is delayed to | 552 // 2. proxy auth ui is displayed. UpdateStateCall() is delayed to |
553 // prevent screen change behind proxy auth ui. | 553 // prevent screen change behind proxy auth ui. |
554 if ((state == NetworkStateInformer::OFFLINE && is_first_update_state_call_) || | 554 if ((state == NetworkStateInformer::OFFLINE && is_first_update_state_call_) || |
555 has_pending_auth_ui_) { | 555 has_pending_auth_ui_) { |
556 is_first_update_state_call_ = false; | 556 is_first_update_state_call_ = false; |
557 update_state_closure_.Reset( | 557 update_state_closure_.Reset( |
558 base::Bind( | 558 base::Bind( |
559 &SigninScreenHandler::UpdateStateInternal, | 559 &SigninScreenHandler::UpdateStateInternal, |
560 weak_factory_.GetWeakPtr(), state, reason, force_update)); | 560 weak_factory_.GetWeakPtr(), state, reason, force_update)); |
561 MessageLoop::current()->PostDelayedTask( | 561 base::MessageLoop::current()->PostDelayedTask( |
562 FROM_HERE, | 562 FROM_HERE, |
563 update_state_closure_.callback(), | 563 update_state_closure_.callback(), |
564 base::TimeDelta::FromSeconds(kOfflineTimeoutSec)); | 564 base::TimeDelta::FromSeconds(kOfflineTimeoutSec)); |
565 return; | 565 return; |
566 } | 566 } |
567 is_first_update_state_call_ = false; | 567 is_first_update_state_call_ = false; |
568 | 568 |
569 // Don't show or hide error screen if we're in connecting state. | 569 // Don't show or hide error screen if we're in connecting state. |
570 if (state == NetworkStateInformer::CONNECTING && !force_update) { | 570 if (state == NetworkStateInformer::CONNECTING && !force_update) { |
571 if (connecting_closure_.IsCancelled()) { | 571 if (connecting_closure_.IsCancelled()) { |
572 // First notification about CONNECTING state. | 572 // First notification about CONNECTING state. |
573 connecting_closure_.Reset( | 573 connecting_closure_.Reset( |
574 base::Bind(&SigninScreenHandler::UpdateStateInternal, | 574 base::Bind(&SigninScreenHandler::UpdateStateInternal, |
575 weak_factory_.GetWeakPtr(), state, reason, true)); | 575 weak_factory_.GetWeakPtr(), state, reason, true)); |
576 MessageLoop::current()->PostDelayedTask( | 576 base::MessageLoop::current()->PostDelayedTask( |
577 FROM_HERE, | 577 FROM_HERE, |
578 connecting_closure_.callback(), | 578 connecting_closure_.callback(), |
579 base::TimeDelta::FromSeconds(kConnectingTimeoutSec)); | 579 base::TimeDelta::FromSeconds(kConnectingTimeoutSec)); |
580 } | 580 } |
581 return; | 581 return; |
582 } | 582 } |
583 connecting_closure_.Cancel(); | 583 connecting_closure_.Cancel(); |
584 | 584 |
585 const bool is_online = IsOnline(state, reason); | 585 const bool is_online = IsOnline(state, reason); |
586 const bool is_under_captive_portal = IsUnderCaptivePortal(state, reason); | 586 const bool is_under_captive_portal = IsUnderCaptivePortal(state, reason); |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 if (!cros_settings) | 1603 if (!cros_settings) |
1604 return false; | 1604 return false; |
1605 | 1605 |
1606 // Offline login is allowed only when user pods are hidden. | 1606 // Offline login is allowed only when user pods are hidden. |
1607 bool show_pods; | 1607 bool show_pods; |
1608 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); | 1608 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); |
1609 return !show_pods; | 1609 return !show_pods; |
1610 } | 1610 } |
1611 | 1611 |
1612 } // namespace chromeos | 1612 } // namespace chromeos |
OLD | NEW |