| 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 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace user_prefs { | 33 namespace user_prefs { |
| 34 class PrefRegistrySyncable; | 34 class PrefRegistrySyncable; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace arc { | 37 namespace arc { |
| 38 | 38 |
| 39 class ArcAndroidManagementChecker; | 39 class ArcAndroidManagementChecker; |
| 40 class ArcAuthContext; | 40 class ArcAuthContext; |
| 41 enum class ProvisioningResult : int; |
| 41 | 42 |
| 42 // This class proxies the request from the client to fetch an auth code from | 43 // This class proxies the request from the client to fetch an auth code from |
| 43 // LSO. It lives on the UI thread. | 44 // LSO. It lives on the UI thread. |
| 44 class ArcAuthService : public ArcService, | 45 class ArcAuthService : public ArcService, |
| 45 public mojom::AuthHost, | 46 public mojom::AuthHost, |
| 46 public ArcBridgeService::Observer, | 47 public ArcBridgeService::Observer, |
| 47 public InstanceHolder<mojom::AuthInstance>::Observer, | 48 public InstanceHolder<mojom::AuthInstance>::Observer, |
| 48 public ArcAndroidManagementCheckerDelegate, | 49 public ArcAndroidManagementCheckerDelegate, |
| 49 public ArcAuthContextDelegate, | 50 public ArcAuthContextDelegate, |
| 50 public syncable_prefs::PrefServiceSyncableObserver, | 51 public syncable_prefs::PrefServiceSyncableObserver, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void GetAuthCodeDeprecated( | 139 void GetAuthCodeDeprecated( |
| 139 const GetAuthCodeDeprecatedCallback& callback) override; | 140 const GetAuthCodeDeprecatedCallback& callback) override; |
| 140 void GetAuthCode(const GetAuthCodeCallback& callback) override; | 141 void GetAuthCode(const GetAuthCodeCallback& callback) override; |
| 141 void OnSignInComplete() override; | 142 void OnSignInComplete() override; |
| 142 void OnSignInFailed(arc::mojom::ArcSignInFailureReason reason) override; | 143 void OnSignInFailed(arc::mojom::ArcSignInFailureReason reason) override; |
| 143 // Callback is called with a bool that indicates the management status of the | 144 // Callback is called with a bool that indicates the management status of the |
| 144 // user. | 145 // user. |
| 145 void GetIsAccountManaged( | 146 void GetIsAccountManaged( |
| 146 const GetIsAccountManagedCallback& callback) override; | 147 const GetIsAccountManagedCallback& callback) override; |
| 147 | 148 |
| 149 void OnSignInFailedInternal(ProvisioningResult result); |
| 150 |
| 148 // Called from Arc support platform app to start LSO. | 151 // Called from Arc support platform app to start LSO. |
| 149 void StartLso(); | 152 void StartLso(); |
| 150 | 153 |
| 151 // Called from Arc support platform app to set auth code and start arc. | 154 // Called from Arc support platform app to set auth code and start arc. |
| 152 void SetAuthCodeAndStartArc(const std::string& auth_code); | 155 void SetAuthCodeAndStartArc(const std::string& auth_code); |
| 153 | 156 |
| 154 // Called from Arc support platform app when user cancels signing. | 157 // Called from Arc support platform app when user cancels signing. |
| 155 void CancelAuthCode(); | 158 void CancelAuthCode(); |
| 156 | 159 |
| 157 bool IsArcManaged() const; | 160 bool IsArcManaged() const; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; | 229 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; |
| 227 | 230 |
| 228 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); | 231 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); |
| 229 }; | 232 }; |
| 230 | 233 |
| 231 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); | 234 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); |
| 232 | 235 |
| 233 } // namespace arc | 236 } // namespace arc |
| 234 | 237 |
| 235 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 238 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
| OLD | NEW |