Roll WebRTC 9745:9761, Libjingle 9742:9761
[chromium-blink-merge.git] / extensions / renderer / web_ui_injection_host.cc
blob799f3fa8ea974d8c6821648382fe7df3d59573bb
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
3 // found in the LICENSE file.
5 #include "extensions/renderer/web_ui_injection_host.h"
7 WebUIInjectionHost::WebUIInjectionHost(const HostID& host_id)
8 : InjectionHost(host_id),
9 url_(host_id.id()) {
12 WebUIInjectionHost::~WebUIInjectionHost() {
15 std::string WebUIInjectionHost::GetContentSecurityPolicy() const {
16 return std::string();
19 const GURL& WebUIInjectionHost::url() const {
20 return url_;
23 const std::string& WebUIInjectionHost::name() const {
24 return id().id();
27 extensions::PermissionsData::AccessType WebUIInjectionHost::CanExecuteOnFrame(
28 const GURL& document_url,
29 content::RenderFrame* render_frame,
30 int tab_id,
31 bool is_declarative) const {
32 // Content scripts are allowed to inject on webviews created by WebUI.
33 return extensions::PermissionsData::AccessType::ACCESS_ALLOWED;
36 bool WebUIInjectionHost::ShouldNotifyBrowserOfInjection() const {
37 // We don't notify browser of any injection made from WebUI, since the
38 // decision for injection is made in the render.
39 return false;