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 #include "extensions/common/extension_consumer.h" |
| 6 #include "extensions/common/manifest_handlers/csp_info.h" |
| 7 |
| 8 namespace extensions { |
| 9 |
| 10 ExtensionConsumer::ExtensionConsumer( |
| 11 const scoped_refptr<const Extension>& extension, const HostID& host_id) |
| 12 : Host(host_id), |
| 13 extension_(extension) { |
| 14 } |
| 15 |
| 16 ExtensionConsumer::~ExtensionConsumer() { |
| 17 } |
| 18 |
| 19 bool ExtensionConsumer::IsEmpty() const { |
| 20 return extension_.get() == nullptr; |
| 21 } |
| 22 |
| 23 const std::string& ExtensionConsumer::GetContentSecurityPolicy() const { |
| 24 return CSPInfo::GetContentSecurityPolicy(extension_.get()); |
| 25 } |
| 26 |
| 27 const GURL& ExtensionConsumer::url() const { |
| 28 DCHECK(extension_.get()); |
| 29 return extension_->url(); |
| 30 } |
| 31 |
| 32 const std::string ExtensionConsumer::name() const { |
| 33 DCHECK(extension_.get()); |
| 34 return extension_->name(); |
| 35 } |
| 36 |
| 37 } // namespace extensions |
OLD | NEW |