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

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_code_fetcher.h

Issue 2320813002: arc: Enable silent PlayStore Sign-In. (Closed)
Patch Set: nits Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/arc/arc_auth_code_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CODE_FETCHER_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CODE_FETCHER_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "google_apis/gaia/oauth2_token_service.h"
13 #include "net/url_request/url_fetcher_delegate.h"
14
15 class Profile;
16
17 namespace net {
18 class URLFetcher;
19 class URLRequestContextGetter;
20 }
21
22 namespace arc {
23
24 class ArcAuthCodeFetcherDelegate;
25
26 class ArcAuthCodeFetcher : public OAuth2TokenService::Consumer,
27 public net::URLFetcherDelegate {
28 public:
29 ArcAuthCodeFetcher(ArcAuthCodeFetcherDelegate* delegate,
30 net::URLRequestContextGetter* request_context_getter,
31 Profile* profile,
32 const std::string& auth_endpoint);
33 ~ArcAuthCodeFetcher() override;
34
35 // OAuth2TokenService::Consumer:
36 void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
37 const std::string& access_token,
38 const base::Time& expiration_time) override;
39 void OnGetTokenFailure(const OAuth2TokenService::Request* request,
40 const GoogleServiceAuthError& error) override;
41
42 // net::URLFetcherDelegate:
43 void OnURLFetchComplete(const net::URLFetcher* source) override;
44
45 private:
46 void ResetFetchers();
47
48 // Unowned pointers.
49 ArcAuthCodeFetcherDelegate* const delegate_;
50 net::URLRequestContextGetter* const request_context_getter_;
51 Profile* const profile_;
52
53 // URL to request auth code.
54 const std::string auth_endpoint_;
55
56 std::unique_ptr<OAuth2TokenService::Request> login_token_request_;
57 std::unique_ptr<net::URLFetcher> auth_code_fetcher_;
58
59 DISALLOW_COPY_AND_ASSIGN(ArcAuthCodeFetcher);
60 };
61
62 } // namespace arc
63
64 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CODE_FETCHER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/arc/arc_auth_code_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698