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

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

Issue 2567083002: Migrate ArcBridgeService::Observer and ArcSession::Observer. (Closed)
Patch Set: rebase Created 4 years 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_session_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
16 #include "chrome/browser/chromeos/arc/arc_support_host.h" 16 #include "chrome/browser/chromeos/arc/arc_support_host.h"
17 #include "chrome/browser/chromeos/policy/android_management_client.h" 17 #include "chrome/browser/chromeos/policy/android_management_client.h"
18 #include "components/arc/arc_bridge_service.h"
19 #include "components/arc/arc_service.h" 18 #include "components/arc/arc_service.h"
19 #include "components/arc/arc_session_observer.h"
20 #include "components/prefs/pref_change_registrar.h" 20 #include "components/prefs/pref_change_registrar.h"
21 #include "components/sync_preferences/pref_service_syncable_observer.h" 21 #include "components/sync_preferences/pref_service_syncable_observer.h"
22 #include "components/sync_preferences/synced_pref_observer.h" 22 #include "components/sync_preferences/synced_pref_observer.h"
23 #include "mojo/public/cpp/bindings/binding.h" 23 #include "mojo/public/cpp/bindings/binding.h"
24 24
25 class ArcAppLauncher; 25 class ArcAppLauncher;
26 class Profile; 26 class Profile;
27 27
28 namespace ash { 28 namespace ash {
29 class ShelfDelegate; 29 class ShelfDelegate;
30 } 30 }
31 31
32 namespace user_prefs { 32 namespace user_prefs {
33 class PrefRegistrySyncable; 33 class PrefRegistrySyncable;
34 } 34 }
35 35
36 namespace arc { 36 namespace arc {
37 37
38 class ArcAndroidManagementChecker; 38 class ArcAndroidManagementChecker;
39 class ArcAuthCodeFetcher; 39 class ArcAuthCodeFetcher;
40 class ArcAuthContext; 40 class ArcAuthContext;
41 class ArcBridgeService;
41 class ArcTermsOfServiceNegotiator; 42 class ArcTermsOfServiceNegotiator;
42 enum class ProvisioningResult : int; 43 enum class ProvisioningResult : int;
43 44
44 // This class proxies the request from the client to fetch an auth code from 45 // This class proxies the request from the client to fetch an auth code from
45 // LSO. It lives on the UI thread. 46 // LSO. It lives on the UI thread.
46 class ArcSessionManager : public ArcService, 47 class ArcSessionManager : public ArcService,
47 public ArcBridgeService::Observer, 48 public ArcSessionObserver,
48 public ArcSupportHost::Observer, 49 public ArcSupportHost::Observer,
49 public sync_preferences::PrefServiceSyncableObserver, 50 public sync_preferences::PrefServiceSyncableObserver,
50 public sync_preferences::SyncedPrefObserver { 51 public sync_preferences::SyncedPrefObserver {
51 public: 52 public:
52 // Represents each State of ARC session. 53 // Represents each State of ARC session.
53 // NOT_INITIALIZED: represents the state that the Profile is not yet ready 54 // NOT_INITIALIZED: represents the state that the Profile is not yet ready
54 // so that this service is not yet initialized, or Chrome is being shut 55 // so that this service is not yet initialized, or Chrome is being shut
55 // down so that this is destroyed. 56 // down so that this is destroyed.
56 // STOPPED: ARC session is not running, or being terminated. 57 // STOPPED: ARC session is not running, or being terminated.
57 // SHOWING_TERMS_OF_SERVICE: "Terms Of Service" page is shown on ARC support 58 // SHOWING_TERMS_OF_SERVICE: "Terms Of Service" page is shown on ARC support
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 147
147 Profile* profile() { return profile_; } 148 Profile* profile() { return profile_; }
148 const Profile* profile() const { return profile_; } 149 const Profile* profile() const { return profile_; }
149 150
150 State state() const { return state_; } 151 State state() const { return state_; }
151 152
152 // Adds or removes observers. 153 // Adds or removes observers.
153 void AddObserver(Observer* observer); 154 void AddObserver(Observer* observer);
154 void RemoveObserver(Observer* observer); 155 void RemoveObserver(Observer* observer);
155 156
156 // ArcBridgeService::Observer: 157 // ArcSessionObserver:
157 void OnBridgeStopped(ArcBridgeService::StopReason reason) override; 158 void OnSessionStopped(StopReason reason) override;
158 159
159 // Called from Arc support platform app when user cancels signing. 160 // Called from Arc support platform app when user cancels signing.
160 void CancelAuthCode(); 161 void CancelAuthCode();
161 162
162 bool IsArcManaged() const; 163 bool IsArcManaged() const;
163 bool IsArcEnabled() const; 164 bool IsArcEnabled() const;
164 165
165 // This requires Arc to be allowed (|IsAllowed|)for current profile. 166 // This requires Arc to be allowed (|IsAllowed|)for current profile.
166 void EnableArc(); 167 void EnableArc();
167 void DisableArc(); 168 void DisableArc();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager); 264 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager);
264 }; 265 };
265 266
266 // Outputs the stringified |state| to |os|. This is only for logging purposes. 267 // Outputs the stringified |state| to |os|. This is only for logging purposes.
267 std::ostream& operator<<(std::ostream& os, 268 std::ostream& operator<<(std::ostream& os,
268 const ArcSessionManager::State& state); 269 const ArcSessionManager::State& state);
269 270
270 } // namespace arc 271 } // namespace arc
271 272
272 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ 273 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698