Chromium Code Reviews| Index: chrome/browser/chromeos/arc/arc_auth_service.h |
| diff --git a/chrome/browser/chromeos/arc/arc_auth_service.h b/chrome/browser/chromeos/arc/arc_auth_service.h |
| index 036be0ba897c07aa6656891170bd24a0741d0228..a94c688339df30131523cedaad2f733abb719f00 100644 |
| --- a/chrome/browser/chromeos/arc/arc_auth_service.h |
| +++ b/chrome/browser/chromeos/arc/arc_auth_service.h |
| @@ -60,11 +60,49 @@ class ArcAuthService : public ArcService, |
| public sync_preferences::PrefServiceSyncableObserver, |
| public sync_preferences::SyncedPrefObserver { |
| public: |
| + // Represents each State of ARC session. |
| + // NOT_INITIALIZED: represents the state that the Profile is not yet ready |
| + // so that this service is not yet initialized, or Chrome is being shut |
| + // down so that this is destructed. |
|
Luis Héctor Chávez
2016/11/14 17:06:50
nit: s/destructed/destroyed/
hidehiko
2016/11/14 19:07:57
Done.
|
| + // STOPPED: ARC session is not running, or being terminated. |
| + // SHOWING_TERMS_OF_SERVICE: "Terms Of Service" page is shown on ARC support |
| + // Chrome app. |
| + // CHECKING_ANDROID_MANAGEMENT: Checking Android management status. Note that |
| + // the status is checked for each ARC session starting, but this is the |
| + // state only for the first boot case (= opt-in case). The second time and |
| + // later the management check is running in parallel with ARC session |
| + // starting, and in such a case, State is ACTIVE, instead. |
| + // FETCHING_CODE: Fetching an auth token. Similar to |
| + // CHECKING_ANDROID_MANAGEMENT case, this is only for the first boot case. |
| + // In re-auth flow (fetching an auth token while ARC is running), the |
| + // State should be ACTIVE. |
| + // TODO(hidehiko): Migrate into re-auth flow, then remove this state. |
| + // ACTIVE: ARC is running. |
| + // |
| + // State transition should be as follws: |
|
Luis Héctor Chávez
2016/11/14 17:06:50
nit: s/follws/follows/
hidehiko
2016/11/14 19:07:57
Done.
|
| + // |
| + // NOT_INITIALIZED -> STOPPED: when the primary Profile gets ready. |
| + // ...(any)... -> NOT_INITIALIZED: when the Chrome is being shutdown. |
| + // ...(any)... -> STOPPED: on error. |
| + // |
| + // In the first boot case: |
| + // STOPPED -> SHOWINIG_TERMS_OF_SERVICE: when arc.enabled preference is set. |
|
Luis Héctor Chávez
2016/11/14 17:06:50
nit: s/SHOWINIG/SHOWING/
hidehiko
2016/11/14 19:07:57
Done.
|
| + // SHOWING_TERMS_OF_SERVICE -> CHECKING_ANDROID_MANAGEMENT: when a user |
| + // agree with "Terms Of Service" |
| + // CHECKING_ANDROID_MANAGEMENT -> FETCHING_CODE: when Android management |
| + // check passes. |
| + // FETCHING_CODE -> ACTIVE: when the auth token is successfully fetched. |
| + // |
| + // In the second (or later) boot case: |
| + // STOPPED -> ACTIVE: when arc.enabled preference is checked that it is |
| + // true. Practically, this is when the primary Profile gets ready. |
| enum class State { |
| - NOT_INITIALIZED, // Service is not initialized. |
| - STOPPED, // ARC is not running. |
| - FETCHING_CODE, // ARC may be running or not. Auth code is fetching. |
| - ACTIVE, // ARC is running. |
| + NOT_INITIALIZED, |
| + STOPPED, |
| + SHOWING_TERMS_OF_SERVICE, |
| + CHECKING_ANDROID_MANAGEMENT, |
| + FETCHING_CODE, |
| + ACTIVE, |
| }; |
| class Observer { |
| @@ -144,9 +182,6 @@ class ArcAuthService : public ArcService, |
| void OnSignInFailedInternal(ProvisioningResult result); |
| - // Called from Arc support platform app to start LSO. |
| - void StartLso(); |
| - |
| // Called from Arc support platform app to set auth code and start arc. |
| void SetAuthCodeAndStartArc(const std::string& auth_code); |
| @@ -184,6 +219,7 @@ class ArcAuthService : public ArcService, |
| bool is_backup_and_restore_enabled, |
| bool is_location_service_enabled) override; |
| void OnAuthSucceeded(const std::string& auth_code) override; |
| + void OnRetryClicked() override; |
| void OnSendFeedbackClicked() override; |
| // arc::ArcOptInPreferenceHandlerObserver: |
| @@ -227,7 +263,6 @@ class ArcAuthService : public ArcService, |
| const base::string16& status); |
| void OnOptInPreferenceChanged(); |
| void StartUI(); |
| - void StartAndroidManagementClient(); |
| void OnAndroidManagementPassed(); |
| void OnArcDataRemoved(bool success); |
| void OnArcSignInTimeout(); |
| @@ -239,6 +274,8 @@ class ArcAuthService : public ArcService, |
| void OnAccountInfoReady(mojom::AccountInfoPtr account_info); |
| void OnRobotAuthCodeFetched(const std::string& auth_code); |
| + void StartArcAndroidManagementCheck(); |
| + |
| // Called when the Android management check is done in opt-in flow or |
| // re-auth flow. |
| void OnAndroidManagementChecked( |