OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_RENDERER_EXTENSIONS_EXTENSION_RENDERER_INFO_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_RENDERER_INFO_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_RENDERER_INFO_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_RENDERER_INFO_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
14 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 | 16 |
17 // ExtensionRendererInfo is a convenience wrapper around a map of extension | 17 // ExtensionRendererInfo is a convenience wrapper around a map of extension |
18 // objects. It is used by renderers to maintain information about currently | 18 // objects. It is used by renderers to maintain information about currently |
19 // loaded extensions. | 19 // loaded extensions. |
20 class ExtensionRendererInfo { | 20 class ExtensionRendererInfo { |
21 public: | 21 public: |
22 ExtensionRendererInfo(); | 22 ExtensionRendererInfo(); |
| 23 ~ExtensionRendererInfo(); |
23 | 24 |
24 // Gets the number of extensions contained. | 25 // Gets the number of extensions contained. |
25 size_t size() const; | 26 size_t size() const; |
26 | 27 |
27 // Updates the specified extension. | 28 // Updates the specified extension. |
28 void Update(const scoped_refptr<const Extension>& extension); | 29 void Update(const scoped_refptr<const Extension>& extension); |
29 | 30 |
30 // Removes the specified extension. | 31 // Removes the specified extension. |
31 void Remove(const std::string& id); | 32 void Remove(const std::string& id); |
32 | 33 |
(...skipping 24 matching lines...) Expand all Loading... |
57 FRIEND_TEST_ALL_PREFIXES(ExtensionRendererInfoTest, ExtensionRendererInfo); | 58 FRIEND_TEST_ALL_PREFIXES(ExtensionRendererInfoTest, ExtensionRendererInfo); |
58 | 59 |
59 // static | 60 // static |
60 typedef std::map<std::string, scoped_refptr<const Extension> > ExtensionMap; | 61 typedef std::map<std::string, scoped_refptr<const Extension> > ExtensionMap; |
61 ExtensionMap extensions_; | 62 ExtensionMap extensions_; |
62 | 63 |
63 DISALLOW_COPY_AND_ASSIGN(ExtensionRendererInfo); | 64 DISALLOW_COPY_AND_ASSIGN(ExtensionRendererInfo); |
64 }; | 65 }; |
65 | 66 |
66 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_RENDERER_INFO_H_ | 67 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_RENDERER_INFO_H_ |
OLD | NEW |