Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 187223003: Allow content layer to pass ProtocolInterceptors when we create URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 } 1066 }
1067 1067
1068 // These are treated as WebUI schemes but do not get WebUI bindings. Also, 1068 // These are treated as WebUI schemes but do not get WebUI bindings. Also,
1069 // view-source is allowed for these schemes. 1069 // view-source is allowed for these schemes.
1070 void ChromeContentBrowserClient::GetAdditionalWebUISchemes( 1070 void ChromeContentBrowserClient::GetAdditionalWebUISchemes(
1071 std::vector<std::string>* additional_schemes) { 1071 std::vector<std::string>* additional_schemes) {
1072 additional_schemes->push_back(chrome::kChromeSearchScheme); 1072 additional_schemes->push_back(chrome::kChromeSearchScheme);
1073 additional_schemes->push_back(chrome::kDomDistillerScheme); 1073 additional_schemes->push_back(chrome::kDomDistillerScheme);
1074 } 1074 }
1075 1075
1076 net::URLRequestContextGetter* 1076 net::URLRequestContextGetter* ChromeContentBrowserClient::CreateRequestContext(
1077 ChromeContentBrowserClient::CreateRequestContext(
1078 content::BrowserContext* browser_context, 1077 content::BrowserContext* browser_context,
1079 content::ProtocolHandlerMap* protocol_handlers) { 1078 content::ProtocolHandlerMap* protocol_handlers,
1079 content::ProtocolHandlerScopedVector protocol_interceptors) {
1080 Profile* profile = Profile::FromBrowserContext(browser_context); 1080 Profile* profile = Profile::FromBrowserContext(browser_context);
1081 return profile->CreateRequestContext(protocol_handlers); 1081 return profile->CreateRequestContext(protocol_handlers,
1082 protocol_interceptors.Pass());
1082 } 1083 }
1083 1084
1084 net::URLRequestContextGetter* 1085 net::URLRequestContextGetter*
1085 ChromeContentBrowserClient::CreateRequestContextForStoragePartition( 1086 ChromeContentBrowserClient::CreateRequestContextForStoragePartition(
1086 content::BrowserContext* browser_context, 1087 content::BrowserContext* browser_context,
1087 const base::FilePath& partition_path, 1088 const base::FilePath& partition_path,
1088 bool in_memory, 1089 bool in_memory,
1089 content::ProtocolHandlerMap* protocol_handlers) { 1090 content::ProtocolHandlerMap* protocol_handlers,
1091 content::ProtocolHandlerScopedVector protocol_interceptors) {
1090 Profile* profile = Profile::FromBrowserContext(browser_context); 1092 Profile* profile = Profile::FromBrowserContext(browser_context);
1091 return profile->CreateRequestContextForStoragePartition( 1093 return profile->CreateRequestContextForStoragePartition(
1092 partition_path, in_memory, protocol_handlers); 1094 partition_path,
1095 in_memory,
1096 protocol_handlers,
1097 protocol_interceptors.Pass());
1093 } 1098 }
1094 1099
1095 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { 1100 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) {
1096 return ProfileIOData::IsHandledURL(url); 1101 return ProfileIOData::IsHandledURL(url);
1097 } 1102 }
1098 1103
1099 bool ChromeContentBrowserClient::CanCommitURL( 1104 bool ChromeContentBrowserClient::CanCommitURL(
1100 content::RenderProcessHost* process_host, 1105 content::RenderProcessHost* process_host,
1101 const GURL& url) { 1106 const GURL& url) {
1102 // We need to let most extension URLs commit in any process, since this can 1107 // We need to let most extension URLs commit in any process, since this can
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2730 switches::kDisableWebRtcEncryption, 2735 switches::kDisableWebRtcEncryption,
2731 }; 2736 };
2732 to_command_line->CopySwitchesFrom(from_command_line, 2737 to_command_line->CopySwitchesFrom(from_command_line,
2733 kWebRtcDevSwitchNames, 2738 kWebRtcDevSwitchNames,
2734 arraysize(kWebRtcDevSwitchNames)); 2739 arraysize(kWebRtcDevSwitchNames));
2735 } 2740 }
2736 } 2741 }
2737 #endif // defined(ENABLE_WEBRTC) 2742 #endif // defined(ENABLE_WEBRTC)
2738 2743
2739 } // namespace chrome 2744 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698