Chromium Code Reviews| Index: extensions/renderer/extension_injection_host.h |
| diff --git a/extensions/renderer/extension_injection_host.h b/extensions/renderer/extension_injection_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ba944056a6872fb4f0cad6bf75c95652c1f0e21c |
| --- /dev/null |
| +++ b/extensions/renderer/extension_injection_host.h |
| @@ -0,0 +1,40 @@ |
| +// 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. |
| + |
| +#ifndef EXTENSIONS_RENDERER_EXTENSION_INJECTION_HOST_H_ |
| +#define EXTENSIONS_RENDERER_EXTENSION_INJECTION_HOST_H_ |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "extensions/common/extension.h" |
| +#include "extensions/renderer/injection_host.h" |
| + |
| +namespace extensions { |
| + |
| +// A wrapper class which holds an extension and implements the InjectionHost |
|
Devlin
2015/02/11 00:00:48
nit of nits: s/which/that
Xi Han
2015/02/11 16:00:23
Done.
|
| +// interface. |
| +class ExtensionInjectionHost : public InjectionHost { |
| + public: |
| + ExtensionInjectionHost(const scoped_refptr<const Extension>& extension); |
| + ~ExtensionInjectionHost() override; |
| + |
| + // InjectionHost: |
| + const std::string& GetContentSecurityPolicy() const override; |
| + const GURL& url() const override; |
| + const std::string name() const override; |
|
Devlin
2015/02/11 00:00:48
It's kinda silly to return a const std::string. P
Xi Han
2015/02/11 16:00:23
Sorry for the typo, should be const std::string&.
|
| + PermissionsData::AccessType CanExecuteOnFrame( |
| + const GURL& document_url, |
| + const GURL& top_frame_url, |
| + int tab_id, |
| + bool is_declarative) const override; |
| + const Extension* extension() const { return extension_.get(); } |
| + |
| + private: |
| + scoped_refptr<const Extension> extension_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ExtensionInjectionHost); |
| +}; |
| + |
| +} // namespace extesions |
| + |
| +#endif // EXTENSIONS_RENDERER_EXTENSION_INJECTION_HOST_H_ |