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

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

Issue 2720303002: Do nothing on OnSessionStopped if ARC is being restarted. (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 d5192354ba0826e00b869fefa7bd31eb77a04cc7..cc9fddfd50baa3e54c6845bafff00ec489207cbc 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.h
+++ b/chrome/browser/chromeos/arc/arc_session_manager.h
@@ -87,6 +87,8 @@ class ArcSessionManager : public ArcSessionObserver,
class Observer {
Yusuke Sato 2017/02/28 21:07:17 nit: Probably it's a good idea to have a short com
hidehiko 2017/03/01 09:10:04 Done.
public:
+ using StopReason = ArcSessionObserver::StopReason;
+
virtual ~Observer() = default;
Yusuke Sato 2017/02/28 21:07:16 nit: (while you're at it) isn't it better to make
hidehiko 2017/03/01 09:10:04 For that purpose, protected ctor looks more straig
hidehiko 2017/03/01 11:19:03 FYI: Found a recent discussion. https://groups.goo
// Called to notify that whether Google Play Store is enabled or not, which
@@ -96,6 +98,10 @@ class ArcSessionManager : public ArcSessionObserver,
// Called to notify that ARC has been initialized successfully.
virtual void OnArcInitialStart() {}
+ // Called when ARC session is stopped, and is not being restarted
+ // automatically.
+ virtual void OnArcSessionStopped(StopReason stop_reason) {}
+
// Called to notify that Android data has been removed. Used in
// browser_tests
virtual void OnArcDataRemoved() {}
@@ -133,12 +139,6 @@ class ArcSessionManager : public ArcSessionObserver,
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
- // Adds or removes ArcSessionObservers.
Yusuke Sato 2017/02/28 21:07:16 nice.
hidehiko 2017/03/01 09:10:04 :-)
- // TODO(hidehiko): The observer should be migrated into
- // ArcSessionManager::Observer.
- void AddSessionObserver(ArcSessionObserver* observer);
- void RemoveSessionObserver(ArcSessionObserver* observer);
-
// Returns true if ARC instance is running/stopped, respectively.
// See ArcSessionRunner::IsRunning()/IsStopped() for details.
bool IsSessionRunning() const;
@@ -252,8 +252,7 @@ class ArcSessionManager : public ArcSessionObserver,
policy::AndroidManagementClient::Result result);
// ArcSessionObserver:
- void OnSessionReady() override;
- void OnSessionStopped(StopReason reason) override;
+ void OnSessionStopped(StopReason reason, bool restarting) override;
std::unique_ptr<ArcSessionRunner> arc_session_runner_;
@@ -270,7 +269,6 @@ class ArcSessionManager : public ArcSessionObserver,
// Internal state machine. See also State enum class.
State state_ = State::NOT_INITIALIZED;
base::ObserverList<Observer> observer_list_;
- base::ObserverList<ArcSessionObserver> arc_session_observer_list_;
std::unique_ptr<ArcAppLauncher> playstore_launcher_;
bool reenable_arc_ = false;
bool provisioning_reported_ = false;
« 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