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_BROWSER_SYNC_TEST_INTEGRATION_SYNC_EXTENSION_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_EXTENSION_HELPER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_EXTENSION_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_EXTENSION_HELPER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 bool incognito_enabled; | 94 bool incognito_enabled; |
95 }; | 95 }; |
96 | 96 |
97 typedef std::map<std::string, ExtensionState> ExtensionStateMap; | 97 typedef std::map<std::string, ExtensionState> ExtensionStateMap; |
98 typedef std::map<std::string, scoped_refptr<extensions::Extension> > | 98 typedef std::map<std::string, scoped_refptr<extensions::Extension> > |
99 ExtensionNameMap; | 99 ExtensionNameMap; |
100 typedef std::map<Profile*, ExtensionNameMap> ProfileExtensionNameMap; | 100 typedef std::map<Profile*, ExtensionNameMap> ProfileExtensionNameMap; |
101 typedef std::map<std::string, std::string> StringMap; | 101 typedef std::map<std::string, std::string> StringMap; |
102 typedef std::map<std::string, extensions::Manifest::Type> TypeMap; | 102 typedef std::map<std::string, extensions::Manifest::Type> TypeMap; |
103 | 103 |
104 friend struct DefaultSingletonTraits<SyncExtensionHelper>; | 104 friend struct base::DefaultSingletonTraits<SyncExtensionHelper>; |
105 | 105 |
106 SyncExtensionHelper(); | 106 SyncExtensionHelper(); |
107 ~SyncExtensionHelper(); | 107 ~SyncExtensionHelper(); |
108 | 108 |
109 // Returns a map from |profile|'s installed extensions to their state. | 109 // Returns a map from |profile|'s installed extensions to their state. |
110 static ExtensionStateMap GetExtensionStates(Profile* profile); | 110 static ExtensionStateMap GetExtensionStates(Profile* profile); |
111 | 111 |
112 // Initializes extensions for |profile| and creates an entry in | 112 // Initializes extensions for |profile| and creates an entry in |
113 // |profile_extensions_| for it. | 113 // |profile_extensions_| for it. |
114 void SetupProfile(Profile* profile); | 114 void SetupProfile(Profile* profile); |
115 | 115 |
116 // Returns an extension for the given name in |profile|. type and | 116 // Returns an extension for the given name in |profile|. type and |
117 // index. Two extensions with the name but different profiles will | 117 // index. Two extensions with the name but different profiles will |
118 // have the same id. | 118 // have the same id. |
119 scoped_refptr<extensions::Extension> GetExtension( | 119 scoped_refptr<extensions::Extension> GetExtension( |
120 Profile* profile, const std::string& name, | 120 Profile* profile, const std::string& name, |
121 extensions::Manifest::Type type) WARN_UNUSED_RESULT; | 121 extensions::Manifest::Type type) WARN_UNUSED_RESULT; |
122 | 122 |
123 std::string extension_name_prefix_; | 123 std::string extension_name_prefix_; |
124 ProfileExtensionNameMap profile_extensions_; | 124 ProfileExtensionNameMap profile_extensions_; |
125 StringMap id_to_name_; | 125 StringMap id_to_name_; |
126 TypeMap id_to_type_; | 126 TypeMap id_to_type_; |
127 bool setup_completed_; | 127 bool setup_completed_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(SyncExtensionHelper); | 129 DISALLOW_COPY_AND_ASSIGN(SyncExtensionHelper); |
130 }; | 130 }; |
131 | 131 |
132 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_EXTENSION_HELPER_H_ | 132 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_EXTENSION_HELPER_H_ |
OLD | NEW |