Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: extensions/common/message_bundle.cc

Issue 2236443003: extensions: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't add braces Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/common/manifest_handler.cc ('k') | extensions/common/permissions/api_permission_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698