OLD | NEW |
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_AUTH_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <ostream> | 9 #include <ostream> |
10 #include <string> | 10 #include <string> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 explicit ArcAuthService(ArcBridgeService* bridge_service); | 91 explicit ArcAuthService(ArcBridgeService* bridge_service); |
92 ~ArcAuthService() override; | 92 ~ArcAuthService() override; |
93 | 93 |
94 static ArcAuthService* Get(); | 94 static ArcAuthService* Get(); |
95 | 95 |
96 // It is called from chrome/browser/prefs/browser_prefs.cc. | 96 // It is called from chrome/browser/prefs/browser_prefs.cc. |
97 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 97 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
98 | 98 |
99 static void DisableUIForTesting(); | 99 static void DisableUIForTesting(); |
| 100 static void AllowCryptohomeDataEphemeralUserForTesting(); |
100 static void SetShelfDelegateForTesting(ash::ShelfDelegate* shelf_delegate); | 101 static void SetShelfDelegateForTesting(ash::ShelfDelegate* shelf_delegate); |
101 | 102 |
102 // Checks if OptIn verification was disabled by switch in command line. | 103 // Checks if OptIn verification was disabled by switch in command line. |
103 static bool IsOptInVerificationDisabled(); | 104 static bool IsOptInVerificationDisabled(); |
104 | 105 |
105 static void EnableCheckAndroidManagementForTesting(); | 106 static void EnableCheckAndroidManagementForTesting(); |
106 | 107 |
107 // Returns true if Arc is allowed to run for the given profile. | 108 // Returns true if Arc is allowed to run for the given profile. |
108 static bool IsAllowedForProfile(const Profile* profile); | 109 static bool IsAllowedForProfile(const Profile* profile); |
109 | 110 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 void StartLso(); | 147 void StartLso(); |
147 | 148 |
148 // Called from Arc support platform app to set auth code and start arc. | 149 // Called from Arc support platform app to set auth code and start arc. |
149 void SetAuthCodeAndStartArc(const std::string& auth_code); | 150 void SetAuthCodeAndStartArc(const std::string& auth_code); |
150 | 151 |
151 // Called from Arc support platform app when user cancels signing. | 152 // Called from Arc support platform app when user cancels signing. |
152 void CancelAuthCode(); | 153 void CancelAuthCode(); |
153 | 154 |
154 bool IsArcManaged() const; | 155 bool IsArcManaged() const; |
155 bool IsArcEnabled() const; | 156 bool IsArcEnabled() const; |
| 157 |
| 158 // This requires Arc to be allowed (|IsAllowed|)for current profile. |
156 void EnableArc(); | 159 void EnableArc(); |
157 void DisableArc(); | 160 void DisableArc(); |
158 | 161 |
159 // syncable_prefs::PrefServiceSyncableObserver | 162 // syncable_prefs::PrefServiceSyncableObserver |
160 void OnIsSyncingChanged() override; | 163 void OnIsSyncingChanged() override; |
161 | 164 |
162 // syncable_prefs::SyncedPrefObserver | 165 // syncable_prefs::SyncedPrefObserver |
163 void OnSyncedPrefChanged(const std::string& path, bool from_sync) override; | 166 void OnSyncedPrefChanged(const std::string& path, bool from_sync) override; |
164 | 167 |
165 // ArcAuthContextDelegate: | 168 // ArcAuthContextDelegate: |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; | 222 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; |
220 | 223 |
221 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); | 224 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); |
222 }; | 225 }; |
223 | 226 |
224 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); | 227 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); |
225 | 228 |
226 } // namespace arc | 229 } // namespace arc |
227 | 230 |
228 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 231 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
OLD | NEW |