OLD | NEW |
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 #include "chrome/browser/net/gaia/gaia_oauth_fetcher.h" | 5 #include "chrome/browser/net/gaia/gaia_oauth_fetcher.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 net::URLFetcher* GaiaOAuthFetcher::CreateGaiaFetcher( | 63 net::URLFetcher* GaiaOAuthFetcher::CreateGaiaFetcher( |
64 net::URLRequestContextGetter* getter, | 64 net::URLRequestContextGetter* getter, |
65 const GURL& gaia_gurl, | 65 const GURL& gaia_gurl, |
66 const std::string& body, | 66 const std::string& body, |
67 const std::string& headers, | 67 const std::string& headers, |
68 bool send_cookies, | 68 bool send_cookies, |
69 net::URLFetcherDelegate* delegate) { | 69 net::URLFetcherDelegate* delegate) { |
70 bool empty_body = body.empty(); | 70 bool empty_body = body.empty(); |
71 net::URLFetcher* result = content::URLFetcher::Create( | 71 net::URLFetcher* result = content::URLFetcher::Create( |
72 0, gaia_gurl, | 72 0, gaia_gurl, |
73 empty_body ? content::URLFetcher::GET : content::URLFetcher::POST, | 73 empty_body ? net::URLFetcher::GET : net::URLFetcher::POST, |
74 delegate); | 74 delegate); |
75 result->SetRequestContext(getter); | 75 result->SetRequestContext(getter); |
76 | 76 |
77 // The Gaia/OAuth token exchange requests do not require any cookie-based | 77 // The Gaia/OAuth token exchange requests do not require any cookie-based |
78 // identification as part of requests. We suppress sending any cookies to | 78 // identification as part of requests. We suppress sending any cookies to |
79 // maintain a separation between the user's browsing and Chrome's internal | 79 // maintain a separation between the user's browsing and Chrome's internal |
80 // services. Where such mixing is desired (prelogin, autologin | 80 // services. Where such mixing is desired (prelogin, autologin |
81 // or chromeos login), it will be done explicitly. | 81 // or chromeos login), it will be done explicitly. |
82 if (!send_cookies) | 82 if (!send_cookies) |
83 result->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES); | 83 result->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES); |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 break; | 708 break; |
709 case OAUTH2_REVOKE_TOKEN: | 709 case OAUTH2_REVOKE_TOKEN: |
710 OnOAuthRevokeTokenFetched(data, status, response_code); | 710 OnOAuthRevokeTokenFetched(data, status, response_code); |
711 break; | 711 break; |
712 } | 712 } |
713 } | 713 } |
714 | 714 |
715 bool GaiaOAuthFetcher::ShouldAutoFetch(RequestType fetch_step) { | 715 bool GaiaOAuthFetcher::ShouldAutoFetch(RequestType fetch_step) { |
716 return fetch_step <= auto_fetch_limit_; | 716 return fetch_step <= auto_fetch_limit_; |
717 } | 717 } |
OLD | NEW |