| 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_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 /////////////////////////////////////////////////////////////////////////////// | 150 /////////////////////////////////////////////////////////////////////////////// |
| 151 | 151 |
| 152 // A map of message name to message. | 152 // A map of message name to message. |
| 153 typedef std::map<std::string, std::string> L10nMessagesMap; | 153 typedef std::map<std::string, std::string> L10nMessagesMap; |
| 154 | 154 |
| 155 // A map of extension ID to l10n message map. | 155 // A map of extension ID to l10n message map. |
| 156 typedef std::map<std::string, L10nMessagesMap > ExtensionToL10nMessagesMap; | 156 typedef std::map<std::string, L10nMessagesMap > ExtensionToL10nMessagesMap; |
| 157 | 157 |
| 158 // Unique class for Singleton. | 158 // Unique class for Singleton. |
| 159 struct ExtensionToMessagesMap { | 159 struct ExtensionToMessagesMap { |
| 160 ExtensionToMessagesMap(); |
| 161 ~ExtensionToMessagesMap(); |
| 162 |
| 160 // Maps extension ID to message map. | 163 // Maps extension ID to message map. |
| 161 ExtensionToL10nMessagesMap messages_map; | 164 ExtensionToL10nMessagesMap messages_map; |
| 162 }; | 165 }; |
| 163 | 166 |
| 164 // Returns the extension_id to messages map. | 167 // Returns the extension_id to messages map. |
| 165 ExtensionToL10nMessagesMap* GetExtensionToL10nMessagesMap(); | 168 ExtensionToL10nMessagesMap* GetExtensionToL10nMessagesMap(); |
| 166 | 169 |
| 167 // Returns message map that matches given extension_id, or NULL. | 170 // Returns message map that matches given extension_id, or NULL. |
| 168 L10nMessagesMap* GetL10nMessagesMap(const std::string extension_id); | 171 L10nMessagesMap* GetL10nMessagesMap(const std::string extension_id); |
| 169 | 172 |
| 170 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_ | 173 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_ |
| OLD | NEW |