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_CONSUMER_H_ | |
6 #define EXTENSIONS_RENDERER_EXTENSION_CONSUMER_H_ | |
7 | |
8 #include "base/memory/ref_counted.h" | |
9 #include "extensions/common/extension.h" | |
10 #include "extensions/common/host_id.h" | |
11 | |
12 namespace extensions { | |
13 | |
14 // A wrapper class which holds an extension and implements the Host interface. | |
15 class ExtensionConsumer : public Host { | |
16 public: | |
17 ExtensionConsumer(const scoped_refptr<const Extension>& extension, | |
18 const HostID& host_id); | |
Devlin
2015/02/09 17:40:24
Why do we need to pass in a host id? Can't an Ext
Xi Han
2015/02/09 23:28:11
That makes sense. Updated.
| |
19 ~ExtensionConsumer() override; | |
20 | |
21 // Host: | |
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(); } | |
31 | |
32 private: | |
33 scoped_refptr<const Extension> extension_; | |
34 | |
35 DISALLOW_COPY_AND_ASSIGN(ExtensionConsumer); | |
36 }; | |
37 | |
38 } // namespace extesions | |
39 | |
40 #endif // EXTENSIONS_RENDERER_EXTENSION_CONSUMER_H_ | |
OLD | NEW |