OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <map> |
9 #include <string> | 10 #include <string> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
15 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
16 | 17 |
17 // The one true extension container. Extensions are identified by their id. | 18 // The one true extension container. Extensions are identified by their id. |
18 // 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. |
19 class ExtensionSet { | 20 class ExtensionSet { |
20 public: | 21 public: |
| 22 typedef std::pair<FilePath, std::string> ExtensionPathAndDefaultLocale; |
| 23 |
21 ExtensionSet(); | 24 ExtensionSet(); |
22 ~ExtensionSet(); | 25 ~ExtensionSet(); |
23 | 26 |
24 // Gets the number of extensions contained. | 27 // Gets the number of extensions contained. |
25 size_t size() const; | 28 size_t size() const; |
26 | 29 |
27 // Returns true if the set contains the specified extension. | 30 // Returns true if the set contains the specified extension. |
28 bool Contains(const std::string& id); | 31 bool Contains(const std::string& id); |
29 | 32 |
30 // Adds the specified extension to the set. The set becomes an owner. Any | 33 // Adds the specified extension to the set. The set becomes an owner. Any |
(...skipping 30 matching lines...) Expand all Loading... |
61 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet); | 64 FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet); |
62 | 65 |
63 // static | 66 // static |
64 typedef std::map<std::string, scoped_refptr<const Extension> > ExtensionMap; | 67 typedef std::map<std::string, scoped_refptr<const Extension> > ExtensionMap; |
65 ExtensionMap extensions_; | 68 ExtensionMap extensions_; |
66 | 69 |
67 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); | 70 DISALLOW_COPY_AND_ASSIGN(ExtensionSet); |
68 }; | 71 }; |
69 | 72 |
70 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ | 73 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SET_H_ |
OLD | NEW |