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

Side by Side Diff: google_apis/gaia/oauth2_token_service_delegate.h

Issue 1380103004: Delay fetching account info until OnRefreshTokensLoaded(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 2 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 GOOGLE_APIS_GAIA_OAUTH2_TOKEN_SERVICE_DELEGATE_H_ 5 #ifndef GOOGLE_APIS_GAIA_OAUTH2_TOKEN_SERVICE_DELEGATE_H_
6 #define GOOGLE_APIS_GAIA_OAUTH2_TOKEN_SERVICE_DELEGATE_H_ 6 #define GOOGLE_APIS_GAIA_OAUTH2_TOKEN_SERVICE_DELEGATE_H_
7 7
8 #include "base/observer_list.h" 8 #include "base/observer_list.h"
9 #include "google_apis/gaia/gaia_auth_util.h" 9 #include "google_apis/gaia/gaia_auth_util.h"
10 #include "google_apis/gaia/oauth2_token_service.h" 10 #include "google_apis/gaia/oauth2_token_service.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 const std::string& refresh_token) {} 47 const std::string& refresh_token) {}
48 virtual void RevokeCredentials(const std::string& account_id) {} 48 virtual void RevokeCredentials(const std::string& account_id) {}
49 virtual net::URLRequestContextGetter* GetRequestContext() const; 49 virtual net::URLRequestContextGetter* GetRequestContext() const;
50 50
51 bool ValidateAccountId(const std::string& account_id) const; 51 bool ValidateAccountId(const std::string& account_id) const;
52 52
53 // Add or remove observers of this token service. 53 // Add or remove observers of this token service.
54 void AddObserver(OAuth2TokenService::Observer* observer); 54 void AddObserver(OAuth2TokenService::Observer* observer);
55 void RemoveObserver(OAuth2TokenService::Observer* observer); 55 void RemoveObserver(OAuth2TokenService::Observer* observer);
56 56
57 // Android uses the account name for identifying the account whereas Chrome
58 // uses the account id. This mapping needs to be seeded usage.
nyquist 2015/10/15 19:33:45 The last sentence here seems a bit off. Do you mea
59 virtual bool NeedsAccountIdNameMap() const;
60
57 protected: 61 protected:
58 // Called by subclasses to notify observers. 62 // Called by subclasses to notify observers.
59 virtual void FireRefreshTokenAvailable(const std::string& account_id); 63 virtual void FireRefreshTokenAvailable(const std::string& account_id);
60 virtual void FireRefreshTokenRevoked(const std::string& account_id); 64 virtual void FireRefreshTokenRevoked(const std::string& account_id);
61 virtual void FireRefreshTokensLoaded(); 65 virtual void FireRefreshTokensLoaded();
62 66
63 // Helper class to scope batch changes. 67 // Helper class to scope batch changes.
64 class ScopedBatchChange { 68 class ScopedBatchChange {
65 public: 69 public:
66 explicit ScopedBatchChange(OAuth2TokenServiceDelegate* delegate); 70 explicit ScopedBatchChange(OAuth2TokenServiceDelegate* delegate);
(...skipping 18 matching lines...) Expand all
85 void StartBatchChanges(); 89 void StartBatchChanges();
86 void EndBatchChanges(); 90 void EndBatchChanges();
87 91
88 // The depth of batch changes. 92 // The depth of batch changes.
89 int batch_change_depth_; 93 int batch_change_depth_;
90 94
91 DISALLOW_COPY_AND_ASSIGN(OAuth2TokenServiceDelegate); 95 DISALLOW_COPY_AND_ASSIGN(OAuth2TokenServiceDelegate);
92 }; 96 };
93 97
94 #endif // GOOGLE_APIS_GAIA_OAUTH2_TOKEN_SERVICE_DELEGATE_H_ 98 #endif // GOOGLE_APIS_GAIA_OAUTH2_TOKEN_SERVICE_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698