OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/service/cloud_print/cloud_print_url_fetcher.h" | 5 #include "chrome/service/cloud_print/cloud_print_url_fetcher.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/common/net/http_return.h" | 9 #include "chrome/common/net/http_return.h" |
10 #include "chrome/common/net/url_fetcher_protect.h" | 10 #include "chrome/common/net/url_fetcher_protect.h" |
11 #include "chrome/service/cloud_print/cloud_print_consts.h" | 11 #include "chrome/service/cloud_print/cloud_print_consts.h" |
12 #include "chrome/service/cloud_print/cloud_print_helpers.h" | 12 #include "chrome/service/cloud_print/cloud_print_helpers.h" |
13 #include "chrome/service/net/service_url_request_context.h" | 13 #include "chrome/service/net/service_url_request_context.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "net/url_request/url_request_status.h" | 15 #include "net/url_request/url_request_status.h" |
16 | 16 |
17 CloudPrintURLFetcher::CloudPrintURLFetcher() | 17 CloudPrintURLFetcher::CloudPrintURLFetcher() |
18 : protect_entry_(NULL), num_retries_(0) { | 18 : delegate_(NULL), |
| 19 protect_entry_(NULL), |
| 20 num_retries_(0) { |
19 } | 21 } |
20 | 22 |
21 void CloudPrintURLFetcher::StartGetRequest(const GURL& url, | 23 void CloudPrintURLFetcher::StartGetRequest(const GURL& url, |
22 Delegate* delegate, | 24 Delegate* delegate, |
23 const std::string& auth_token, | 25 const std::string& auth_token, |
24 const std::string& retry_policy) { | 26 const std::string& retry_policy) { |
25 StartRequestHelper(url, URLFetcher::GET, delegate, auth_token, retry_policy, | 27 StartRequestHelper(url, URLFetcher::GET, delegate, auth_token, retry_policy, |
26 std::string(), std::string()); | 28 std::string(), std::string()); |
27 } | 29 } |
28 | 30 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 URLRequestContextGetter* CloudPrintURLFetcher::GetRequestContextGetter() { | 146 URLRequestContextGetter* CloudPrintURLFetcher::GetRequestContextGetter() { |
145 ServiceURLRequestContextGetter* getter = | 147 ServiceURLRequestContextGetter* getter = |
146 new ServiceURLRequestContextGetter(); | 148 new ServiceURLRequestContextGetter(); |
147 // Now set up the user agent for cloudprint. | 149 // Now set up the user agent for cloudprint. |
148 std::string user_agent = getter->user_agent(); | 150 std::string user_agent = getter->user_agent(); |
149 StringAppendF(&user_agent, " %s", kCloudPrintUserAgent); | 151 StringAppendF(&user_agent, " %s", kCloudPrintUserAgent); |
150 getter->set_user_agent(user_agent); | 152 getter->set_user_agent(user_agent); |
151 return getter; | 153 return getter; |
152 } | 154 } |
153 | 155 |
OLD | NEW |