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

Unified Diff: chrome/common/extensions/extension_message_bundle.cc

Issue 225009: Implementing chrome.i18n.getMessage call, that loads message from the extensi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension_message_bundle.cc
===================================================================
--- chrome/common/extensions/extension_message_bundle.cc (revision 27238)
+++ chrome/common/extensions/extension_message_bundle.cc (working copy)
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/extensions/extension_message_bundle.h"
+#include "chrome/common/extensions/extension_message_bundle.h"
#include <string>
@@ -246,9 +246,15 @@
std::string ExtensionMessageBundle::GetL10nMessage(
const std::string& name) const {
+ return GetL10nMessage(name, dictionary_);
+}
+
+// static
+std::string ExtensionMessageBundle::GetL10nMessage(
+ const std::string& name, const SubstitutionMap& dictionary) {
SubstitutionMap::const_iterator it =
- dictionary_.find(StringToLowerASCII(name));
- if (it != dictionary_.end()) {
+ dictionary.find(StringToLowerASCII(name));
+ if (it != dictionary.end()) {
return it->second;
}

Powered by Google App Engine
This is Rietveld 408576698