| 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/net/chrome_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 9 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 9 #include "chrome/browser/extensions/extension_event_router_forwarder.h" |
| 10 #include "chrome/browser/extensions/extension_info_map.h" | 10 #include "chrome/browser/extensions/extension_info_map.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 // If the |request| failed due to problems with a proxy, forward the error to | 30 // If the |request| failed due to problems with a proxy, forward the error to |
| 31 // the proxy extension API. | 31 // the proxy extension API. |
| 32 void ForwardProxyErrors(net::URLRequest* request, | 32 void ForwardProxyErrors(net::URLRequest* request, |
| 33 ExtensionEventRouterForwarder* event_router, | 33 ExtensionEventRouterForwarder* event_router, |
| 34 void* profile) { | 34 void* profile) { |
| 35 if (request->status().status() == net::URLRequestStatus::FAILED) { | 35 if (request->status().status() == net::URLRequestStatus::FAILED) { |
| 36 switch (request->status().os_error()) { | 36 switch (request->status().error()) { |
| 37 case net::ERR_PROXY_AUTH_UNSUPPORTED: | 37 case net::ERR_PROXY_AUTH_UNSUPPORTED: |
| 38 case net::ERR_PROXY_CONNECTION_FAILED: | 38 case net::ERR_PROXY_CONNECTION_FAILED: |
| 39 case net::ERR_TUNNEL_CONNECTION_FAILED: | 39 case net::ERR_TUNNEL_CONNECTION_FAILED: |
| 40 ExtensionProxyEventRouter::GetInstance()->OnProxyError( | 40 ExtensionProxyEventRouter::GetInstance()->OnProxyError( |
| 41 event_router, profile, request->status().os_error()); | 41 event_router, profile, request->status().error()); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 ChromeNetworkDelegate::ChromeNetworkDelegate( | 48 ChromeNetworkDelegate::ChromeNetworkDelegate( |
| 49 ExtensionEventRouterForwarder* event_router, | 49 ExtensionEventRouterForwarder* event_router, |
| 50 ExtensionInfoMap* extension_info_map, | 50 ExtensionInfoMap* extension_info_map, |
| 51 const policy::URLBlacklistManager* url_blacklist_manager, | 51 const policy::URLBlacklistManager* url_blacklist_manager, |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 ExtensionProxyEventRouter::GetInstance()->OnPACScriptError( | 159 ExtensionProxyEventRouter::GetInstance()->OnPACScriptError( |
| 160 event_router_.get(), profile_, line_number, error); | 160 event_router_.get(), profile_, line_number, error); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void ChromeNetworkDelegate::OnAuthRequired( | 163 void ChromeNetworkDelegate::OnAuthRequired( |
| 164 net::URLRequest* request, | 164 net::URLRequest* request, |
| 165 const net::AuthChallengeInfo& auth_info) { | 165 const net::AuthChallengeInfo& auth_info) { |
| 166 ExtensionWebRequestEventRouter::GetInstance()->OnAuthRequired( | 166 ExtensionWebRequestEventRouter::GetInstance()->OnAuthRequired( |
| 167 profile_, extension_info_map_.get(), request, auth_info); | 167 profile_, extension_info_map_.get(), request, auth_info); |
| 168 } | 168 } |
| OLD | NEW |