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

Side by Side Diff: extensions/renderer/web_ui_injection_host.cc

Issue 1150683007: [Extensions] Use document url (not top url) for tab-specific permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « extensions/renderer/web_ui_injection_host.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "extensions/renderer/web_ui_injection_host.h" 5 #include "extensions/renderer/web_ui_injection_host.h"
6 6
7 WebUIInjectionHost::WebUIInjectionHost(const HostID& host_id) 7 WebUIInjectionHost::WebUIInjectionHost(const HostID& host_id)
8 : InjectionHost(host_id), 8 : InjectionHost(host_id),
9 url_(host_id.id()) { 9 url_(host_id.id()) {
10 } 10 }
11 11
12 WebUIInjectionHost::~WebUIInjectionHost() { 12 WebUIInjectionHost::~WebUIInjectionHost() {
13 } 13 }
14 14
15 std::string WebUIInjectionHost::GetContentSecurityPolicy() const { 15 std::string WebUIInjectionHost::GetContentSecurityPolicy() const {
16 return std::string(); 16 return std::string();
17 } 17 }
18 18
19 const GURL& WebUIInjectionHost::url() const { 19 const GURL& WebUIInjectionHost::url() const {
20 return url_; 20 return url_;
21 } 21 }
22 22
23 const std::string& WebUIInjectionHost::name() const { 23 const std::string& WebUIInjectionHost::name() const {
24 return id().id(); 24 return id().id();
25 } 25 }
26 26
27 extensions::PermissionsData::AccessType WebUIInjectionHost::CanExecuteOnFrame( 27 extensions::PermissionsData::AccessType WebUIInjectionHost::CanExecuteOnFrame(
28 const GURL& document_url, 28 const GURL& document_url,
29 const GURL& top_frame_url, 29 content::RenderFrame* render_frame,
30 int tab_id, 30 int tab_id,
31 bool is_declarative) const { 31 bool is_declarative) const {
32 // Content scripts are allowed to inject on webviews created by WebUI. 32 // Content scripts are allowed to inject on webviews created by WebUI.
33 return extensions::PermissionsData::AccessType::ACCESS_ALLOWED; 33 return extensions::PermissionsData::AccessType::ACCESS_ALLOWED;
34 } 34 }
35 35
36 bool WebUIInjectionHost::ShouldNotifyBrowserOfInjection() const { 36 bool WebUIInjectionHost::ShouldNotifyBrowserOfInjection() const {
37 // We don't notify browser of any injection made from WebUI, since the 37 // We don't notify browser of any injection made from WebUI, since the
38 // decision for injection is made in the render. 38 // decision for injection is made in the render.
39 return false; 39 return false;
40 } 40 }
OLDNEW
« no previous file with comments | « extensions/renderer/web_ui_injection_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698