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

Unified Diff: extensions/common/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: Devlin@'s comments. 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 side-by-side diff with in-line comments
Download patch
Index: extensions/common/extension_consumer.h
diff --git a/extensions/common/extension_consumer.h b/extensions/common/extension_consumer.h
new file mode 100644
index 0000000000000000000000000000000000000000..e86404010f4e9207904ed2d740a55392f8c2831c
--- /dev/null
+++ b/extensions/common/extension_consumer.h
@@ -0,0 +1,37 @@
+// 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_COMMON_EXTENSION_CONSUMER_H_
+#define EXTENSIONS_COMMON_EXTENSION_CONSUMER_H_
+
+#include "base/memory/ref_counted.h"
+#include "extensions/common/extension.h"
+#include "extensions/common/host_id.h"
+
+namespace extensions {
+
+// A wrapper class which holds an extension and implements the Host interface.
+class ExtensionConsumer : public Host {
+ public:
+ ExtensionConsumer(const scoped_refptr<const Extension>& extension,
+ const HostID& host_id);
+ ~ExtensionConsumer() override;
+
+ // Host:
+ bool IsEmpty() const override;
+ const std::string& GetContentSecurityPolicy() const override;
+ const GURL& url() const override;
+ const std::string name() const override;
+
+ const Extension* extension() const { return extension_.get(); }
+
+ private:
+ scoped_refptr<const Extension> extension_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionConsumer);
+};
+
+} // namespace extesions
+
+#endif // EXTENSIONS_COMMON_EXTENSION_CONSUMER_H_

Powered by Google App Engine
This is Rietveld 408576698