OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/policy/device_management_service.h" | 5 #include "chrome/browser/policy/device_management_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/net/chrome_net_log.h" | 11 #include "chrome/browser/net/chrome_net_log.h" |
12 #include "chrome/browser/policy/device_management_backend.h" | 12 #include "chrome/browser/policy/device_management_backend.h" |
13 #include "chrome/browser/policy/device_management_backend_impl.h" | 13 #include "chrome/browser/policy/device_management_backend_impl.h" |
14 #include "content/browser/browser_thread.h" | 14 #include "content/browser/browser_thread.h" |
| 15 #include "content/common/content_client.h" |
15 #include "net/base/cookie_monster.h" | 16 #include "net/base/cookie_monster.h" |
16 #include "net/base/host_resolver.h" | 17 #include "net/base/host_resolver.h" |
17 #include "net/base/load_flags.h" | 18 #include "net/base/load_flags.h" |
18 #include "net/base/net_errors.h" | 19 #include "net/base/net_errors.h" |
19 #include "net/base/ssl_config_service_defaults.h" | 20 #include "net/base/ssl_config_service_defaults.h" |
20 #include "net/http/http_network_layer.h" | 21 #include "net/http/http_network_layer.h" |
21 #include "net/http/http_response_headers.h" | 22 #include "net/http/http_response_headers.h" |
22 #include "net/proxy/proxy_service.h" | 23 #include "net/proxy/proxy_service.h" |
23 #include "net/url_request/url_request_context.h" | 24 #include "net/url_request/url_request_context.h" |
24 #include "net/url_request/url_request_context_getter.h" | 25 #include "net/url_request/url_request_context_getter.h" |
25 #include "net/url_request/url_request_status.h" | 26 #include "net/url_request/url_request_status.h" |
26 #include "webkit/glue/webkit_glue.h" | |
27 | 27 |
28 namespace policy { | 28 namespace policy { |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 bool IsProxyError(const net::URLRequestStatus status) { | 32 bool IsProxyError(const net::URLRequestStatus status) { |
33 switch (status.error()) { | 33 switch (status.error()) { |
34 case net::ERR_PROXY_CONNECTION_FAILED: | 34 case net::ERR_PROXY_CONNECTION_FAILED: |
35 case net::ERR_TUNNEL_CONNECTION_FAILED: | 35 case net::ERR_TUNNEL_CONNECTION_FAILED: |
36 case net::ERR_PROXY_AUTH_UNSUPPORTED: | 36 case net::ERR_PROXY_AUTH_UNSUPPORTED: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 set_accept_language("*"); | 84 set_accept_language("*"); |
85 set_accept_charset("*"); | 85 set_accept_charset("*"); |
86 } | 86 } |
87 | 87 |
88 DeviceManagementRequestContext::~DeviceManagementRequestContext() { | 88 DeviceManagementRequestContext::~DeviceManagementRequestContext() { |
89 delete http_transaction_factory(); | 89 delete http_transaction_factory(); |
90 } | 90 } |
91 | 91 |
92 const std::string& DeviceManagementRequestContext::GetUserAgent( | 92 const std::string& DeviceManagementRequestContext::GetUserAgent( |
93 const GURL& url) const { | 93 const GURL& url) const { |
94 return webkit_glue::GetUserAgent(url); | 94 return content::GetUserAgent(url); |
95 } | 95 } |
96 | 96 |
97 // Request context holder. | 97 // Request context holder. |
98 class DeviceManagementRequestContextGetter | 98 class DeviceManagementRequestContextGetter |
99 : public net::URLRequestContextGetter { | 99 : public net::URLRequestContextGetter { |
100 public: | 100 public: |
101 explicit DeviceManagementRequestContextGetter( | 101 explicit DeviceManagementRequestContextGetter( |
102 net::URLRequestContextGetter* base_context_getter) | 102 net::URLRequestContextGetter* base_context_getter) |
103 : base_context_getter_(base_context_getter) {} | 103 : base_context_getter_(base_context_getter) {} |
104 | 104 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } else { | 259 } else { |
260 job->HandleResponse(status, response_code, cookies, data); | 260 job->HandleResponse(status, response_code, cookies, data); |
261 } | 261 } |
262 } else { | 262 } else { |
263 NOTREACHED() << "Callback from foreign URL fetcher"; | 263 NOTREACHED() << "Callback from foreign URL fetcher"; |
264 } | 264 } |
265 delete source; | 265 delete source; |
266 } | 266 } |
267 | 267 |
268 } // namespace policy | 268 } // namespace policy |
OLD | NEW |