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

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: Fix browsertests and add a new test for 904 Arc Disabled Created 3 years, 10 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..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;
};

Powered by Google App Engine
This is Rietveld 408576698