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

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

Issue 2723073002: Extract kArcEnabled preference from ArcSessionManager part 2. (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 fba0655f2cd7932501d2c4b18af762c6ef266a8b..16ee5723b2b6e31f66dbb5d529ef126302763c72 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.h
+++ b/chrome/browser/chromeos/arc/arc_session_manager.h
@@ -16,8 +16,6 @@
#include "chrome/browser/chromeos/arc/arc_support_host.h"
#include "chrome/browser/chromeos/policy/android_management_client.h"
#include "components/arc/arc_session_observer.h"
-#include "components/prefs/pref_change_registrar.h"
-#include "components/sync_preferences/pref_service_syncable_observer.h"
class ArcAppLauncher;
class Profile;
@@ -29,7 +27,6 @@ class PrefRegistrySyncable;
namespace arc {
class ArcAndroidManagementChecker;
-class ArcAuthInfoFetcher;
class ArcAuthContext;
class ArcSessionRunner;
class ArcTermsOfServiceNegotiator;
@@ -38,8 +35,7 @@ enum class ProvisioningResult : int;
// This class proxies the request from the client to fetch an auth code from
// LSO. It lives on the UI thread.
class ArcSessionManager : public ArcSessionObserver,
- public ArcSupportHost::Observer,
- public sync_preferences::PrefServiceSyncableObserver {
+ public ArcSupportHost::Observer {
public:
// Represents each State of ARC session.
// NOT_INITIALIZED: represents the state that the Profile is not yet ready
@@ -132,19 +128,17 @@ class ArcSessionManager : public ArcSessionObserver,
State state() const { return state_; }
- // Starts observing Google Play Store enabled preference change.
- // Also, based on its initial value, this may start ArcSession, or may start
- // removing the data, as initial state.
- // In addition, this triggers to show ArcAuthNotification, if necessary.
- // Note that this must be called after SetProfile().
- // TODO(hidehiko): Extract preference related code into a class to split the
- // dependencty.
- void StartPreferenceHandler();
-
// Adds or removes observers.
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
+ // Notifies observers that Google Play Store enabled preference is changed.
+ // Note: ArcPlayStoreEnabledPreferenceHandler has the main responsibility to
+ // notify the event. However, due to life time, it is difficult for non-ARC
+ // services to subscribe the handler instance directly. Instead, they can to
Luis Héctor Chávez 2017/03/02 00:09:17 nit: Instead, they can subscribe to
hidehiko 2017/03/02 02:21:57 Done.
+ // ArcSessionManager, and ArcSessionManager proxies the event.
+ void NotifyArcPlayStoreEnabledChanged(bool enabled);
+
// Adds or removes ArcSessionObservers.
// TODO(hidehiko): The observer should be migrated into
// ArcSessionManager::Observer.
@@ -177,9 +171,6 @@ class ArcSessionManager : public ArcSessionObserver,
// periodically.
void RecordArcState();
- // sync_preferences::PrefServiceSyncableObserver
- void OnIsSyncingChanged() override;
-
// ArcSupportHost::Observer:
void OnWindowClosed() override;
void OnTermsAgreed(bool is_metrics_enabled,
@@ -243,7 +234,6 @@ class ArcSessionManager : public ArcSessionObserver,
void SetState(State state);
void ShutdownSession();
- void OnOptInPreferenceChanged();
void OnAndroidManagementPassed();
void OnArcDataRemoved(bool success);
void OnArcSignInTimeout();
@@ -270,9 +260,6 @@ class ArcSessionManager : public ArcSessionObserver,
// Unowned pointer. Keeps current profile.
Profile* profile_ = nullptr;
- // Registrar used to monitor ARC enabled state.
- PrefChangeRegistrar pref_change_registrar_;
-
// Whether ArcSessionManager is requested to enable (starting to run ARC
// instance) or not.
bool enable_requested_ = false;

Powered by Google App Engine
This is Rietveld 408576698