summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/web_ui_injection_host.cc
blob: 1fd436452a85235032261ed3ec091ad986390a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "extensions/renderer/web_ui_injection_host.h"

WebUIInjectionHost::WebUIInjectionHost(const HostID& host_id)
  : InjectionHost(host_id),
    url_(host_id.id()) {
}

WebUIInjectionHost::~WebUIInjectionHost() {
}

std::string WebUIInjectionHost::GetContentSecurityPolicy() const {
  return std::string();
}

const GURL& WebUIInjectionHost::url() const {
  return url_;
}

const std::string& WebUIInjectionHost::name() const {
  return id().id();
}

extensions::PermissionsData::AccessType WebUIInjectionHost::CanExecuteOnFrame(
    const GURL& document_url,
    content::RenderFrame* render_frame,
    int tab_id,
    bool is_declarative) const {
  // Content scripts are allowed to inject on webviews created by WebUI.
  return extensions::PermissionsData::AccessType::ACCESS_ALLOWED;
}