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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 23842002: Whitelisting exts and plugins from cross-site document blocking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 7 years, 3 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
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/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #include "chrome/renderer/safe_browsing/malware_dom_details.h" 59 #include "chrome/renderer/safe_browsing/malware_dom_details.h"
60 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" 60 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h"
61 #include "chrome/renderer/searchbox/searchbox.h" 61 #include "chrome/renderer/searchbox/searchbox.h"
62 #include "chrome/renderer/searchbox/searchbox_extension.h" 62 #include "chrome/renderer/searchbox/searchbox_extension.h"
63 #include "chrome/renderer/tts_dispatcher.h" 63 #include "chrome/renderer/tts_dispatcher.h"
64 #include "chrome/renderer/validation_message_agent.h" 64 #include "chrome/renderer/validation_message_agent.h"
65 #include "components/autofill/content/renderer/autofill_agent.h" 65 #include "components/autofill/content/renderer/autofill_agent.h"
66 #include "components/autofill/content/renderer/password_autofill_agent.h" 66 #include "components/autofill/content/renderer/password_autofill_agent.h"
67 #include "components/autofill/content/renderer/password_generation_manager.h" 67 #include "components/autofill/content/renderer/password_generation_manager.h"
68 #include "components/visitedlink/renderer/visitedlink_slave.h" 68 #include "components/visitedlink/renderer/visitedlink_slave.h"
69 #include "content/child/site_isolation_policy.h"
Charlie Reis 2013/09/03 16:43:23 Yeah, we can only include things from content/publ
dsjang 2013/09/03 19:13:11 Done.
69 #include "content/public/common/content_constants.h" 70 #include "content/public/common/content_constants.h"
70 #include "content/public/renderer/render_thread.h" 71 #include "content/public/renderer/render_thread.h"
71 #include "content/public/renderer/render_view.h" 72 #include "content/public/renderer/render_view.h"
72 #include "content/public/renderer/render_view_visitor.h" 73 #include "content/public/renderer/render_view_visitor.h"
73 #include "extensions/common/constants.h" 74 #include "extensions/common/constants.h"
74 #include "grit/generated_resources.h" 75 #include "grit/generated_resources.h"
75 #include "grit/locale_settings.h" 76 #include "grit/locale_settings.h"
76 #include "grit/renderer_resources.h" 77 #include "grit/renderer_resources.h"
77 #include "ipc/ipc_sync_channel.h" 78 #include "ipc/ipc_sync_channel.h"
78 #include "net/base/net_errors.h" 79 #include "net/base/net_errors.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 339
339 // chrome-extension: resources should bypass Content Security Policy checks 340 // chrome-extension: resources should bypass Content Security Policy checks
340 // when included in protected resources. 341 // when included in protected resources.
341 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( 342 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy(
342 extension_scheme); 343 extension_scheme);
343 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( 344 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy(
344 extension_resource_scheme); 345 extension_resource_scheme);
345 346
346 extensions::ExtensionsClient::Set( 347 extensions::ExtensionsClient::Set(
347 extensions::ChromeExtensionsClient::GetInstance()); 348 extensions::ChromeExtensionsClient::GetInstance());
349
350 // SiteIsolationPolicy is off by default. We only activate the cross-site
351 // document blocking (for UMA data collection) for normal renderer processes
352 // running an normal web page.
353
354 const std::string process_type =
355 command_line->GetSwitchValueASCII(switches::kProcessType);
356
357 // We only turn on SiteIsolationPolicy for a renderer process without having
358 // the extension flag on.
359 content::SiteIsolationPolicy::SetPolicyActivationFlag(
360 process_type == switches::kRendererProcess &&
Charlie Reis 2013/09/03 16:43:23 This check doesn't seem necessary. I think we can
dsjang 2013/09/03 19:13:11 Done.
361 !command_line->HasSwitch(switches::kExtensionProcess));
348 } 362 }
349 363
350 void ChromeContentRendererClient::RenderViewCreated( 364 void ChromeContentRendererClient::RenderViewCreated(
351 content::RenderView* render_view) { 365 content::RenderView* render_view) {
352 ContentSettingsObserver* content_settings = 366 ContentSettingsObserver* content_settings =
353 new ContentSettingsObserver(render_view); 367 new ContentSettingsObserver(render_view);
354 if (chrome_observer_.get()) { 368 if (chrome_observer_.get()) {
355 content_settings->SetContentSettingRules( 369 content_settings->SetContentSettingRules(
356 chrome_observer_->content_setting_rules()); 370 chrome_observer_->content_setting_rules());
357 } 371 }
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 #endif // !defined(OS_ANDROID) 1312 #endif // !defined(OS_ANDROID)
1299 return false; 1313 return false;
1300 } 1314 }
1301 1315
1302 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( 1316 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource(
1303 const base::string16& source) const { 1317 const base::string16& source) const {
1304 return GURL(source).SchemeIs(extensions::kExtensionScheme); 1318 return GURL(source).SchemeIs(extensions::kExtensionScheme);
1305 } 1319 }
1306 1320
1307 } // namespace chrome 1321 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | content/child/site_isolation_policy.h » ('j') | content/child/site_isolation_policy.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698