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 EXTENSIONS_COMMON_EXTENSION_SET_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 6 #define EXTENSIONS_COMMON_EXTENSION_SET_H_ |
7 | 7 |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "extensions/common/extension.h" | 15 #include "extensions/common/extension.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 // The one true extension container. Extensions are identified by their id. | 18 // The one true extension container. Extensions are identified by their id. |
19 // Only one extension can be in the set with a given ID. | 19 // Only one extension can be in the set with a given ID. |
20 class ExtensionSet { | 20 class ExtensionSet { |
benwells
2013/12/04 03:48:08
This might be painful, but can you move this into
Devlin
2013/12/10 21:25:31
Sorry for the delay, and thanks for catching that.
| |
21 public: | 21 public: |
22 typedef std::pair<base::FilePath, std::string> ExtensionPathAndDefaultLocale; | 22 typedef std::pair<base::FilePath, std::string> ExtensionPathAndDefaultLocale; |
23 typedef std::map<std::string, scoped_refptr<const extensions::Extension> > | 23 typedef std::map<std::string, scoped_refptr<const extensions::Extension> > |
24 ExtensionMap; | 24 ExtensionMap; |
25 typedef base::Callback<void(const extensions::ExtensionIdSet&)> | 25 typedef base::Callback<void(const extensions::ExtensionIdSet&)> |
26 ModificationCallback; | 26 ModificationCallback; |
27 | 27 |
28 // Iteration over the values of the map (given that it's an ExtensionSet, | 28 // Iteration over the values of the map (given that it's an ExtensionSet, |
29 // it should iterate like a set iterator). | 29 // it should iterate like a set iterator). |
30 class const_iterator : | 30 class const_iterator : |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 | 135 |
136 // If non-null, called with the extension ids in this set after a modification | 136 // If non-null, called with the extension ids in this set after a modification |
137 // occurred. This is not called on Clear() which is typically used when | 137 // occurred. This is not called on Clear() which is typically used when |
138 // discarding the set (e.g., on shutdown) and we do not want to track that as | 138 // discarding the set (e.g., on shutdown) and we do not want to track that as |
139 // a real modification. | 139 // a real modification. |
140 ModificationCallback modification_callback_; | 140 ModificationCallback modification_callback_; |
141 | 141 |
142 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); | 142 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); |
143 }; | 143 }; |
144 | 144 |
145 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 145 #endif // EXTENSIONS_COMMON_EXTENSION_SET_H_ |
OLD | NEW |