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

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager.h

Issue 2745533005: Show notification during ARC managed provision (Closed)
Patch Set: Renaming, nit fixes Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <ostream> 9 #include <ostream>
10 #include <string> 10 #include <string>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 ACTIVE, 87 ACTIVE,
88 }; 88 };
89 89
90 // Observer for those services outside of ARC which want to know ARC events. 90 // Observer for those services outside of ARC which want to know ARC events.
91 class Observer { 91 class Observer {
92 public: 92 public:
93 // Called to notify that whether Google Play Store is enabled or not, which 93 // Called to notify that whether Google Play Store is enabled or not, which
94 // is represented by "arc.enabled" preference, is updated. 94 // is represented by "arc.enabled" preference, is updated.
95 virtual void OnArcPlayStoreEnabledChanged(bool enabled) {} 95 virtual void OnArcPlayStoreEnabledChanged(bool enabled) {}
96 96
97 // Called to notify that checking of Android management status started
98 // during OptIn flow.
99 virtual void OnArcOptInManagementCheckStarted() {}
100
97 // Called to notify that ARC has been initialized successfully. 101 // Called to notify that ARC has been initialized successfully.
98 virtual void OnArcInitialStart() {} 102 virtual void OnArcInitialStart() {}
99 103
100 // Called when ARC session is stopped, and is not being restarted 104 // Called when ARC session is stopped, and is not being restarted
101 // automatically. 105 // automatically.
102 virtual void OnArcSessionStopped(ArcStopReason stop_reason) {} 106 virtual void OnArcSessionStopped(ArcStopReason stop_reason) {}
103 107
104 // Called to notify that Android data has been removed. Used in 108 // Called to notify that Android data has been removed. Used in
105 // browser_tests 109 // browser_tests
106 virtual void OnArcDataRemoved() {} 110 virtual void OnArcDataRemoved() {}
107 111
112 // Called to notify that the error is requested by the session manager to be
113 // displayed in the support host. Note that this is not called in cases when
114 // the support app switches to an error page by itself.
115 virtual void OnArcShowingErrorRequested(ArcSupportHost::Error error) {}
Luis Héctor Chávez 2017/03/24 17:39:16 nit: "ARC showing error" sounds kinda weird. How a
emaxx 2017/04/11 02:09:49 Done.
116
108 protected: 117 protected:
109 virtual ~Observer() = default; 118 virtual ~Observer() = default;
110 }; 119 };
111 120
112 explicit ArcSessionManager( 121 explicit ArcSessionManager(
113 std::unique_ptr<ArcSessionRunner> arc_session_runner); 122 std::unique_ptr<ArcSessionRunner> arc_session_runner);
114 ~ArcSessionManager() override; 123 ~ArcSessionManager() override;
115 124
116 static ArcSessionManager* Get(); 125 static ArcSessionManager* Get();
117 126
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 // MaybeReenableArc() directly. 301 // MaybeReenableArc() directly.
293 void MaybeStartArcDataRemoval(); 302 void MaybeStartArcDataRemoval();
294 void OnArcDataRemoved(bool success); 303 void OnArcDataRemoved(bool success);
295 304
296 // On ARC session stopped and/or data removal completion, this is called 305 // On ARC session stopped and/or data removal completion, this is called
297 // so that, if necessary, ARC session is restarted. 306 // so that, if necessary, ARC session is restarted.
298 // TODO(hidehiko): This can be removed after the racy state machine 307 // TODO(hidehiko): This can be removed after the racy state machine
299 // is fixed. 308 // is fixed.
300 void MaybeReenableArc(); 309 void MaybeReenableArc();
301 310
311 // Requests the support host (if it exists) to show the error, and notifies
312 // the observers.
313 void ShowArcSupportHostError(ArcSupportHost::Error error,
314 bool should_show_send_feedback);
315
302 std::unique_ptr<ArcSessionRunner> arc_session_runner_; 316 std::unique_ptr<ArcSessionRunner> arc_session_runner_;
303 317
304 // Unowned pointer. Keeps current profile. 318 // Unowned pointer. Keeps current profile.
305 Profile* profile_ = nullptr; 319 Profile* profile_ = nullptr;
306 320
307 // Whether ArcSessionManager is requested to enable (starting to run ARC 321 // Whether ArcSessionManager is requested to enable (starting to run ARC
308 // instance) or not. 322 // instance) or not.
309 bool enable_requested_ = false; 323 bool enable_requested_ = false;
310 324
311 // Internal state machine. See also State enum class. 325 // Internal state machine. See also State enum class.
(...skipping 23 matching lines...) Expand all
335 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager); 349 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager);
336 }; 350 };
337 351
338 // Outputs the stringified |state| to |os|. This is only for logging purposes. 352 // Outputs the stringified |state| to |os|. This is only for logging purposes.
339 std::ostream& operator<<(std::ostream& os, 353 std::ostream& operator<<(std::ostream& os,
340 const ArcSessionManager::State& state); 354 const ArcSessionManager::State& state);
341 355
342 } // namespace arc 356 } // namespace arc
343 357
344 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ 358 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698