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

Side by Side Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 2012393003: Replace frame-src with child-src in WebUI CSP (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@csp
Patch Set: Created 4 years, 7 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/browser/ui/webui/ntp/new_tab_ui.h" 5 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 std::string NewTabUI::NewTabHTMLSource::GetContentSecurityPolicyStyleSrc() 238 std::string NewTabUI::NewTabHTMLSource::GetContentSecurityPolicyStyleSrc()
239 const { 239 const {
240 return "style-src 'self' chrome://resources 'unsafe-inline' chrome://theme;"; 240 return "style-src 'self' chrome://resources 'unsafe-inline' chrome://theme;";
241 } 241 }
242 242
243 std::string NewTabUI::NewTabHTMLSource::GetContentSecurityPolicyImgSrc() 243 std::string NewTabUI::NewTabHTMLSource::GetContentSecurityPolicyImgSrc()
244 const { 244 const {
245 return "img-src chrome-search://thumb chrome-search://thumb2 data:;"; 245 return "img-src chrome-search://thumb chrome-search://thumb2 data:;";
246 } 246 }
247 247
248 std::string NewTabUI::NewTabHTMLSource::GetContentSecurityPolicyFrameSrc() 248 std::string NewTabUI::NewTabHTMLSource::GetContentSecurityPolicyChildSrc()
249 const { 249 const {
250 return "frame-src chrome-search://most-visited;"; 250 return "child-src chrome-search://most-visited;";
251 } 251 }
252 252
253 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, 253 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource,
254 const char* mime_type, 254 const char* mime_type,
255 int resource_id) { 255 int resource_id) {
256 DCHECK(resource); 256 DCHECK(resource);
257 DCHECK(mime_type); 257 DCHECK(mime_type);
258 resource_map_[std::string(resource)] = 258 resource_map_[std::string(resource)] =
259 std::make_pair(std::string(mime_type), resource_id); 259 std::make_pair(std::string(mime_type), resource_id);
260 } 260 }
261 261
262 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} 262 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {}
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui.h ('k') | chrome/browser/ui/webui/print_preview/print_preview_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698