Chromium Code Reviews| Index: chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h |
| diff --git a/chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h b/chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h |
| index 0de66140e7f44791a56a30bd5d5cae713349ba17..036f7d93a63a2c42caa6d8af1872ca86cc3fc5e0 100644 |
| --- a/chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h |
| +++ b/chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h |
| @@ -11,18 +11,26 @@ |
| namespace arc { |
| +enum class ArcAuthInfoFetchStatus { |
| + SUCCESS, // The fetch was successful. |
| + FAILURE, // The request failed. |
| + ARC_DISABLED, // ARC is not enabled. |
| + SIZE, // The size of this enum; keep last. |
|
Luis Héctor Chávez
2017/02/21 19:32:11
Do you *need* the SIZE? Seems like you're only usi
Marton Hunyady
2017/02/22 16:07:54
Done. (This also means I can't forward declare it
|
| +}; |
| + |
| // Interface to implement auth_code or enrollment token fetching. |
| class ArcAuthInfoFetcher { |
| public: |
| virtual ~ArcAuthInfoFetcher() = default; |
| - // Fetches the auth code or the enrollment token. On success, |callback| is |
| - // called with the fetched |auth_info|. Otherwise, |callback| is called with |
| - // empty string. |
| + // Fetches the auth code or the enrollment token. |
| + // On success, |callback| is called with status = SUCCESS and with the fetched |
|
Luis Héctor Chávez
2017/02/21 19:32:11
nit: "|status|". Same below.
Marton Hunyady
2017/02/22 16:07:54
Done.
|
| + // |auth_info|. Otherwise, status contains the reason of the failure. |
| // Fetch() should be called once per instance, and it is expected that |
| // the inflight operation is cancelled without calling the |callback| |
| // when the instance is deleted. |
| - using FetchCallback = base::Callback<void(const std::string& auth_info)>; |
| + using FetchCallback = base::Callback<void(ArcAuthInfoFetchStatus status, |
| + const std::string& auth_info)>; |
| virtual void Fetch(const FetchCallback& callback) = 0; |
| }; |