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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 #include "chrome/common/chrome_constants.h" | 102 #include "chrome/common/chrome_constants.h" |
103 #include "chrome/common/chrome_paths.h" | 103 #include "chrome/common/chrome_paths.h" |
104 #include "chrome/common/chrome_switches.h" | 104 #include "chrome/common/chrome_switches.h" |
105 #include "chrome/common/env_vars.h" | 105 #include "chrome/common/env_vars.h" |
106 #include "chrome/common/features.h" | 106 #include "chrome/common/features.h" |
107 #include "chrome/common/logging_chrome.h" | 107 #include "chrome/common/logging_chrome.h" |
108 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" | 108 #include "chrome/common/origin_trials/chrome_origin_trial_policy.h" |
109 #include "chrome/common/pepper_permission_util.h" | 109 #include "chrome/common/pepper_permission_util.h" |
110 #include "chrome/common/pref_names.h" | 110 #include "chrome/common/pref_names.h" |
111 #include "chrome/common/render_messages.h" | 111 #include "chrome/common/render_messages.h" |
| 112 #include "chrome/common/renderer_configuration.mojom.h" |
112 #include "chrome/common/secure_origin_whitelist.h" | 113 #include "chrome/common/secure_origin_whitelist.h" |
113 #include "chrome/common/stack_sampling_configuration.h" | 114 #include "chrome/common/stack_sampling_configuration.h" |
114 #include "chrome/common/url_constants.h" | 115 #include "chrome/common/url_constants.h" |
115 #include "chrome/grit/browser_resources.h" | 116 #include "chrome/grit/browser_resources.h" |
116 #include "chrome/grit/generated_resources.h" | 117 #include "chrome/grit/generated_resources.h" |
117 #include "chrome/installer/util/google_update_settings.h" | 118 #include "chrome/installer/util/google_update_settings.h" |
118 #include "chromeos/chromeos_constants.h" | 119 #include "chromeos/chromeos_constants.h" |
119 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 120 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
120 #include "components/autofill/core/common/autofill_switches.h" | 121 #include "components/autofill/core/common/autofill_switches.h" |
121 #include "components/cdm/browser/cdm_message_filter_android.h" | 122 #include "components/cdm/browser/cdm_message_filter_android.h" |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 #if !defined(DISABLE_NACL) | 1074 #if !defined(DISABLE_NACL) |
1074 host->AddFilter(new nacl::NaClHostMessageFilter( | 1075 host->AddFilter(new nacl::NaClHostMessageFilter( |
1075 id, profile->IsOffTheRecord(), | 1076 id, profile->IsOffTheRecord(), |
1076 profile->GetPath(), | 1077 profile->GetPath(), |
1077 context)); | 1078 context)); |
1078 #endif | 1079 #endif |
1079 #if defined(OS_ANDROID) | 1080 #if defined(OS_ANDROID) |
1080 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 1081 host->AddFilter(new cdm::CdmMessageFilterAndroid()); |
1081 #endif | 1082 #endif |
1082 | 1083 |
1083 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 1084 bool is_incognito_process = profile->IsOffTheRecord(); |
1084 profile->IsOffTheRecord())); | 1085 |
| 1086 chrome::mojom::RendererConfigurationAssociatedPtr rc_interface; |
| 1087 host->GetChannel()->GetRemoteAssociatedInterface(&rc_interface); |
| 1088 rc_interface->SetInitialConfiguration(is_incognito_process); |
1085 | 1089 |
1086 for (size_t i = 0; i < extra_parts_.size(); ++i) | 1090 for (size_t i = 0; i < extra_parts_.size(); ++i) |
1087 extra_parts_[i]->RenderProcessWillLaunch(host); | 1091 extra_parts_[i]->RenderProcessWillLaunch(host); |
1088 | 1092 |
1089 RendererContentSettingRules rules; | 1093 RendererContentSettingRules rules; |
1090 if (host->IsForGuestsOnly()) { | 1094 if (host->IsForGuestsOnly()) { |
1091 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1095 #if BUILDFLAG(ENABLE_EXTENSIONS) |
1092 GetGuestViewDefaultContentSettingRules(profile->IsOffTheRecord(), &rules); | 1096 GetGuestViewDefaultContentSettingRules(is_incognito_process, &rules); |
1093 #else | 1097 #else |
1094 NOTREACHED(); | 1098 NOTREACHED(); |
1095 #endif | 1099 #endif |
1096 } else { | 1100 } else { |
1097 GetRendererContentSettingRules( | 1101 GetRendererContentSettingRules( |
1098 HostContentSettingsMapFactory::GetForProfile(profile), &rules); | 1102 HostContentSettingsMapFactory::GetForProfile(profile), &rules); |
1099 } | 1103 } |
| 1104 // TODO(nigeltao): eliminate this legacy IPC. Instead, add an extra arg to |
| 1105 // the rc_interface->SetInitialConfiguration call. |
1100 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 1106 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); |
1101 } | 1107 } |
1102 | 1108 |
1103 GURL ChromeContentBrowserClient::GetEffectiveURL( | 1109 GURL ChromeContentBrowserClient::GetEffectiveURL( |
1104 content::BrowserContext* browser_context, const GURL& url) { | 1110 content::BrowserContext* browser_context, const GURL& url) { |
1105 Profile* profile = Profile::FromBrowserContext(browser_context); | 1111 Profile* profile = Profile::FromBrowserContext(browser_context); |
1106 if (!profile) | 1112 if (!profile) |
1107 return url; | 1113 return url; |
1108 | 1114 |
1109 // 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 |
(...skipping 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3319 render_frame_host, std::move(source), std::move(request)); | 3325 render_frame_host, std::move(source), std::move(request)); |
3320 #else | 3326 #else |
3321 // Chrome's media remoting implementation depends on the Media Router | 3327 // Chrome's media remoting implementation depends on the Media Router |
3322 // infrastructure to identify remote sinks and provide the user interface for | 3328 // infrastructure to identify remote sinks and provide the user interface for |
3323 // sink selection. In the case where the Media Router is not present, simply | 3329 // sink selection. In the case where the Media Router is not present, simply |
3324 // drop the interface request. This will prevent code paths for media remoting | 3330 // drop the interface request. This will prevent code paths for media remoting |
3325 // in the renderer process from activating. | 3331 // in the renderer process from activating. |
3326 #endif | 3332 #endif |
3327 } | 3333 } |
3328 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) | 3334 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) |
OLD | NEW |