OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_extensions_network_delegate.h" | 5 #include "chrome/browser/net/chrome_extensions_network_delegate.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "extensions/features/features.h" |
10 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
11 | 12 |
12 #if defined(ENABLE_EXTENSIONS) | 13 #if BUILDFLAG(ENABLE_EXTENSIONS) |
13 #include "base/debug/alias.h" | 14 #include "base/debug/alias.h" |
14 #include "base/debug/dump_without_crashing.h" | 15 #include "base/debug/dump_without_crashing.h" |
15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
16 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/extensions/api/proxy/proxy_api.h" | 18 #include "chrome/browser/extensions/api/proxy/proxy_api.h" |
18 #include "chrome/browser/extensions/event_router_forwarder.h" | 19 #include "chrome/browser/extensions/event_router_forwarder.h" |
19 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
20 #include "chrome/browser/renderer_host/chrome_navigation_ui_data.h" | 21 #include "chrome/browser/renderer_host/chrome_navigation_ui_data.h" |
21 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
22 #include "content/public/browser/child_process_security_policy.h" | 23 #include "content/public/browser/child_process_security_policy.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 const net::AuthChallengeInfo& auth_info, | 307 const net::AuthChallengeInfo& auth_info, |
307 const AuthCallback& callback, | 308 const AuthCallback& callback, |
308 net::AuthCredentials* credentials) { | 309 net::AuthCredentials* credentials) { |
309 return ExtensionWebRequestEventRouter::GetInstance()->OnAuthRequired( | 310 return ExtensionWebRequestEventRouter::GetInstance()->OnAuthRequired( |
310 profile_, extension_info_map_.get(), request, auth_info, callback, | 311 profile_, extension_info_map_.get(), request, auth_info, callback, |
311 credentials); | 312 credentials); |
312 } | 313 } |
313 | 314 |
314 } // namespace | 315 } // namespace |
315 | 316 |
316 #endif // defined(ENABLE_EXTENSIONS) | 317 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
317 | 318 |
318 // static | 319 // static |
319 ChromeExtensionsNetworkDelegate* ChromeExtensionsNetworkDelegate::Create( | 320 ChromeExtensionsNetworkDelegate* ChromeExtensionsNetworkDelegate::Create( |
320 extensions::EventRouterForwarder* event_router) { | 321 extensions::EventRouterForwarder* event_router) { |
321 #if defined(ENABLE_EXTENSIONS) | 322 #if BUILDFLAG(ENABLE_EXTENSIONS) |
322 return new ChromeExtensionsNetworkDelegateImpl(event_router); | 323 return new ChromeExtensionsNetworkDelegateImpl(event_router); |
323 #else | 324 #else |
324 return new ChromeExtensionsNetworkDelegate(); | 325 return new ChromeExtensionsNetworkDelegate(); |
325 #endif | 326 #endif |
326 } | 327 } |
327 | 328 |
328 ChromeExtensionsNetworkDelegate::ChromeExtensionsNetworkDelegate() | 329 ChromeExtensionsNetworkDelegate::ChromeExtensionsNetworkDelegate() |
329 : profile_(NULL) { | 330 : profile_(NULL) { |
330 } | 331 } |
331 | 332 |
332 ChromeExtensionsNetworkDelegate::~ChromeExtensionsNetworkDelegate() {} | 333 ChromeExtensionsNetworkDelegate::~ChromeExtensionsNetworkDelegate() {} |
333 | 334 |
334 void ChromeExtensionsNetworkDelegate::set_extension_info_map( | 335 void ChromeExtensionsNetworkDelegate::set_extension_info_map( |
335 extensions::InfoMap* extension_info_map) { | 336 extensions::InfoMap* extension_info_map) { |
336 #if defined(ENABLE_EXTENSIONS) | 337 #if BUILDFLAG(ENABLE_EXTENSIONS) |
337 extension_info_map_ = extension_info_map; | 338 extension_info_map_ = extension_info_map; |
338 #endif | 339 #endif |
339 } | 340 } |
340 | 341 |
341 void ChromeExtensionsNetworkDelegate::ForwardProxyErrors( | 342 void ChromeExtensionsNetworkDelegate::ForwardProxyErrors( |
342 net::URLRequest* request, | 343 net::URLRequest* request, |
343 int net_error) {} | 344 int net_error) {} |
344 | 345 |
345 void ChromeExtensionsNetworkDelegate::ForwardStartRequestStatus( | 346 void ChromeExtensionsNetworkDelegate::ForwardStartRequestStatus( |
346 net::URLRequest* request) { | 347 net::URLRequest* request) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } | 401 } |
401 | 402 |
402 net::NetworkDelegate::AuthRequiredResponse | 403 net::NetworkDelegate::AuthRequiredResponse |
403 ChromeExtensionsNetworkDelegate::OnAuthRequired( | 404 ChromeExtensionsNetworkDelegate::OnAuthRequired( |
404 net::URLRequest* request, | 405 net::URLRequest* request, |
405 const net::AuthChallengeInfo& auth_info, | 406 const net::AuthChallengeInfo& auth_info, |
406 const AuthCallback& callback, | 407 const AuthCallback& callback, |
407 net::AuthCredentials* credentials) { | 408 net::AuthCredentials* credentials) { |
408 return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; | 409 return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; |
409 } | 410 } |
OLD | NEW |