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

Side by Side Diff: content/browser/webui/web_ui_data_source_impl.cc

Issue 453613002: Implement support for <extensionoptions> embedding in WebUI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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 "content/browser/webui/web_ui_data_source_impl.h" 5 #include "content/browser/webui/web_ui_data_source_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 virtual bool AllowCaching() const OVERRIDE { 83 virtual bool AllowCaching() const OVERRIDE {
84 return false; 84 return false;
85 } 85 }
86 virtual bool ShouldAddContentSecurityPolicy() const OVERRIDE { 86 virtual bool ShouldAddContentSecurityPolicy() const OVERRIDE {
87 return parent_->add_csp_; 87 return parent_->add_csp_;
88 } 88 }
89 virtual std::string GetContentSecurityPolicyObjectSrc() const OVERRIDE { 89 virtual std::string GetContentSecurityPolicyObjectSrc() const OVERRIDE {
90 if (parent_->object_src_set_) 90 if (parent_->object_src_set_)
91 return parent_->object_src_; 91 return parent_->object_src_;
92 return URLDataSource::GetContentSecurityPolicyObjectSrc(); 92 return "object-src chrome://chrome/extensions/ chrome://extensions-frame/;";
not at google - send to devlin 2014/08/07 23:06:03 you must get somebody else to look at this. I can'
ericzeng 2014/08/08 00:23:47 Acknowledged.
93 } 93 }
94 virtual std::string GetContentSecurityPolicyFrameSrc() const OVERRIDE { 94 virtual std::string GetContentSecurityPolicyFrameSrc() const OVERRIDE {
95 if (parent_->frame_src_set_) 95 if (parent_->frame_src_set_)
96 return parent_->frame_src_; 96 return parent_->frame_src_;
97 return URLDataSource::GetContentSecurityPolicyFrameSrc(); 97 return URLDataSource::GetContentSecurityPolicyFrameSrc();
98 } 98 }
99 virtual bool ShouldDenyXFrameOptions() const OVERRIDE { 99 virtual bool ShouldDenyXFrameOptions() const OVERRIDE {
100 return parent_->deny_xframe_options_; 100 return parent_->deny_xframe_options_;
101 } 101 }
102 102
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 253
254 void WebUIDataSourceImpl::SendFromResourceBundle( 254 void WebUIDataSourceImpl::SendFromResourceBundle(
255 const URLDataSource::GotDataCallback& callback, int idr) { 255 const URLDataSource::GotDataCallback& callback, int idr) {
256 scoped_refptr<base::RefCountedStaticMemory> response( 256 scoped_refptr<base::RefCountedStaticMemory> response(
257 GetContentClient()->GetDataResourceBytes(idr)); 257 GetContentClient()->GetDataResourceBytes(idr));
258 callback.Run(response.get()); 258 callback.Run(response.get());
259 } 259 }
260 260
261 } // namespace content 261 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698