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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 // 2. proxy auth ui is displayed. UpdateStateCall() is delayed to | 523 // 2. proxy auth ui is displayed. UpdateStateCall() is delayed to |
524 // prevent screen change behind proxy auth ui. | 524 // prevent screen change behind proxy auth ui. |
525 if ((state == NetworkStateInformer::OFFLINE && is_first_update_state_call_) || | 525 if ((state == NetworkStateInformer::OFFLINE && is_first_update_state_call_) || |
526 has_pending_auth_ui_) { | 526 has_pending_auth_ui_) { |
527 is_first_update_state_call_ = false; | 527 is_first_update_state_call_ = false; |
528 update_state_closure_.Reset( | 528 update_state_closure_.Reset( |
529 base::Bind( | 529 base::Bind( |
530 &SigninScreenHandler::UpdateStateInternal, | 530 &SigninScreenHandler::UpdateStateInternal, |
531 weak_factory_.GetWeakPtr(), | 531 weak_factory_.GetWeakPtr(), |
532 state, service_path, connection_type, reason, force_update)); | 532 state, service_path, connection_type, reason, force_update)); |
533 MessageLoop::current()->PostDelayedTask( | 533 base::MessageLoop::current()->PostDelayedTask( |
534 FROM_HERE, | 534 FROM_HERE, |
535 update_state_closure_.callback(), | 535 update_state_closure_.callback(), |
536 base::TimeDelta::FromSeconds(kOfflineTimeoutSec)); | 536 base::TimeDelta::FromSeconds(kOfflineTimeoutSec)); |
537 return; | 537 return; |
538 } | 538 } |
539 is_first_update_state_call_ = false; | 539 is_first_update_state_call_ = false; |
540 | 540 |
541 // Don't show or hide error screen if we're in connecting state. | 541 // Don't show or hide error screen if we're in connecting state. |
542 if (state == NetworkStateInformer::CONNECTING && !force_update) { | 542 if (state == NetworkStateInformer::CONNECTING && !force_update) { |
543 if (connecting_closure_.IsCancelled()) { | 543 if (connecting_closure_.IsCancelled()) { |
544 // First notification about CONNECTING state. | 544 // First notification about CONNECTING state. |
545 connecting_closure_.Reset( | 545 connecting_closure_.Reset( |
546 base::Bind(&SigninScreenHandler::UpdateStateInternal, | 546 base::Bind(&SigninScreenHandler::UpdateStateInternal, |
547 weak_factory_.GetWeakPtr(), | 547 weak_factory_.GetWeakPtr(), |
548 state, service_path, connection_type, reason, true)); | 548 state, service_path, connection_type, reason, true)); |
549 MessageLoop::current()->PostDelayedTask( | 549 base::MessageLoop::current()->PostDelayedTask( |
550 FROM_HERE, | 550 FROM_HERE, |
551 connecting_closure_.callback(), | 551 connecting_closure_.callback(), |
552 base::TimeDelta::FromSeconds(kConnectingTimeoutSec)); | 552 base::TimeDelta::FromSeconds(kConnectingTimeoutSec)); |
553 } | 553 } |
554 return; | 554 return; |
555 } | 555 } |
556 connecting_closure_.Cancel(); | 556 connecting_closure_.Cancel(); |
557 | 557 |
558 bool is_online = (state == NetworkStateInformer::ONLINE); | 558 bool is_online = (state == NetworkStateInformer::ONLINE); |
559 bool is_under_captive_portal = | 559 bool is_under_captive_portal = |
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 if (!cros_settings) | 1567 if (!cros_settings) |
1568 return false; | 1568 return false; |
1569 | 1569 |
1570 // Offline login is allowed only when user pods are hidden. | 1570 // Offline login is allowed only when user pods are hidden. |
1571 bool show_pods; | 1571 bool show_pods; |
1572 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); | 1572 cros_settings->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_pods); |
1573 return !show_pods; | 1573 return !show_pods; |
1574 } | 1574 } |
1575 | 1575 |
1576 } // namespace chromeos | 1576 } // namespace chromeos |
OLD | NEW |