Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(912)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/network_state_informer.cc ('k') | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698