Remove linux_chromium_gn_dbg from the chromium CQ.
[chromium-blink-merge.git] / extensions / renderer / extension_injection_host.h
blob02ccfc10c800dd9aa3ad2e2f720025452cc931ee
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_EXTENSION_INJECTION_HOST_H_
6 #define EXTENSIONS_RENDERER_EXTENSION_INJECTION_HOST_H_
8 #include "base/memory/ref_counted.h"
9 #include "extensions/common/extension.h"
10 #include "extensions/renderer/injection_host.h"
12 namespace extensions {
14 // A wrapper class that holds an extension and implements the InjectionHost
15 // interface.
16 class ExtensionInjectionHost : public InjectionHost {
17 public:
18 ExtensionInjectionHost(const Extension* extension);
19 ~ExtensionInjectionHost() override;
21 // Create an ExtensionInjectionHost object. If the extension is gone, returns
22 // a null scoped ptr.
23 static scoped_ptr<const InjectionHost> Create(
24 const std::string& extension_id);
26 private:
27 // InjectionHost:
28 std::string GetContentSecurityPolicy() const override;
29 const GURL& url() const override;
30 const std::string& name() const override;
31 PermissionsData::AccessType CanExecuteOnFrame(
32 const GURL& document_url,
33 content::RenderFrame* render_frame,
34 int tab_id,
35 bool is_declarative) const override;
36 bool ShouldNotifyBrowserOfInjection() const override;
38 const Extension* extension_;
40 DISALLOW_COPY_AND_ASSIGN(ExtensionInjectionHost);
43 } // namespace extesions
45 #endif // EXTENSIONS_RENDERER_EXTENSION_INJECTION_HOST_H_