| 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
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0de66140e7f44791a56a30bd5d5cae713349ba17
|
| --- /dev/null
|
| +++ b/chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h
|
| @@ -0,0 +1,31 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_AUTH_INFO_FETCHER_H_
|
| +#define CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_AUTH_INFO_FETCHER_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/callback.h"
|
| +
|
| +namespace arc {
|
| +
|
| +// 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.
|
| + // 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)>;
|
| + virtual void Fetch(const FetchCallback& callback) = 0;
|
| +};
|
| +
|
| +} // namespace arc
|
| +
|
| +#endif // CHROME_BROWSER_CHROMEOS_ARC_AUTH_ARC_AUTH_INFO_FETCHER_H_
|
|
|