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

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

Issue 2695113004: Split IsArcPlayStoreEnabled() and ArcSessionManager's enabled concepts. (Closed)
Patch Set: 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.h
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.h b/chrome/browser/chromeos/arc/arc_session_manager.h
index 7c97cdc1aaabc2c93fa74e8e5700f3ff54e016fe..90285b92c468b4fc882850e5c285e675048d2fe2 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.h
+++ b/chrome/browser/chromeos/arc/arc_session_manager.h
@@ -170,6 +170,20 @@ class ArcSessionManager : public ArcSessionObserver,
// Google Play Store, then ARC can run without opt-in.
void SetArcPlayStoreEnabled(bool enable);
+ // Enabels ARC session. This triggers to start ARC instance, or maybe
Daniel Erat 2017/02/15 14:50:06 nit: "Enables"
hidehiko 2017/02/15 19:45:12 Done.
+ // to start Terms Of Service negotiation.
Daniel Erat 2017/02/15 14:50:06 maybe "This starts the ARC instance (or displays t
hidehiko 2017/02/15 19:45:12 Updated the comment. Note: ToS negotiation have va
+ // If it is already enabled, no-op.
+ // Currently, enabled/disabled is tried to whether Google Play Store is
Daniel Erat 2017/02/15 14:50:06 nit: s/tried/tied/ ?
hidehiko 2017/02/15 19:45:11 Good catch. Done.
+ // enabled or disabled.
+ void Enable();
khmel 2017/02/15 15:54:34 These functions are public, Why do we need to have
hidehiko 2017/02/15 19:45:11 This is preparation to extract preference handler
+
+ // Disables ARC session. This triggers to stop ARC instance, or if it is
Daniel Erat 2017/02/15 14:50:06 "This stops the ARC instance (or closes the ToS if
hidehiko 2017/02/15 19:45:11 Done. Similar to Enable() case, I avoided to limit
+ // middle of Terms Of Service negotiation, closes its UI etc.
+ // If it is already disabled, no-op.
+ // Currently, enabled/disabled is tried to whether Google Play Store is
Daniel Erat 2017/02/15 14:50:06 i'd delete this sentence since you have it earlier
hidehiko 2017/02/15 19:45:12 I see. Done.
+ // enabled or disabled.
+ void Disable();
+
// Called from the Chrome OS metrics provider to record Arc.State
// periodically.
void RecordArcState();
@@ -222,6 +236,10 @@ class ArcSessionManager : public ArcSessionObserver,
void SetAttemptUserExitCallbackForTesting(const base::Closure& callback);
private:
+ // Enable() has a check in order not to trigger starting procedure twice.
+ // For restarting, we would like to workaround it, and this is the method.
Daniel Erat 2017/02/15 14:50:06 nit: "This method can be called to bypass that che
hidehiko 2017/02/15 19:45:12 Thank you for good suggestion! Done.
+ void EnableImpl();
+
// Negotiates the terms of service to user.
void StartTermsOfServiceNegotiation();
void OnTermsOfServiceNegotiated(bool accepted);
@@ -260,6 +278,7 @@ class ArcSessionManager : public ArcSessionObserver,
// Registrar used to monitor ARC enabled state.
PrefChangeRegistrar pref_change_registrar_;
+ bool enabled_ = false;
State state_ = State::NOT_INITIALIZED;
base::ObserverList<Observer> observer_list_;
base::ObserverList<ArcSessionObserver> arc_session_observer_list_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_session_manager.cc » ('j') | chrome/browser/chromeos/arc/arc_session_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698