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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 444113003: Remove dependency of chrome in GuestViewBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes are made to RegisterGuestViewTypes(). 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/chrome_extensions_api_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index a47903cc9db31f220b3bc6e719530e0ef963a1cf..953f8ad01351b0f2f82bdf4bd861f74c9a19098d 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -82,6 +82,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/content_settings.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pepper_permission_util.h"
@@ -558,6 +559,27 @@ float GetDeviceScaleAdjustment() {
#endif // defined(OS_ANDROID)
+#if defined(ENABLE_EXTENSIONS)
+// By default, JavaScript and images are enabled in guest content.
+void GetGuestViewDefaultContentSettingRules(
+ bool incognito,
+ RendererContentSettingRules* rules) {
+ rules->image_rules.push_back(
+ ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_ALLOW,
+ std::string(),
+ incognito));
+
+ rules->script_rules.push_back(
+ ContentSettingPatternSource(ContentSettingsPattern::Wildcard(),
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_ALLOW,
+ std::string(),
+ incognito));
+}
+#endif // defined(ENALBE_EXTENSIONS)
+
} // namespace
namespace chrome {
@@ -816,8 +838,7 @@ void ChromeContentBrowserClient::RenderProcessWillLaunch(
RendererContentSettingRules rules;
if (host->IsIsolatedGuest()) {
#if defined(ENABLE_EXTENSIONS)
- GuestViewBase::GetDefaultContentSettingRules(&rules,
- profile->IsOffTheRecord());
+ GetGuestViewDefaultContentSettingRules(profile->IsOffTheRecord(), &rules);
#else
NOTREACHED();
#endif
« no previous file with comments | « no previous file | chrome/browser/extensions/api/chrome_extensions_api_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698