| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 void GetAuthCodeDeprecated( | 136 void GetAuthCodeDeprecated( |
| 136 const GetAuthCodeDeprecatedCallback& callback) override; | 137 const GetAuthCodeDeprecatedCallback& callback) override; |
| 137 void GetAuthCode(const GetAuthCodeCallback& callback) override; | 138 void GetAuthCode(const GetAuthCodeCallback& callback) override; |
| 138 void OnSignInComplete() override; | 139 void OnSignInComplete() override; |
| 139 void OnSignInFailed(arc::mojom::ArcSignInFailureReason reason) override; | 140 void OnSignInFailed(arc::mojom::ArcSignInFailureReason reason) override; |
| 140 // Callback is called with a bool that indicates the management status of the | 141 // Callback is called with a bool that indicates the management status of the |
| 141 // user. | 142 // user. |
| 142 void GetIsAccountManaged( | 143 void GetIsAccountManaged( |
| 143 const GetIsAccountManagedCallback& callback) override; | 144 const GetIsAccountManagedCallback& callback) override; |
| 144 | 145 |
| 146 void OnSignInFailedInternal(ProvisioningResult result); |
| 147 |
| 145 // Called from Arc support platform app to start LSO. | 148 // Called from Arc support platform app to start LSO. |
| 146 void StartLso(); | 149 void StartLso(); |
| 147 | 150 |
| 148 // Called from Arc support platform app to set auth code and start arc. | 151 // Called from Arc support platform app to set auth code and start arc. |
| 149 void SetAuthCodeAndStartArc(const std::string& auth_code); | 152 void SetAuthCodeAndStartArc(const std::string& auth_code); |
| 150 | 153 |
| 151 // Called from Arc support platform app when user cancels signing. | 154 // Called from Arc support platform app when user cancels signing. |
| 152 void CancelAuthCode(); | 155 void CancelAuthCode(); |
| 153 | 156 |
| 154 bool IsArcManaged() const; | 157 bool IsArcManaged() const; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; | 224 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; |
| 222 | 225 |
| 223 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); | 226 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); |
| 224 }; | 227 }; |
| 225 | 228 |
| 226 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); | 229 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); |
| 227 | 230 |
| 228 } // namespace arc | 231 } // namespace arc |
| 229 | 232 |
| 230 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 233 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
| OLD | NEW |