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

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2707133006: Start ARC and sign in after Chrome OS login (Closed)
Patch Set: minimize test diff Created 3 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chromeos/arc/arc_session_manager.h" 5 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/shelf_delegate.h" 9 #include "ash/common/shelf/shelf_delegate.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 if (support_host_) { 437 if (support_host_) {
438 support_host_->Close(); 438 support_host_->Close();
439 support_host_->RemoveObserver(this); 439 support_host_->RemoveObserver(this);
440 support_host_.reset(); 440 support_host_.reset();
441 } 441 }
442 context_.reset(); 442 context_.reset();
443 profile_ = nullptr; 443 profile_ = nullptr;
444 SetState(State::NOT_INITIALIZED); 444 SetState(State::NOT_INITIALIZED);
445 } 445 }
446 446
447
448 void ArcSessionManager::ShutdownSession() { 447 void ArcSessionManager::ShutdownSession() {
449 arc_sign_in_timer_.Stop(); 448 arc_sign_in_timer_.Stop();
450 playstore_launcher_.reset(); 449 playstore_launcher_.reset();
451 terms_of_service_negotiator_.reset(); 450 terms_of_service_negotiator_.reset();
452 android_management_checker_.reset(); 451 android_management_checker_.reset();
453 arc_session_runner_->RequestStop(); 452 arc_session_runner_->RequestStop();
454 // TODO(hidehiko): The ARC instance's stopping is asynchronous, so it might 453 // TODO(hidehiko): The ARC instance's stopping is asynchronous, so it might
455 // still be running when we return from this function. Do not set the 454 // still be running when we return from this function. Do not set the
456 // STOPPED state immediately here. 455 // STOPPED state immediately here.
457 if (state_ != State::NOT_INITIALIZED && state_ != State::REMOVING_DATA_DIR) 456 if (state_ != State::NOT_INITIALIZED && state_ != State::REMOVING_DATA_DIR)
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 // TODO(poromov): Move to more Kiosk dedicated set-up phase. 572 // TODO(poromov): Move to more Kiosk dedicated set-up phase.
574 if (IsArcKioskMode()) 573 if (IsArcKioskMode())
575 prefs->SetBoolean(prefs::kArcTermsAccepted, true); 574 prefs->SetBoolean(prefs::kArcTermsAccepted, true);
576 575
577 // Skip to show UI asking users to set up ARC OptIn preferences, if all of 576 // Skip to show UI asking users to set up ARC OptIn preferences, if all of
578 // them are managed by the admin policy. Note that the ToS agreement is anyway 577 // them are managed by the admin policy. Note that the ToS agreement is anyway
579 // not shown in the case of the managed ARC. 578 // not shown in the case of the managed ARC.
580 if (AreArcAllOptInPreferencesManaged()) 579 if (AreArcAllOptInPreferencesManaged())
581 prefs->SetBoolean(prefs::kArcTermsAccepted, true); 580 prefs->SetBoolean(prefs::kArcTermsAccepted, true);
582 581
583 // If it is marked that sign in has been successfully done, then directly 582 // If it is marked that sign in has been successfully done, if ARC has been
584 // start ARC. 583 // set up to always start, then directly start ARC.
585 // For testing, and for Kiosk mode, we also skip ToS negotiation procedure. 584 // For testing, and for Kiosk mode, we also skip ToS negotiation procedure.
586 // For backward compatibility, this check needs to be prior to the 585 // For backward compatibility, this check needs to be prior to the
587 // kArcTermsAccepted check below. 586 // kArcTermsAccepted check below.
588 if (prefs->GetBoolean(prefs::kArcSignedIn) || 587 if (prefs->GetBoolean(prefs::kArcSignedIn) || ShouldArcAlwaysStart() ||
589 IsArcOptInVerificationDisabled() || IsArcKioskMode()) { 588 IsArcOptInVerificationDisabled() || IsArcKioskMode()) {
590 StartArc(); 589 StartArc();
591 590
592 // Skip Android management check for testing. 591 // Skip Android management check for testing.
593 // We also skip if Android management check for Kiosk mode, 592 // We also skip if Android management check for Kiosk mode,
594 // because there are no managed human users for Kiosk exist. 593 // because there are no managed human users for Kiosk exist.
595 if (IsArcOptInVerificationDisabled() || IsArcKioskMode() || 594 if (IsArcOptInVerificationDisabled() || IsArcKioskMode() ||
596 (g_disable_ui_for_testing && 595 (g_disable_ui_for_testing &&
597 !g_enable_check_android_management_for_testing)) { 596 !g_enable_check_android_management_for_testing)) {
598 return; 597 return;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 891
893 #undef MAP_STATE 892 #undef MAP_STATE
894 893
895 // Some compilers report an error even if all values of an enum-class are 894 // Some compilers report an error even if all values of an enum-class are
896 // covered exhaustively in a switch statement. 895 // covered exhaustively in a switch statement.
897 NOTREACHED() << "Invalid value " << static_cast<int>(state); 896 NOTREACHED() << "Invalid value " << static_cast<int>(state);
898 return os; 897 return os;
899 } 898 }
900 899
901 } // namespace arc 900 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698