| 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 <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // Implementation of ARC authorization. | 23 // Implementation of ARC authorization. |
| 24 // TODO(hidehiko): Move to c/b/c/arc/auth with adding tests. | 24 // TODO(hidehiko): Move to c/b/c/arc/auth with adding tests. |
| 25 class ArcAuthService : public ArcService, | 25 class ArcAuthService : public ArcService, |
| 26 public mojom::AuthHost, | 26 public mojom::AuthHost, |
| 27 public InstanceHolder<mojom::AuthInstance>::Observer { | 27 public InstanceHolder<mojom::AuthInstance>::Observer { |
| 28 public: | 28 public: |
| 29 explicit ArcAuthService(ArcBridgeService* bridge_service); | 29 explicit ArcAuthService(ArcBridgeService* bridge_service); |
| 30 ~ArcAuthService() override; | 30 ~ArcAuthService() override; |
| 31 | 31 |
| 32 // This is introduced to work with existing tests. | 32 // For supporting ArcServiceManager::GetService<T>(). |
| 33 // TODO(crbug.com/664095): Clean up the test and remove this method. | 33 static const char kArcServiceName[]; |
| 34 static ArcAuthService* GetForTest(); | |
| 35 | 34 |
| 36 // InstanceHolder<mojom::AuthInstance>::Observer: | 35 // InstanceHolder<mojom::AuthInstance>::Observer: |
| 37 void OnInstanceReady() override; | 36 void OnInstanceReady() override; |
| 38 void OnInstanceClosed() override; | 37 void OnInstanceClosed() override; |
| 39 | 38 |
| 40 // mojom::AuthHost: | 39 // mojom::AuthHost: |
| 41 void OnSignInComplete() override; | 40 void OnSignInComplete() override; |
| 42 void OnSignInFailed(mojom::ArcSignInFailureReason reason) override; | 41 void OnSignInFailed(mojom::ArcSignInFailureReason reason) override; |
| 43 void RequestAccountInfo() override; | 42 void RequestAccountInfo() override; |
| 44 void ReportMetrics(mojom::MetricsType metrics_type, int32_t value) override; | 43 void ReportMetrics(mojom::MetricsType metrics_type, int32_t value) override; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 std::unique_ptr<ArcFetcherBase> fetcher_; | 79 std::unique_ptr<ArcFetcherBase> fetcher_; |
| 81 | 80 |
| 82 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; | 81 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; |
| 83 | 82 |
| 84 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); | 83 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); |
| 85 }; | 84 }; |
| 86 | 85 |
| 87 } // namespace arc | 86 } // namespace arc |
| 88 | 87 |
| 89 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 88 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
| OLD | NEW |