Index: extensions/common/extension_consumer.cc |
diff --git a/extensions/common/extension_consumer.cc b/extensions/common/extension_consumer.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4fe22eae0e381de5393672bf61a7f28a19b0568d |
--- /dev/null |
+++ b/extensions/common/extension_consumer.cc |
@@ -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. |
+ |
+#include "extensions/common/extension_consumer.h" |
+#include "extensions/common/manifest_handlers/csp_info.h" |
+ |
+namespace extensions { |
+ |
+ExtensionConsumer::ExtensionConsumer( |
+ const scoped_refptr<const Extension>& extension, const HostID& host_id) |
+ : Host(host_id), |
+ extension_(extension) { |
+} |
+ |
+ExtensionConsumer::~ExtensionConsumer() { |
+} |
+ |
+bool ExtensionConsumer::IsEmpty() const { |
+ return extension_.get() == nullptr; |
+} |
+ |
+const std::string& ExtensionConsumer::GetContentSecurityPolicy() const { |
+ return CSPInfo::GetContentSecurityPolicy(extension_.get()); |
+} |
+ |
+const GURL& ExtensionConsumer::url() const { |
+ DCHECK(extension_.get()); |
+ return extension_->url(); |
+} |
+ |
+const std::string ExtensionConsumer::name() const { |
+ DCHECK(extension_.get()); |
+ return extension_->name(); |
+} |
+ |
+} // namespace extensions |