Remove linux_chromium_gn_dbg from the chromium CQ.
[chromium-blink-merge.git] / extensions / renderer / injection_host.h
blobb0a01feefc9237726f9fb0f2e369f8b6d3202100
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 #ifndef EXTENSIONS_RENDERER_INJECTION_HOST_H
6 #define EXTENSIONS_RENDERER_INJECTION_HOST_H
8 #include "extensions/common/host_id.h"
9 #include "extensions/common/permissions/permissions_data.h"
10 #include "url/gurl.h"
12 namespace content {
13 class RenderFrame;
16 // An interface for all kinds of hosts who own user scripts.
17 class InjectionHost {
18 public:
19 InjectionHost(const HostID& host_id);
20 virtual ~InjectionHost();
22 virtual std::string GetContentSecurityPolicy() const = 0;
24 // The base url for the host.
25 virtual const GURL& url() const = 0;
27 // The human-readable name of the host.
28 virtual const std::string& name() const = 0;
30 // Returns true if the script should execute.
31 virtual extensions::PermissionsData::AccessType CanExecuteOnFrame(
32 const GURL& document_url,
33 content::RenderFrame* render_frame,
34 int tab_id,
35 bool is_declarative) const = 0;
37 // Returns true if the browser should be notified of any injections the host
38 // performs.
39 virtual bool ShouldNotifyBrowserOfInjection() const = 0;
41 const HostID& id() const { return id_; }
43 private:
44 // The ID of the host.
45 HostID id_;
47 DISALLOW_COPY_AND_ASSIGN(InjectionHost);
50 #endif // EXTENSIONS_RENDERER_INJECTION_HOST_H