Chromium Code Reviews| 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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1071 #if !defined(DISABLE_NACL) | 1072 #if !defined(DISABLE_NACL) | 
| 1072 host->AddFilter(new nacl::NaClHostMessageFilter( | 1073 host->AddFilter(new nacl::NaClHostMessageFilter( | 
| 1073 id, profile->IsOffTheRecord(), | 1074 id, profile->IsOffTheRecord(), | 
| 1074 profile->GetPath(), | 1075 profile->GetPath(), | 
| 1075 context)); | 1076 context)); | 
| 1076 #endif | 1077 #endif | 
| 1077 #if defined(OS_ANDROID) | 1078 #if defined(OS_ANDROID) | 
| 1078 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 1079 host->AddFilter(new cdm::CdmMessageFilterAndroid()); | 
| 1079 #endif | 1080 #endif | 
| 1080 | 1081 | 
| 1081 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 1082 bool is_incognito_process = profile->IsOffTheRecord(); | 
| 1082 profile->IsOffTheRecord())); | 1083 | 
| 1084 chrome::mojom::RendererAssociatedPtr renderer_interface; | |
| 1085 host->GetChannel()->GetRemoteAssociatedInterface(&renderer_interface); | |
| 1086 renderer_interface->SetInitialConfiguration(is_incognito_process); | |
| 1083 | 1087 | 
| 1084 for (size_t i = 0; i < extra_parts_.size(); ++i) | 1088 for (size_t i = 0; i < extra_parts_.size(); ++i) | 
| 1085 extra_parts_[i]->RenderProcessWillLaunch(host); | 1089 extra_parts_[i]->RenderProcessWillLaunch(host); | 
| 1086 | 1090 | 
| 1087 RendererContentSettingRules rules; | 1091 RendererContentSettingRules rules; | 
| 1088 if (host->IsForGuestsOnly()) { | 1092 if (host->IsForGuestsOnly()) { | 
| 1089 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1093 #if BUILDFLAG(ENABLE_EXTENSIONS) | 
| 1090 GetGuestViewDefaultContentSettingRules(profile->IsOffTheRecord(), &rules); | 1094 GetGuestViewDefaultContentSettingRules(profile->IsOffTheRecord(), &rules); | 
| 
 
Ken Rockot(use gerrit already)
2016/12/02 05:50:41
nit: might as well reuse is_incognito_process here
 
nigeltao1
2016/12/04 01:28:19
Done.
 
 | |
| 1091 #else | 1095 #else | 
| 1092 NOTREACHED(); | 1096 NOTREACHED(); | 
| 1093 #endif | 1097 #endif | 
| 1094 } else { | 1098 } else { | 
| 1095 GetRendererContentSettingRules( | 1099 GetRendererContentSettingRules( | 
| 1096 HostContentSettingsMapFactory::GetForProfile(profile), &rules); | 1100 HostContentSettingsMapFactory::GetForProfile(profile), &rules); | 
| 1097 } | 1101 } | 
| 1102 // TODO(nigeltao): eliminate this legacy IPC. Instead, add an extra arg to | |
| 1103 // the renderer_interface->SetInitialConfiguration call. | |
| 1098 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 1104 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 
| 1099 } | 1105 } | 
| 1100 | 1106 | 
| 1101 GURL ChromeContentBrowserClient::GetEffectiveURL( | 1107 GURL ChromeContentBrowserClient::GetEffectiveURL( | 
| 1102 content::BrowserContext* browser_context, const GURL& url) { | 1108 content::BrowserContext* browser_context, const GURL& url) { | 
| 1103 Profile* profile = Profile::FromBrowserContext(browser_context); | 1109 Profile* profile = Profile::FromBrowserContext(browser_context); | 
| 1104 if (!profile) | 1110 if (!profile) | 
| 1105 return url; | 1111 return url; | 
| 1106 | 1112 | 
| 1107 // If the input |url| should be assigned to the Instant renderer, make its | 1113 // If the input |url| should be assigned to the Instant renderer, make its | 
| (...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3314 render_frame_host, std::move(source), std::move(request)); | 3320 render_frame_host, std::move(source), std::move(request)); | 
| 3315 #else | 3321 #else | 
| 3316 // Chrome's media remoting implementation depends on the Media Router | 3322 // Chrome's media remoting implementation depends on the Media Router | 
| 3317 // infrastructure to identify remote sinks and provide the user interface for | 3323 // infrastructure to identify remote sinks and provide the user interface for | 
| 3318 // sink selection. In the case where the Media Router is not present, simply | 3324 // sink selection. In the case where the Media Router is not present, simply | 
| 3319 // drop the interface request. This will prevent code paths for media remoting | 3325 // drop the interface request. This will prevent code paths for media remoting | 
| 3320 // in the renderer process from activating. | 3326 // in the renderer process from activating. | 
| 3321 #endif | 3327 #endif | 
| 3322 } | 3328 } | 
| 3323 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) | 3329 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) | 
| OLD | NEW |