| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "extensions/common/message_bundle.h" | 5 #include "extensions/common/message_bundle.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } else { | 109 } else { |
| 110 append_messages[kBidiDirectionKey] = "ltr"; | 110 append_messages[kBidiDirectionKey] = "ltr"; |
| 111 append_messages[kBidiReversedDirectionKey] = "rtl"; | 111 append_messages[kBidiReversedDirectionKey] = "rtl"; |
| 112 append_messages[kBidiStartEdgeKey] = kBidiLeftEdgeValue; | 112 append_messages[kBidiStartEdgeKey] = kBidiLeftEdgeValue; |
| 113 append_messages[kBidiEndEdgeKey] = kBidiRightEdgeValue; | 113 append_messages[kBidiEndEdgeKey] = kBidiRightEdgeValue; |
| 114 } | 114 } |
| 115 | 115 |
| 116 // Add all reserved messages to the dictionary, but check for collisions. | 116 // Add all reserved messages to the dictionary, but check for collisions. |
| 117 SubstitutionMap::iterator it = append_messages.begin(); | 117 SubstitutionMap::iterator it = append_messages.begin(); |
| 118 for (; it != append_messages.end(); ++it) { | 118 for (; it != append_messages.end(); ++it) { |
| 119 if (ContainsKey(dictionary_, it->first)) { | 119 if (base::ContainsKey(dictionary_, it->first)) { |
| 120 *error = ErrorUtils::FormatErrorMessage( | 120 *error = ErrorUtils::FormatErrorMessage( |
| 121 errors::kReservedMessageFound, it->first); | 121 errors::kReservedMessageFound, it->first); |
| 122 return false; | 122 return false; |
| 123 } else { | 123 } else { |
| 124 dictionary_[it->first] = it->second; | 124 dictionary_[it->first] = it->second; |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 return true; | 128 return true; |
| 129 } | 129 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 return &(it->second); | 337 return &(it->second); |
| 338 | 338 |
| 339 return NULL; | 339 return NULL; |
| 340 } | 340 } |
| 341 | 341 |
| 342 void EraseL10nMessagesMap(const std::string& extension_id) { | 342 void EraseL10nMessagesMap(const std::string& extension_id) { |
| 343 g_extension_to_messages_map.Get().messages_map.erase(extension_id); | 343 g_extension_to_messages_map.Get().messages_map.erase(extension_id); |
| 344 } | 344 } |
| 345 | 345 |
| 346 } // namespace extensions | 346 } // namespace extensions |
| OLD | NEW |