| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Renderer helper typedefs and functions. | 148 // Renderer helper typedefs and functions. |
| 149 // | 149 // |
| 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. | |
| 159 struct ExtensionToMessagesMap { | |
| 160 ExtensionToMessagesMap(); | |
| 161 ~ExtensionToMessagesMap(); | |
| 162 | |
| 163 // Maps extension ID to message map. | |
| 164 ExtensionToL10nMessagesMap messages_map; | |
| 165 }; | |
| 166 | |
| 167 // Returns the extension_id to messages map. | 158 // Returns the extension_id to messages map. |
| 168 ExtensionToL10nMessagesMap* GetExtensionToL10nMessagesMap(); | 159 ExtensionToL10nMessagesMap* GetExtensionToL10nMessagesMap(); |
| 169 | 160 |
| 170 // Returns message map that matches given extension_id, or NULL. | 161 // Returns message map that matches given extension_id, or NULL. |
| 171 L10nMessagesMap* GetL10nMessagesMap(const std::string extension_id); | 162 L10nMessagesMap* GetL10nMessagesMap(const std::string extension_id); |
| 172 | 163 |
| 173 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_ | 164 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_ |
| OLD | NEW |