Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4339)

Unified Diff: chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h

Issue 2705213002: Show different error message if ARC is disabled. (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..fe28a96af4d0c252bd50a3c674679dde33e7718b 100644
--- a/chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h
+++ b/chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h
@@ -16,13 +16,21 @@ 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.
+ enum class Status {
+ SUCCESS, // The fetch was successful.
+ FAILURE, // The request failed.
+ ARC_DISABLED, // ARC is not enabled.
+ };
+
+ // Fetches the auth code or the enrollment token.
+ // On success, |callback| is called with |status| = SUCCESS and with the
+ // fetched |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(Status status, const std::string& auth_info)>;
virtual void Fetch(const FetchCallback& callback) = 0;
};

Powered by Google App Engine
This is Rietveld 408576698