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

Unified Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2722263002: Add function document, and small refactor around Start/StopArc(). (Closed)
Patch Set: Rebase Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/arc_session_manager.cc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc
index 4ec1efcff246bb015106cfc74aefe45471945abf..470dc9bf38c3c8ce6e44624e8bcdf4f86afa8194 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -471,16 +471,6 @@ void ArcSessionManager::Shutdown() {
SetState(State::NOT_INITIALIZED);
}
-void ArcSessionManager::StopArc() {
- if (state_ != State::STOPPED) {
- profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false);
- profile_->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, false);
- }
- ShutdownSession();
- if (support_host_)
- support_host_->Close();
-}
-
void ArcSessionManager::StartPreferenceHandler() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(profile_);
@@ -604,20 +594,6 @@ void ArcSessionManager::StopAndEnableArc() {
StopArc();
}
-void ArcSessionManager::StartArc() {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
- // ARC must be started only if no pending data removal request exists.
- DCHECK(!profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
-
- arc_start_time_ = base::Time::Now();
-
- provisioning_reported_ = false;
-
- arc_session_runner_->RequestStart();
- SetState(State::ACTIVE);
-}
-
void ArcSessionManager::OnArcSignInTimeout() {
LOG(ERROR) << "Timed out waiting for first sign in.";
OnProvisioningFinished(ProvisioningResult::OVERALL_SIGN_IN_TIMEOUT);
@@ -905,6 +881,30 @@ void ArcSessionManager::OnBackgroundAndroidManagementChecked(
}
}
+void ArcSessionManager::StartArc() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ // ARC must be started only if no pending data removal request exists.
+ DCHECK(!profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
+
+ arc_start_time_ = base::Time::Now();
+
+ provisioning_reported_ = false;
+
+ arc_session_runner_->RequestStart();
+ SetState(State::ACTIVE);
+}
+
+void ArcSessionManager::StopArc() {
+ if (state_ != State::STOPPED) {
+ profile_->GetPrefs()->SetBoolean(prefs::kArcSignedIn, false);
+ profile_->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, false);
+ }
+ ShutdownSession();
+ if (support_host_)
+ support_host_->Close();
+}
+
void ArcSessionManager::OnWindowClosed() {
DCHECK(support_host_);
if (terms_of_service_negotiator_) {
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager.h ('k') | chrome/browser/chromeos/arc/arc_session_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698