Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: extensions/renderer/extension_consumer.h

Issue 885493007: Refactoring: de-couple Extensions from "script injection System" [render side] : 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove Host::IsEmpty() and move ExtensionConsumer to extensions/renderer. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698