OLD | NEW |
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 <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #include "chrome/common/chrome_constants.h" | 101 #include "chrome/common/chrome_constants.h" |
102 #include "chrome/common/chrome_paths.h" | 102 #include "chrome/common/chrome_paths.h" |
103 #include "chrome/common/chrome_switches.h" | 103 #include "chrome/common/chrome_switches.h" |
104 #include "chrome/common/env_vars.h" | 104 #include "chrome/common/env_vars.h" |
105 #include "chrome/common/features.h" | 105 #include "chrome/common/features.h" |
106 #include "chrome/common/logging_chrome.h" | 106 #include "chrome/common/logging_chrome.h" |
107 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" | 107 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" |
108 #include "chrome/common/pepper_permission_util.h" | 108 #include "chrome/common/pepper_permission_util.h" |
109 #include "chrome/common/pref_names.h" | 109 #include "chrome/common/pref_names.h" |
110 #include "chrome/common/render_messages.h" | 110 #include "chrome/common/render_messages.h" |
| 111 #include "chrome/common/renderer.mojom.h" |
111 #include "chrome/common/secure_origin_whitelist.h" | 112 #include "chrome/common/secure_origin_whitelist.h" |
112 #include "chrome/common/stack_sampling_configuration.h" | 113 #include "chrome/common/stack_sampling_configuration.h" |
113 #include "chrome/common/url_constants.h" | 114 #include "chrome/common/url_constants.h" |
114 #include "chrome/grit/browser_resources.h" | 115 #include "chrome/grit/browser_resources.h" |
115 #include "chrome/grit/generated_resources.h" | 116 #include "chrome/grit/generated_resources.h" |
116 #include "chrome/installer/util/google_update_settings.h" | 117 #include "chrome/installer/util/google_update_settings.h" |
117 #include "chromeos/chromeos_constants.h" | 118 #include "chromeos/chromeos_constants.h" |
118 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 119 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
119 #include "components/autofill/core/common/autofill_switches.h" | 120 #include "components/autofill/core/common/autofill_switches.h" |
120 #include "components/cdm/browser/cdm_message_filter_android.h" | 121 #include "components/cdm/browser/cdm_message_filter_android.h" |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 #if !defined(DISABLE_NACL) | 1071 #if !defined(DISABLE_NACL) |
1071 host->AddFilter(new nacl::NaClHostMessageFilter( | 1072 host->AddFilter(new nacl::NaClHostMessageFilter( |
1072 id, profile->IsOffTheRecord(), | 1073 id, profile->IsOffTheRecord(), |
1073 profile->GetPath(), | 1074 profile->GetPath(), |
1074 context)); | 1075 context)); |
1075 #endif | 1076 #endif |
1076 #if defined(OS_ANDROID) | 1077 #if defined(OS_ANDROID) |
1077 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 1078 host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
1078 #endif | 1079 #endif |
1079 | 1080 |
1080 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 1081 chrome::mojom::InitialConfigurationParamsPtr ic_params = |
1081 profile->IsOffTheRecord())); | 1082 chrome::mojom::InitialConfigurationParams::New(); |
| 1083 ic_params->is_incognito_process = profile->IsOffTheRecord(); |
1082 | 1084 |
1083 for (size_t i = 0; i < extra_parts_.size(); ++i) | 1085 for (size_t i = 0; i < extra_parts_.size(); ++i) |
1084 extra_parts_[i]->RenderProcessWillLaunch(host); | 1086 extra_parts_[i]->RenderProcessWillLaunch(host); |
1085 | 1087 |
1086 RendererContentSettingRules rules; | 1088 RendererContentSettingRules rules; |
1087 if (host->IsForGuestsOnly()) { | 1089 if (host->IsForGuestsOnly()) { |
1088 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1090 #if BUILDFLAG(ENABLE_EXTENSIONS) |
1089 GetGuestViewDefaultContentSettingRules(profile->IsOffTheRecord(), &rules); | 1091 GetGuestViewDefaultContentSettingRules(profile->IsOffTheRecord(), &rules); |
1090 #else | 1092 #else |
1091 NOTREACHED(); | 1093 NOTREACHED(); |
1092 #endif | 1094 #endif |
1093 } else { | 1095 } else { |
1094 GetRendererContentSettingRules( | 1096 GetRendererContentSettingRules( |
1095 HostContentSettingsMapFactory::GetForProfile(profile), &rules); | 1097 HostContentSettingsMapFactory::GetForProfile(profile), &rules); |
1096 } | 1098 } |
| 1099 |
| 1100 // TODO(nigeltao): eliminate this legacy IPC. Instead, define new fields for |
| 1101 // chrome::mojom::InitialConfigurationParams and populate ic_params here. |
1097 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 1102 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); |
| 1103 |
| 1104 chrome::mojom::RendererAssociatedPtr renderer_interface; |
| 1105 host->GetChannel()->GetRemoteAssociatedInterface(&renderer_interface); |
| 1106 renderer_interface->InitialConfiguration(std::move(ic_params)); |
1098 } | 1107 } |
1099 | 1108 |
1100 GURL ChromeContentBrowserClient::GetEffectiveURL( | 1109 GURL ChromeContentBrowserClient::GetEffectiveURL( |
1101 content::BrowserContext* browser_context, const GURL& url) { | 1110 content::BrowserContext* browser_context, const GURL& url) { |
1102 Profile* profile = Profile::FromBrowserContext(browser_context); | 1111 Profile* profile = Profile::FromBrowserContext(browser_context); |
1103 if (!profile) | 1112 if (!profile) |
1104 return url; | 1113 return url; |
1105 | 1114 |
1106 // If the input |url| should be assigned to the Instant renderer, make its | 1115 // If the input |url| should be assigned to the Instant renderer, make its |
1107 // effective URL distinct from other URLs on the search provider's domain. | 1116 // effective URL distinct from other URLs on the search provider's domain. |
(...skipping 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3299 render_frame_host, std::move(source), std::move(request)); | 3308 render_frame_host, std::move(source), std::move(request)); |
3300 #else | 3309 #else |
3301 // Chrome's media remoting implementation depends on the Media Router | 3310 // Chrome's media remoting implementation depends on the Media Router |
3302 // infrastructure to identify remote sinks and provide the user interface for | 3311 // infrastructure to identify remote sinks and provide the user interface for |
3303 // sink selection. In the case where the Media Router is not present, simply | 3312 // sink selection. In the case where the Media Router is not present, simply |
3304 // drop the interface request. This will prevent code paths for media remoting | 3313 // drop the interface request. This will prevent code paths for media remoting |
3305 // in the renderer process from activating. | 3314 // in the renderer process from activating. |
3306 #endif | 3315 #endif |
3307 } | 3316 } |
3308 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) | 3317 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) |
OLD | NEW |