Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
| 7 | 7 |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 GURL url_; | 37 GURL url_; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // The one true extension container. Extensions are identified by their id. | 40 // The one true extension container. Extensions are identified by their id. |
| 41 // Only one extension can be in the set with a given ID. | 41 // Only one extension can be in the set with a given ID. |
| 42 class ExtensionSet { | 42 class ExtensionSet { |
| 43 public: | 43 public: |
| 44 typedef std::pair<base::FilePath, std::string> ExtensionPathAndDefaultLocale; | 44 typedef std::pair<base::FilePath, std::string> ExtensionPathAndDefaultLocale; |
| 45 typedef std::map<std::string, scoped_refptr<const extensions::Extension> > | 45 typedef std::map<std::string, scoped_refptr<const extensions::Extension> > |
| 46 ExtensionMap; | 46 ExtensionMap; |
| 47 typedef scoped_refptr<const extensions::Extension> value_type; | |
|
Devlin
2013/05/15 00:21:16
Never used.
Jeffrey Yasskin
2013/05/15 03:07:18
Whoops. I took out the gmock assertion that would
| |
| 47 | 48 |
| 48 // Iteration over the values of the map (given that it's an ExtensionSet, | 49 // Iteration over the values of the map (given that it's an ExtensionSet, |
| 49 // it should iterate like a set iterator). | 50 // it should iterate like a set iterator). |
| 50 class const_iterator : | 51 class const_iterator : |
| 51 public std::iterator<std::input_iterator_tag, | 52 public std::iterator<std::input_iterator_tag, |
| 52 scoped_refptr<const extensions::Extension> > { | 53 scoped_refptr<const extensions::Extension> > { |
| 53 public: | 54 public: |
| 54 const_iterator(); | 55 const_iterator(); |
| 55 const_iterator(const const_iterator& other); | 56 const_iterator(const const_iterator& other); |
| 56 explicit const_iterator(ExtensionMap::const_iterator it); | 57 explicit const_iterator(ExtensionMap::const_iterator it); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 | 140 |
| 140 private: | 141 private: |
| 141 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet); | 142 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet); |
| 142 | 143 |
| 143 ExtensionMap extensions_; | 144 ExtensionMap extensions_; |
| 144 | 145 |
| 145 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); | 146 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); |
| 146 }; | 147 }; |
| 147 | 148 |
| 148 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 149 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
| OLD | NEW |