Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef EXTENSIONS_RENDERER_EXTENSION_INJECTION_HOST_H_ | |
| 6 #define EXTENSIONS_RENDERER_EXTENSION_INJECTION_HOST_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "extensions/common/extension.h" | |
| 10 #include "extensions/renderer/injection_host.h" | |
| 11 | |
| 12 namespace extensions { | |
| 13 | |
| 14 // A wrapper class that holds an extension and implements the InjectionHost | |
| 15 // interface. | |
| 16 class ExtensionInjectionHost : public InjectionHost { | |
| 17 public: | |
| 18 ExtensionInjectionHost(const scoped_refptr<const Extension>& extension); | |
| 19 ~ExtensionInjectionHost() override; | |
| 20 | |
| 21 // InjectionHost: | |
|
Devlin
2015/02/13 19:29:59
nit: Let's make these private.
| |
| 22 const std::string& GetContentSecurityPolicy() const override; | |
| 23 const GURL& url() const override; | |
| 24 const std::string& name() const override; | |
| 25 PermissionsData::AccessType CanExecuteOnFrame( | |
| 26 const GURL& document_url, | |
| 27 const GURL& top_frame_url, | |
| 28 int tab_id, | |
| 29 bool is_declarative) const override; | |
| 30 const Extension* extension() const { return extension_.get(); } | |
|
Devlin
2015/02/13 19:29:59
nit: needed?
| |
| 31 | |
| 32 private: | |
| 33 scoped_refptr<const Extension> extension_; | |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(ExtensionInjectionHost); | |
| 36 }; | |
| 37 | |
| 38 } // namespace extesions | |
| 39 | |
| 40 #endif // EXTENSIONS_RENDERER_EXTENSION_INJECTION_HOST_H_ | |
| OLD | NEW |