| Index: extensions/common/extension_set.h
|
| diff --git a/chrome/common/extensions/extension_set.h b/extensions/common/extension_set.h
|
| similarity index 79%
|
| rename from chrome/common/extensions/extension_set.h
|
| rename to extensions/common/extension_set.h
|
| index b6251d667cc76da7c9d513d102dc02c57f771e17..6f70a51b1f940d97a6029646d5474ba3821e56bc 100644
|
| --- a/chrome/common/extensions/extension_set.h
|
| +++ b/extensions/common/extension_set.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_
|
| -#define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_
|
| +#ifndef EXTENSIONS_COMMON_EXTENSION_SET_H_
|
| +#define EXTENSIONS_COMMON_EXTENSION_SET_H_
|
|
|
| #include <iterator>
|
| #include <map>
|
| @@ -15,21 +15,21 @@
|
| #include "extensions/common/extension.h"
|
| #include "url/gurl.h"
|
|
|
| +namespace extensions {
|
| +
|
| // The one true extension container. Extensions are identified by their id.
|
| // Only one extension can be in the set with a given ID.
|
| class ExtensionSet {
|
| public:
|
| typedef std::pair<base::FilePath, std::string> ExtensionPathAndDefaultLocale;
|
| - typedef std::map<std::string, scoped_refptr<const extensions::Extension> >
|
| - ExtensionMap;
|
| - typedef base::Callback<void(const extensions::ExtensionIdSet&)>
|
| + typedef std::map<std::string, scoped_refptr<const Extension> > ExtensionMap;
|
| + typedef base::Callback<void(const ExtensionIdSet&)>
|
| ModificationCallback;
|
|
|
| // Iteration over the values of the map (given that it's an ExtensionSet,
|
| // it should iterate like a set iterator).
|
| - class const_iterator :
|
| - public std::iterator<std::input_iterator_tag,
|
| - scoped_refptr<const extensions::Extension> > {
|
| + class const_iterator : public std::iterator<std::input_iterator_tag,
|
| + scoped_refptr<const Extension> > {
|
| public:
|
| const_iterator();
|
| const_iterator(const const_iterator& other);
|
| @@ -44,10 +44,10 @@ class ExtensionSet {
|
| ++it_;
|
| return old;
|
| }
|
| - const scoped_refptr<const extensions::Extension>& operator*() const {
|
| + const scoped_refptr<const Extension>& operator*() const {
|
| return it_->second;
|
| }
|
| - const scoped_refptr<const extensions::Extension>* operator->() const {
|
| + const scoped_refptr<const Extension>* operator->() const {
|
| return &it_->second;
|
| }
|
| bool operator!=(const const_iterator& other) const {
|
| @@ -77,7 +77,7 @@ class ExtensionSet {
|
| // Adds the specified extension to the set. The set becomes an owner. Any
|
| // previous extension with the same ID is removed.
|
| // Returns true if there is no previous extension.
|
| - bool Insert(const scoped_refptr<const extensions::Extension>& extension);
|
| + bool Insert(const scoped_refptr<const Extension>& extension);
|
|
|
| // Copies different items from |extensions| to the current set and returns
|
| // whether anything changed.
|
| @@ -99,25 +99,25 @@ class ExtensionSet {
|
| // NOTE: This can return NULL if called before UpdateExtensions receives
|
| // bulk extension data (e.g. if called from
|
| // EventBindings::HandleContextCreated)
|
| - const extensions::Extension* GetExtensionOrAppByURL(const GURL& url) const;
|
| + const Extension* GetExtensionOrAppByURL(const GURL& url) const;
|
|
|
| // Returns the hosted app whose web extent contains the URL.
|
| - const extensions::Extension* GetHostedAppByURL(const GURL& url) const;
|
| + const Extension* GetHostedAppByURL(const GURL& url) const;
|
|
|
| // Returns a hosted app that contains any URL that overlaps with the given
|
| // extent, if one exists.
|
| - const extensions::Extension* GetHostedAppByOverlappingWebExtent(
|
| - const extensions::URLPatternSet& extent) const;
|
| + const Extension* GetHostedAppByOverlappingWebExtent(
|
| + const URLPatternSet& extent) const;
|
|
|
| // Returns true if |new_url| is in the extent of the same extension as
|
| // |old_url|. Also returns true if neither URL is in an app.
|
| bool InSameExtent(const GURL& old_url, const GURL& new_url) const;
|
|
|
| // Look up an Extension object by id.
|
| - const extensions::Extension* GetByID(const std::string& id) const;
|
| + const Extension* GetByID(const std::string& id) const;
|
|
|
| // Gets the IDs of all extensions in the set.
|
| - extensions::ExtensionIdSet GetIDs() const;
|
| + ExtensionIdSet GetIDs() const;
|
|
|
| // Returns true if |info| should get extension api bindings and be permitted
|
| // to make api calls. Note that this is independent of what extension
|
| @@ -143,4 +143,6 @@ class ExtensionSet {
|
| DISALLOW_COPY_AND_ASSIGN(ExtensionSet);
|
| };
|
|
|
| -#endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_
|
| +} // namespace extensions
|
| +
|
| +#endif // EXTENSIONS_COMMON_EXTENSION_SET_H_
|
|
|