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

Side by Side Diff: chrome/browser/signin/ubertoken_fetcher.h

Issue 131973004: Eliminate usage of PO2TS::GetPrimaryAccountID() in UbertokenFetcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile failure Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/signin/signin_manager.cc ('k') | chrome/browser/signin/ubertoken_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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SIGNIN_UBERTOKEN_FETCHER_H_ 5 #ifndef CHROME_BROWSER_SIGNIN_UBERTOKEN_FETCHER_H_
6 #define CHROME_BROWSER_SIGNIN_UBERTOKEN_FETCHER_H_ 6 #define CHROME_BROWSER_SIGNIN_UBERTOKEN_FETCHER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "google_apis/gaia/gaia_auth_consumer.h" 9 #include "google_apis/gaia/gaia_auth_consumer.h"
10 #include "google_apis/gaia/oauth2_token_service.h" 10 #include "google_apis/gaia/oauth2_token_service.h"
(...skipping 20 matching lines...) Expand all
31 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) {} 31 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) {}
32 }; 32 };
33 33
34 // Allows to retrieve an uber-auth token. 34 // Allows to retrieve an uber-auth token.
35 class UbertokenFetcher : public GaiaAuthConsumer, 35 class UbertokenFetcher : public GaiaAuthConsumer,
36 public OAuth2TokenService::Consumer { 36 public OAuth2TokenService::Consumer {
37 public: 37 public:
38 UbertokenFetcher(Profile* profile, UbertokenConsumer* consumer); 38 UbertokenFetcher(Profile* profile, UbertokenConsumer* consumer);
39 virtual ~UbertokenFetcher(); 39 virtual ~UbertokenFetcher();
40 40
41 // Start fetching the token. 41 // Start fetching the token for |account_id|.
42 void StartFetchingToken();
43 virtual void StartFetchingToken(const std::string& account_id); 42 virtual void StartFetchingToken(const std::string& account_id);
44 43
45 // Overriden from GaiaAuthConsumer 44 // Overriden from GaiaAuthConsumer
46 virtual void OnUberAuthTokenSuccess(const std::string& token) OVERRIDE; 45 virtual void OnUberAuthTokenSuccess(const std::string& token) OVERRIDE;
47 virtual void OnUberAuthTokenFailure( 46 virtual void OnUberAuthTokenFailure(
48 const GoogleServiceAuthError& error) OVERRIDE; 47 const GoogleServiceAuthError& error) OVERRIDE;
49 48
50 // Overriden from OAuth2TokenService::Consumer: 49 // Overriden from OAuth2TokenService::Consumer:
51 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, 50 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
52 const std::string& access_token, 51 const std::string& access_token,
53 const base::Time& expiration_time) OVERRIDE; 52 const base::Time& expiration_time) OVERRIDE;
54 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, 53 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
55 const GoogleServiceAuthError& error) OVERRIDE; 54 const GoogleServiceAuthError& error) OVERRIDE;
56 55
57 private: 56 private:
58 Profile* profile_; 57 Profile* profile_;
59 UbertokenConsumer* consumer_; 58 UbertokenConsumer* consumer_;
60 scoped_ptr<GaiaAuthFetcher> gaia_auth_fetcher_; 59 scoped_ptr<GaiaAuthFetcher> gaia_auth_fetcher_;
61 scoped_ptr<OAuth2TokenService::Request> access_token_request_; 60 scoped_ptr<OAuth2TokenService::Request> access_token_request_;
62 61
63 DISALLOW_COPY_AND_ASSIGN(UbertokenFetcher); 62 DISALLOW_COPY_AND_ASSIGN(UbertokenFetcher);
64 }; 63 };
65 64
66 #endif // CHROME_BROWSER_SIGNIN_UBERTOKEN_FETCHER_H_ 65 #endif // CHROME_BROWSER_SIGNIN_UBERTOKEN_FETCHER_H_
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_manager.cc ('k') | chrome/browser/signin/ubertoken_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698