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

Side by Side Diff: chrome/common/net/gaia/oauth2_api_call_flow.h

Issue 10080016: Set the authorization header when calling an API. Otherwise, no API call will succeed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | « no previous file | chrome/common/net/gaia/oauth2_api_call_flow.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_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_ 5 #ifndef CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_
6 #define CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_ 6 #define CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 enum State { 81 enum State {
82 INITIAL, 82 INITIAL,
83 API_CALL_STARTED, 83 API_CALL_STARTED,
84 API_CALL_DONE, 84 API_CALL_DONE,
85 MINT_ACCESS_TOKEN_STARTED, 85 MINT_ACCESS_TOKEN_STARTED,
86 MINT_ACCESS_TOKEN_DONE, 86 MINT_ACCESS_TOKEN_DONE,
87 ERROR_STATE 87 ERROR_STATE
88 }; 88 };
89 89
90 friend class OAuth2ApiCallFlowTest; 90 friend class OAuth2ApiCallFlowTest;
91 FRIEND_TEST_ALL_PREFIXES(OAuth2ApiCallFlowTest, CreateURLFetcher);
91 92
92 // Helper to create an instance of access token fetcher. 93 // Helper to create an instance of access token fetcher.
93 // Caller owns the returned instance. 94 // Caller owns the returned instance.
94 // Note that this is virtual since it is mocked during unit testing. 95 // Note that this is virtual since it is mocked during unit testing.
95 virtual OAuth2AccessTokenFetcher* CreateAccessTokenFetcher(); 96 virtual OAuth2AccessTokenFetcher* CreateAccessTokenFetcher();
96 97
97 // Creates an instance of URLFetcher that does not send or save cookies. 98 // Creates an instance of URLFetcher that does not send or save cookies.
98 // Template method CreateApiCallUrl is used to get the URL. 99 // Template method CreateApiCallUrl is used to get the URL.
99 // Template method CreateApiCallBody is used to get the body. 100 // Template method CreateApiCallBody is used to get the body.
100 // The URLFether's method will be GET if body is empty, POST otherwise. 101 // The URLFether's method will be GET if body is empty, POST otherwise.
(...skipping 16 matching lines...) Expand all
117 // Whether we have already tried minting an access token once. 118 // Whether we have already tried minting an access token once.
118 bool tried_mint_access_token_; 119 bool tried_mint_access_token_;
119 120
120 scoped_ptr<content::URLFetcher> url_fetcher_; 121 scoped_ptr<content::URLFetcher> url_fetcher_;
121 scoped_ptr<OAuth2AccessTokenFetcher> oauth2_access_token_fetcher_; 122 scoped_ptr<OAuth2AccessTokenFetcher> oauth2_access_token_fetcher_;
122 123
123 DISALLOW_COPY_AND_ASSIGN(OAuth2ApiCallFlow); 124 DISALLOW_COPY_AND_ASSIGN(OAuth2ApiCallFlow);
124 }; 125 };
125 126
126 #endif // CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_ 127 #endif // CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/common/net/gaia/oauth2_api_call_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698