Chromium Code Reviews| 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_AUTH_ARC_AUTH_CODE_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_AUTH_INFO_FETCHER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_AUTH_CODE_FETCHER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_AUTH_INFO_FETCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 | 11 |
| 12 namespace arc { | 12 namespace arc { |
| 13 | 13 |
| 14 // Interface to implement auth_code fetching. | 14 // Interface to implement auth_code or enrollment token fetching. |
| 15 class ArcAuthCodeFetcher { | 15 class ArcAuthInfoFetcher { |
| 16 public: | 16 public: |
| 17 virtual ~ArcAuthCodeFetcher() = default; | 17 virtual ~ArcAuthInfoFetcher() = default; |
| 18 | 18 |
| 19 // Fetches the |auth_code|. On success, |callback| is called with the | 19 // Fetches the auth code or the enrollment token. On success, |callback| is |
| 20 // fetched |auth_code|. Otherwise, |callback| is called with empty string. | 20 // called with the fetched |auth_info|. Otherwise, |callback| is called with |
| 21 // empty string. | |
| 21 // Fetch() should be called once par instance, and it is expected that | 22 // Fetch() should be called once par instance, and it is expected that |
|
Luis Héctor Chávez
2017/01/31 18:01:09
nit: not your fault, but please s/par/per/
Marton Hunyady
2017/02/01 12:21:51
Done.
| |
| 22 // the inflight operation is cancelled without calling the |callback| | 23 // the inflight operation is cancelled without calling the |callback| |
| 23 // when the instance is deleted. | 24 // when the instance is deleted. |
| 24 using FetchCallback = base::Callback<void(const std::string& auth_code)>; | 25 using FetchCallback = base::Callback<void(const std::string& auth_info)>; |
| 25 virtual void Fetch(const FetchCallback& callback) = 0; | 26 virtual void Fetch(const FetchCallback& callback) = 0; |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 } // namespace arc | 29 } // namespace arc |
| 29 | 30 |
| 30 #endif // CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_AUTH_CODE_FETCHER_H_ | 31 #endif // CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_AUTH_INFO_FETCHER_H_ |
| OLD | NEW |