Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 6 #define CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 const base::Time& expiration); | 103 const base::Time& expiration); |
| 104 | 104 |
| 105 void IssueErrorForAllPendingRequests(const GoogleServiceAuthError& error); | 105 void IssueErrorForAllPendingRequests(const GoogleServiceAuthError& error); |
| 106 | 106 |
| 107 void set_auto_post_fetch_response_on_message_loop(bool auto_post_response) { | 107 void set_auto_post_fetch_response_on_message_loop(bool auto_post_response) { |
| 108 auto_post_fetch_response_on_message_loop_ = auto_post_response; | 108 auto_post_fetch_response_on_message_loop_ = auto_post_response; |
| 109 } | 109 } |
| 110 | 110 |
| 111 // Helper function to be used with | 111 // Helper function to be used with |
| 112 // BrowserContextKeyedService::SetTestingFactory(). | 112 // BrowserContextKeyedService::SetTestingFactory(). |
| 113 static BrowserContextKeyedService* Build(content::BrowserContext* profile); | 113 static BrowserContextKeyedService* Build(content::BrowserContext* context); |
|
blundell
2014/02/10 16:19:16
These functions should move to be on the FakePO2TS
Roger Tawa OOO till Jul 10th
2014/02/10 19:49:13
Probably makes sense to do it as part of this CL,
blundell
2014/02/13 16:07:06
Done.
| |
| 114 | 114 |
| 115 // Helper function to be used with | 115 // Helper function to be used with |
| 116 // BrowserContextKeyedService::SetTestingFactory() that creates a | 116 // BrowserContextKeyedService::SetTestingFactory() that creates a |
| 117 // FakeProfileOAuth2TokenService object that posts fetch responses on the | 117 // FakeProfileOAuth2TokenService object that posts fetch responses on the |
| 118 // current message loop. | 118 // current message loop. |
| 119 static BrowserContextKeyedService* BuildAutoIssuingTokenService( | 119 static BrowserContextKeyedService* BuildAutoIssuingTokenService( |
| 120 content::BrowserContext* profile); | 120 content::BrowserContext* context); |
| 121 | 121 |
| 122 protected: | 122 protected: |
| 123 // OAuth2TokenService overrides. | 123 // OAuth2TokenService overrides. |
| 124 virtual void FetchOAuth2Token(RequestImpl* request, | 124 virtual void FetchOAuth2Token(RequestImpl* request, |
| 125 const std::string& account_id, | 125 const std::string& account_id, |
| 126 net::URLRequestContextGetter* getter, | 126 net::URLRequestContextGetter* getter, |
| 127 const std::string& client_id, | 127 const std::string& client_id, |
| 128 const std::string& client_secret, | 128 const std::string& client_secret, |
| 129 const ScopeSet& scopes) OVERRIDE; | 129 const ScopeSet& scopes) OVERRIDE; |
| 130 | 130 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 155 | 155 |
| 156 // If true, then this fake service will post responses to | 156 // If true, then this fake service will post responses to |
| 157 // |FetchOAuth2Token| on the current run loop. There is no need to call | 157 // |FetchOAuth2Token| on the current run loop. There is no need to call |
| 158 // |IssueTokenForScope| in this case. | 158 // |IssueTokenForScope| in this case. |
| 159 bool auto_post_fetch_response_on_message_loop_; | 159 bool auto_post_fetch_response_on_message_loop_; |
| 160 | 160 |
| 161 DISALLOW_COPY_AND_ASSIGN(FakeProfileOAuth2TokenService); | 161 DISALLOW_COPY_AND_ASSIGN(FakeProfileOAuth2TokenService); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 #endif // CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 164 #endif // CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| OLD | NEW |