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

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

Issue 434613003: Remove all the browser side extensions code from Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/path_service.h" 14 #include "base/path_service.h"
15 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
16 #include "base/prefs/scoped_user_pref_update.h" 16 #include "base/prefs/scoped_user_pref_update.h"
17 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "base/threading/sequenced_worker_pool.h" 19 #include "base/threading/sequenced_worker_pool.h"
20 #include "chrome/browser/browser_about_handler.h" 20 #include "chrome/browser/browser_about_handler.h"
21 #include "chrome/browser/browser_process.h" 21 #include "chrome/browser/browser_process.h"
22 #include "chrome/browser/browser_shutdown.h" 22 #include "chrome/browser/browser_shutdown.h"
23 #include "chrome/browser/browsing_data/browsing_data_helper.h" 23 #include "chrome/browser/browsing_data/browsing_data_helper.h"
24 #include "chrome/browser/browsing_data/browsing_data_remover.h" 24 #include "chrome/browser/browsing_data/browsing_data_remover.h"
25 #include "chrome/browser/character_encoding.h" 25 #include "chrome/browser/character_encoding.h"
26 #include "chrome/browser/chrome_content_browser_client_parts.h"
26 #include "chrome/browser/chrome_net_benchmarking_message_filter.h" 27 #include "chrome/browser/chrome_net_benchmarking_message_filter.h"
27 #include "chrome/browser/chrome_quota_permission_context.h" 28 #include "chrome/browser/chrome_quota_permission_context.h"
28 #include "chrome/browser/content_settings/content_settings_utils.h" 29 #include "chrome/browser/content_settings/content_settings_utils.h"
29 #include "chrome/browser/content_settings/cookie_settings.h" 30 #include "chrome/browser/content_settings/cookie_settings.h"
30 #include "chrome/browser/content_settings/host_content_settings_map.h" 31 #include "chrome/browser/content_settings/host_content_settings_map.h"
31 #include "chrome/browser/content_settings/permission_request_id.h" 32 #include "chrome/browser/content_settings/permission_request_id.h"
32 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 33 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
33 #include "chrome/browser/defaults.h" 34 #include "chrome/browser/defaults.h"
34 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" 35 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h"
35 #include "chrome/browser/download/download_prefs.h" 36 #include "chrome/browser/download/download_prefs.h"
36 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h"
37 #include "chrome/browser/geolocation/chrome_access_token_store.h" 37 #include "chrome/browser/geolocation/chrome_access_token_store.h"
38 #include "chrome/browser/geolocation/geolocation_permission_context.h" 38 #include "chrome/browser/geolocation/geolocation_permission_context.h"
39 #include "chrome/browser/geolocation/geolocation_permission_context_factory.h" 39 #include "chrome/browser/geolocation/geolocation_permission_context_factory.h"
40 #include "chrome/browser/media/cast_transport_host_filter.h" 40 #include "chrome/browser/media/cast_transport_host_filter.h"
41 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 41 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
42 #include "chrome/browser/media/midi_permission_context.h" 42 #include "chrome/browser/media/midi_permission_context.h"
43 #include "chrome/browser/media/midi_permission_context_factory.h" 43 #include "chrome/browser/media/midi_permission_context_factory.h"
44 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" 44 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
45 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" 45 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
46 #include "chrome/browser/net/chrome_net_log.h" 46 #include "chrome/browser/net/chrome_net_log.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 #if !defined(DISABLE_NACL) 210 #if !defined(DISABLE_NACL)
211 #include "components/nacl/browser/nacl_browser.h" 211 #include "components/nacl/browser/nacl_browser.h"
212 #include "components/nacl/browser/nacl_host_message_filter.h" 212 #include "components/nacl/browser/nacl_host_message_filter.h"
213 #include "components/nacl/browser/nacl_process_host.h" 213 #include "components/nacl/browser/nacl_process_host.h"
214 #include "components/nacl/common/nacl_process_type.h" 214 #include "components/nacl/common/nacl_process_type.h"
215 #include "components/nacl/common/nacl_switches.h" 215 #include "components/nacl/common/nacl_switches.h"
216 #endif 216 #endif
217 217
218 #if defined(ENABLE_EXTENSIONS) 218 #if defined(ENABLE_EXTENSIONS)
219 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h"
219 #include "chrome/browser/extensions/extension_service.h" 220 #include "chrome/browser/extensions/extension_service.h"
220 #include "chrome/browser/extensions/extension_util.h" 221 #include "chrome/browser/extensions/extension_util.h"
221 #include "chrome/browser/extensions/suggest_permission_util.h" 222 #include "chrome/browser/extensions/suggest_permission_util.h"
222 #include "chrome/browser/guest_view/guest_view_base.h" 223 #include "chrome/browser/guest_view/guest_view_base.h"
223 #include "chrome/browser/guest_view/guest_view_constants.h" 224 #include "chrome/browser/guest_view/guest_view_constants.h"
224 #include "chrome/browser/guest_view/guest_view_manager.h" 225 #include "chrome/browser/guest_view/guest_view_manager.h"
225 #include "chrome/browser/guest_view/web_view/web_view_guest.h" 226 #include "chrome/browser/guest_view/web_view/web_view_guest.h"
226 #include "chrome/browser/guest_view/web_view/web_view_permission_helper.h" 227 #include "chrome/browser/guest_view/web_view/web_view_permission_helper.h"
227 #include "chrome/browser/guest_view/web_view/web_view_renderer_state.h" 228 #include "chrome/browser/guest_view/web_view/web_view_renderer_state.h"
228 #include "extensions/common/manifest_handlers/background_info.h" 229 #include "extensions/common/manifest_handlers/background_info.h"
(...skipping 18 matching lines...) Expand all
247 using content::BrowserURLHandler; 248 using content::BrowserURLHandler;
248 using content::ChildProcessSecurityPolicy; 249 using content::ChildProcessSecurityPolicy;
249 using content::QuotaPermissionContext; 250 using content::QuotaPermissionContext;
250 using content::RenderFrameHost; 251 using content::RenderFrameHost;
251 using content::RenderViewHost; 252 using content::RenderViewHost;
252 using content::ResourceType; 253 using content::ResourceType;
253 using content::SiteInstance; 254 using content::SiteInstance;
254 using content::WebContents; 255 using content::WebContents;
255 using content::WebPreferences; 256 using content::WebPreferences;
256 using extensions::APIPermission; 257 using extensions::APIPermission;
257 using extensions::ChromeContentBrowserClientExtensionsPart;
258 using extensions::Extension; 258 using extensions::Extension;
259 using extensions::InfoMap; 259 using extensions::InfoMap;
260 using extensions::Manifest; 260 using extensions::Manifest;
261 using message_center::NotifierId; 261 using message_center::NotifierId;
262 262
263 #if defined(OS_POSIX) 263 #if defined(OS_POSIX)
264 using content::FileDescriptorInfo; 264 using content::FileDescriptorInfo;
265 #endif 265 #endif
266 266
267 #if defined(ENABLE_EXTENSIONS)
268 using extensions::ChromeContentBrowserClientExtensionsPart;
269 #endif
270
267 namespace { 271 namespace {
268 272
269 // Cached version of the locale so we can return the locale on the I/O 273 // Cached version of the locale so we can return the locale on the I/O
270 // thread. 274 // thread.
271 base::LazyInstance<std::string> g_io_thread_application_locale; 275 base::LazyInstance<std::string> g_io_thread_application_locale;
272 276
273 #if defined(ENABLE_PLUGINS) 277 #if defined(ENABLE_PLUGINS)
274 // TODO(teravest): Add renderer-side API-specific checking for these APIs so 278 // TODO(teravest): Add renderer-side API-specific checking for these APIs so
275 // that blanket permission isn't granted to all dev channel APIs for these. 279 // that blanket permission isn't granted to all dev channel APIs for these.
276 // http://crbug.com/386743 280 // http://crbug.com/386743
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]); 592 allowed_file_handle_origins_.insert(kPredefinedAllowedFileHandleOrigins[i]);
589 for (size_t i = 0; i < arraysize(kPredefinedAllowedSocketOrigins); ++i) 593 for (size_t i = 0; i < arraysize(kPredefinedAllowedSocketOrigins); ++i)
590 allowed_socket_origins_.insert(kPredefinedAllowedSocketOrigins[i]); 594 allowed_socket_origins_.insert(kPredefinedAllowedSocketOrigins[i]);
591 #endif 595 #endif
592 596
593 #if !defined(OS_ANDROID) 597 #if !defined(OS_ANDROID)
594 TtsExtensionEngine* tts_extension_engine = TtsExtensionEngine::GetInstance(); 598 TtsExtensionEngine* tts_extension_engine = TtsExtensionEngine::GetInstance();
595 TtsController::GetInstance()->SetTtsEngineDelegate(tts_extension_engine); 599 TtsController::GetInstance()->SetTtsEngineDelegate(tts_extension_engine);
596 #endif 600 #endif
597 601
602 #if defined(ENABLE_EXTENSIONS)
598 extra_parts_.push_back(new ChromeContentBrowserClientExtensionsPart); 603 extra_parts_.push_back(new ChromeContentBrowserClientExtensionsPart);
604 #endif
599 } 605 }
600 606
601 ChromeContentBrowserClient::~ChromeContentBrowserClient() { 607 ChromeContentBrowserClient::~ChromeContentBrowserClient() {
602 for (int i = static_cast<int>(extra_parts_.size()) - 1; i >= 0; --i) 608 for (int i = static_cast<int>(extra_parts_.size()) - 1; i >= 0; --i)
603 delete extra_parts_[i]; 609 delete extra_parts_[i];
604 extra_parts_.clear(); 610 extra_parts_.clear();
605 } 611 }
606 612
607 // static 613 // static
608 void ChromeContentBrowserClient::RegisterProfilePrefs( 614 void ChromeContentBrowserClient::RegisterProfilePrefs(
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 863
858 #if !defined(OS_CHROMEOS) 864 #if !defined(OS_CHROMEOS)
859 // If the input |url| should be assigned to the Signin renderer, make its 865 // If the input |url| should be assigned to the Signin renderer, make its
860 // effective URL distinct from other URLs on the signin service's domain. 866 // effective URL distinct from other URLs on the signin service's domain.
861 // Note that the signin renderer will be allowed to sign the user in to 867 // Note that the signin renderer will be allowed to sign the user in to
862 // Chrome. 868 // Chrome.
863 if (SigninManager::IsWebBasedSigninFlowURL(url)) 869 if (SigninManager::IsWebBasedSigninFlowURL(url))
864 return GetEffectiveURLForSignin(url); 870 return GetEffectiveURLForSignin(url);
865 #endif 871 #endif
866 872
873 #if defined(ENABLE_EXTENSIONS)
867 return ChromeContentBrowserClientExtensionsPart::GetEffectiveURL( 874 return ChromeContentBrowserClientExtensionsPart::GetEffectiveURL(
868 profile, url); 875 profile, url);
876 #else
877 return url;
878 #endif
869 } 879 }
870 880
871 bool ChromeContentBrowserClient::ShouldUseProcessPerSite( 881 bool ChromeContentBrowserClient::ShouldUseProcessPerSite(
872 content::BrowserContext* browser_context, const GURL& effective_url) { 882 content::BrowserContext* browser_context, const GURL& effective_url) {
873 // Non-extension, non-Instant URLs should generally use 883 // Non-extension, non-Instant URLs should generally use
874 // process-per-site-instance. Because we expect to use the effective URL, 884 // process-per-site-instance. Because we expect to use the effective URL,
875 // URLs for hosted apps (apart from bookmark apps) should have an extension 885 // URLs for hosted apps (apart from bookmark apps) should have an extension
876 // scheme by now. 886 // scheme by now.
877 887
878 Profile* profile = Profile::FromBrowserContext(browser_context); 888 Profile* profile = Profile::FromBrowserContext(browser_context);
879 if (!profile) 889 if (!profile)
880 return false; 890 return false;
881 891
882 if (chrome::ShouldUseProcessPerSiteForInstantURL(effective_url, profile)) 892 if (chrome::ShouldUseProcessPerSiteForInstantURL(effective_url, profile))
883 return true; 893 return true;
884 894
885 #if !defined(OS_CHROMEOS) 895 #if !defined(OS_CHROMEOS)
886 if (SigninManager::IsWebBasedSigninFlowURL(effective_url)) 896 if (SigninManager::IsWebBasedSigninFlowURL(effective_url))
887 return true; 897 return true;
888 #endif 898 #endif
889 899
900 #if defined(ENABLE_EXTENSIONS)
890 return ChromeContentBrowserClientExtensionsPart::ShouldUseProcessPerSite( 901 return ChromeContentBrowserClientExtensionsPart::ShouldUseProcessPerSite(
891 profile, effective_url); 902 profile, effective_url);
903 #else
904 return false;
905 #endif
892 } 906 }
893 907
894 // These are treated as WebUI schemes but do not get WebUI bindings. Also, 908 // These are treated as WebUI schemes but do not get WebUI bindings. Also,
895 // view-source is allowed for these schemes. 909 // view-source is allowed for these schemes.
896 void ChromeContentBrowserClient::GetAdditionalWebUISchemes( 910 void ChromeContentBrowserClient::GetAdditionalWebUISchemes(
897 std::vector<std::string>* additional_schemes) { 911 std::vector<std::string>* additional_schemes) {
898 additional_schemes->push_back(chrome::kChromeSearchScheme); 912 additional_schemes->push_back(chrome::kChromeSearchScheme);
899 additional_schemes->push_back(dom_distiller::kDomDistillerScheme); 913 additional_schemes->push_back(dom_distiller::kDomDistillerScheme);
900 } 914 }
901 915
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 request_interceptors.Pass()); 948 request_interceptors.Pass());
935 } 949 }
936 950
937 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) { 951 bool ChromeContentBrowserClient::IsHandledURL(const GURL& url) {
938 return ProfileIOData::IsHandledURL(url); 952 return ProfileIOData::IsHandledURL(url);
939 } 953 }
940 954
941 bool ChromeContentBrowserClient::CanCommitURL( 955 bool ChromeContentBrowserClient::CanCommitURL(
942 content::RenderProcessHost* process_host, 956 content::RenderProcessHost* process_host,
943 const GURL& url) { 957 const GURL& url) {
958 #if defined(ENABLE_EXTENSIONS)
944 return ChromeContentBrowserClientExtensionsPart::CanCommitURL( 959 return ChromeContentBrowserClientExtensionsPart::CanCommitURL(
945 process_host, url); 960 process_host, url);
961 #else
962 return true;
963 #endif
946 } 964 }
947 965
948 bool ChromeContentBrowserClient::ShouldAllowOpenURL( 966 bool ChromeContentBrowserClient::ShouldAllowOpenURL(
949 content::SiteInstance* site_instance, const GURL& url) { 967 content::SiteInstance* site_instance, const GURL& url) {
950 GURL from_url = site_instance->GetSiteURL(); 968 GURL from_url = site_instance->GetSiteURL();
951 969
970 #if defined(ENABLE_EXTENSIONS)
952 bool result; 971 bool result;
953 if (ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL( 972 if (ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL(
954 site_instance, from_url, url, &result)) 973 site_instance, from_url, url, &result))
955 return result; 974 return result;
975 #endif
956 976
957 // Do not allow chrome://chrome-signin navigate to other chrome:// URLs, since 977 // Do not allow chrome://chrome-signin navigate to other chrome:// URLs, since
958 // the signin page may host untrusted web content. 978 // the signin page may host untrusted web content.
959 if (from_url.GetOrigin().spec() == chrome::kChromeUIChromeSigninURL && 979 if (from_url.GetOrigin().spec() == chrome::kChromeUIChromeSigninURL &&
960 url.SchemeIs(content::kChromeUIScheme) && 980 url.SchemeIs(content::kChromeUIScheme) &&
961 url.host() != chrome::kChromeUIChromeSigninHost) { 981 url.host() != chrome::kChromeUIChromeSigninHost) {
962 VLOG(1) << "Blocked navigation to " << url.spec() << " from " 982 VLOG(1) << "Blocked navigation to " << url.spec() << " from "
963 << chrome::kChromeUIChromeSigninURL; 983 << chrome::kChromeUIChromeSigninURL;
964 return false; 984 return false;
965 } 985 }
(...skipping 24 matching lines...) Expand all
990 return is_instant_process && should_be_in_instant_process; 1010 return is_instant_process && should_be_in_instant_process;
991 } 1011 }
992 1012
993 #if !defined(OS_CHROMEOS) 1013 #if !defined(OS_CHROMEOS)
994 SigninClient* signin_client = 1014 SigninClient* signin_client =
995 ChromeSigninClientFactory::GetForProfile(profile); 1015 ChromeSigninClientFactory::GetForProfile(profile);
996 if (signin_client && signin_client->IsSigninProcess(process_host->GetID())) 1016 if (signin_client && signin_client->IsSigninProcess(process_host->GetID()))
997 return SigninManager::IsWebBasedSigninFlowURL(site_url); 1017 return SigninManager::IsWebBasedSigninFlowURL(site_url);
998 #endif 1018 #endif
999 1019
1020 #if defined(ENABLE_EXTENSIONS)
1000 return ChromeContentBrowserClientExtensionsPart::IsSuitableHost( 1021 return ChromeContentBrowserClientExtensionsPart::IsSuitableHost(
1001 profile, process_host, site_url); 1022 profile, process_host, site_url);
1023 #else
1024 return true;
1025 #endif
1002 } 1026 }
1003 1027
1004 bool ChromeContentBrowserClient::MayReuseHost( 1028 bool ChromeContentBrowserClient::MayReuseHost(
1005 content::RenderProcessHost* process_host) { 1029 content::RenderProcessHost* process_host) {
1006 // If there is currently a prerender in progress for the host provided, 1030 // If there is currently a prerender in progress for the host provided,
1007 // it may not be shared. We require prerenders to be by themselves in a 1031 // it may not be shared. We require prerenders to be by themselves in a
1008 // separate process, so that we can monitor their resource usage, and so that 1032 // separate process, so that we can monitor their resource usage, and so that
1009 // we can track the cookies that they change. 1033 // we can track the cookies that they change.
1010 Profile* profile = Profile::FromBrowserContext( 1034 Profile* profile = Profile::FromBrowserContext(
1011 process_host->GetBrowserContext()); 1035 process_host->GetBrowserContext());
1012 prerender::PrerenderManager* prerender_manager = 1036 prerender::PrerenderManager* prerender_manager =
1013 prerender::PrerenderManagerFactory::GetForProfile(profile); 1037 prerender::PrerenderManagerFactory::GetForProfile(profile);
1014 if (prerender_manager && 1038 if (prerender_manager &&
1015 !prerender_manager->MayReuseProcessHost(process_host)) { 1039 !prerender_manager->MayReuseProcessHost(process_host)) {
1016 return false; 1040 return false;
1017 } 1041 }
1018 1042
1019 return true; 1043 return true;
1020 } 1044 }
1021 1045
1022 bool ChromeContentBrowserClient::ShouldTryToUseExistingProcessHost( 1046 bool ChromeContentBrowserClient::ShouldTryToUseExistingProcessHost(
1023 content::BrowserContext* browser_context, const GURL& url) { 1047 content::BrowserContext* browser_context, const GURL& url) {
1024 // It has to be a valid URL for us to check for an extension. 1048 // It has to be a valid URL for us to check for an extension.
1025 if (!url.is_valid()) 1049 if (!url.is_valid())
1026 return false; 1050 return false;
1027 1051
1052 #if defined(ENABLE_EXTENSIONS)
1028 Profile* profile = Profile::FromBrowserContext(browser_context); 1053 Profile* profile = Profile::FromBrowserContext(browser_context);
1029 return ChromeContentBrowserClientExtensionsPart:: 1054 return ChromeContentBrowserClientExtensionsPart::
1030 ShouldTryToUseExistingProcessHost( 1055 ShouldTryToUseExistingProcessHost(
1031 profile, url); 1056 profile, url);
1057 #else
1058 return false;
1059 #endif
1032 } 1060 }
1033 1061
1034 void ChromeContentBrowserClient::SiteInstanceGotProcess( 1062 void ChromeContentBrowserClient::SiteInstanceGotProcess(
1035 SiteInstance* site_instance) { 1063 SiteInstance* site_instance) {
1036 CHECK(site_instance->HasProcess()); 1064 CHECK(site_instance->HasProcess());
1037 1065
1038 Profile* profile = Profile::FromBrowserContext( 1066 Profile* profile = Profile::FromBrowserContext(
1039 site_instance->GetBrowserContext()); 1067 site_instance->GetBrowserContext());
1040 if (!profile) 1068 if (!profile)
1041 return; 1069 return;
(...skipping 10 matching lines...) Expand all
1052 1080
1053 #if !defined(OS_CHROMEOS) 1081 #if !defined(OS_CHROMEOS)
1054 // We only expect there to be one signin process as we use process-per-site 1082 // We only expect there to be one signin process as we use process-per-site
1055 // for signin URLs. The signin process will be cleared from SigninManager 1083 // for signin URLs. The signin process will be cleared from SigninManager
1056 // when the renderer is destroyed. 1084 // when the renderer is destroyed.
1057 if (SigninManager::IsWebBasedSigninFlowURL(site_instance->GetSiteURL())) { 1085 if (SigninManager::IsWebBasedSigninFlowURL(site_instance->GetSiteURL())) {
1058 SigninClient* signin_client = 1086 SigninClient* signin_client =
1059 ChromeSigninClientFactory::GetForProfile(profile); 1087 ChromeSigninClientFactory::GetForProfile(profile);
1060 if (signin_client) 1088 if (signin_client)
1061 signin_client->SetSigninProcess(site_instance->GetProcess()->GetID()); 1089 signin_client->SetSigninProcess(site_instance->GetProcess()->GetID());
1090 #if defined(ENABLE_EXTENSIONS)
1062 ChromeContentBrowserClientExtensionsPart::SetSigninProcess(site_instance); 1091 ChromeContentBrowserClientExtensionsPart::SetSigninProcess(site_instance);
1092 #endif
1063 } 1093 }
1064 #endif 1094 #endif
1065 1095
1066 for (size_t i = 0; i < extra_parts_.size(); ++i) 1096 for (size_t i = 0; i < extra_parts_.size(); ++i)
1067 extra_parts_[i]->SiteInstanceGotProcess(site_instance); 1097 extra_parts_[i]->SiteInstanceGotProcess(site_instance);
1068 } 1098 }
1069 1099
1070 void ChromeContentBrowserClient::SiteInstanceDeleting( 1100 void ChromeContentBrowserClient::SiteInstanceDeleting(
1071 SiteInstance* site_instance) { 1101 SiteInstance* site_instance) {
1072 if (!site_instance->HasProcess()) 1102 if (!site_instance->HasProcess())
(...skipping 14 matching lines...) Expand all
1087 SiteInstance* site_instance, 1117 SiteInstance* site_instance,
1088 int worker_process_id) { 1118 int worker_process_id) {
1089 for (size_t i = 0; i < extra_parts_.size(); ++i) 1119 for (size_t i = 0; i < extra_parts_.size(); ++i)
1090 extra_parts_[i]->WorkerProcessTerminated(site_instance, worker_process_id); 1120 extra_parts_[i]->WorkerProcessTerminated(site_instance, worker_process_id);
1091 } 1121 }
1092 1122
1093 bool ChromeContentBrowserClient::ShouldSwapBrowsingInstancesForNavigation( 1123 bool ChromeContentBrowserClient::ShouldSwapBrowsingInstancesForNavigation(
1094 SiteInstance* site_instance, 1124 SiteInstance* site_instance,
1095 const GURL& current_url, 1125 const GURL& current_url,
1096 const GURL& new_url) { 1126 const GURL& new_url) {
1127 #if defined(ENABLE_EXTENSIONS)
1097 return ChromeContentBrowserClientExtensionsPart:: 1128 return ChromeContentBrowserClientExtensionsPart::
1098 ShouldSwapBrowsingInstancesForNavigation( 1129 ShouldSwapBrowsingInstancesForNavigation(
1099 site_instance, current_url, new_url); 1130 site_instance, current_url, new_url);
1131 #else
1132 return false;
1133 #endif
1100 } 1134 }
1101 1135
1102 bool ChromeContentBrowserClient::ShouldSwapProcessesForRedirect( 1136 bool ChromeContentBrowserClient::ShouldSwapProcessesForRedirect(
1103 content::ResourceContext* resource_context, const GURL& current_url, 1137 content::ResourceContext* resource_context, const GURL& current_url,
1104 const GURL& new_url) { 1138 const GURL& new_url) {
1105 #if defined(ENABLE_EXTENSIONS) 1139 #if defined(ENABLE_EXTENSIONS)
1106 return ChromeContentBrowserClientExtensionsPart:: 1140 return ChromeContentBrowserClientExtensionsPart::
1107 ShouldSwapProcessesForRedirect(resource_context, current_url, new_url); 1141 ShouldSwapProcessesForRedirect(resource_context, current_url, new_url);
1108 #else 1142 #else
1109 return false; 1143 return false;
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
2596 switches::kDisableWebRtcEncryption, 2630 switches::kDisableWebRtcEncryption,
2597 }; 2631 };
2598 to_command_line->CopySwitchesFrom(from_command_line, 2632 to_command_line->CopySwitchesFrom(from_command_line,
2599 kWebRtcDevSwitchNames, 2633 kWebRtcDevSwitchNames,
2600 arraysize(kWebRtcDevSwitchNames)); 2634 arraysize(kWebRtcDevSwitchNames));
2601 } 2635 }
2602 } 2636 }
2603 #endif // defined(ENABLE_WEBRTC) 2637 #endif // defined(ENABLE_WEBRTC)
2604 2638
2605 } // namespace chrome 2639 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698