Index: chrome/browser/ui/webui/ntp/new_tab_ui.cc |
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
index ae162b625f074fa71f7a6b860f21e89decdfb9b9..b51a108015f060ddf5ad057e4d32eb5f9cb652d7 100644 |
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
@@ -228,8 +228,20 @@ bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { |
return false; |
} |
-bool NewTabUI::NewTabHTMLSource::ShouldAddContentSecurityPolicy() const { |
- return false; |
+std::string NewTabUI::NewTabHTMLSource::GetContentSecurityPolicyScriptSrc() |
+ const { |
+ // Add 'unsafe-inline' and google resources to script-src. |
+ return "script-src chrome://resources 'self' 'unsafe-eval' 'unsafe-inline' " |
+ "*.google.com *.gstatic.com;"; |
+} |
+ |
+std::string NewTabUI::NewTabHTMLSource::GetContentSecurityPolicyObjectSrc() |
+ const { |
+ // Add style-src, child-src, and img-src. |
+ return "object-src 'none';" |
+ "style-src 'self' chrome://resources 'unsafe-inline' chrome://theme;" |
Tom Sepez
2016/05/25 23:07:03
same here.
wychen
2016/05/26 17:54:23
For consistency, I changed back to frame-src.
In C
|
+ "child-src chrome-search://most-visited;" |
+ "img-src chrome-search://thumb chrome-search://thumb2 data:;"; |
} |
void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, |