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

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

Issue 3207002: FBTF: Forward declare and move constructors in chrome/common/extensions/. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Win fixes Created 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension_message_bundle.cc
diff --git a/chrome/common/extensions/extension_message_bundle.cc b/chrome/common/extensions/extension_message_bundle.cc
index 8dd52750fd6be258f0a63d5409aa755af24777d8..4e6222fd88d8cfe9ed5bddca3a8bb5c3aeca7dfc 100644
--- a/chrome/common/extensions/extension_message_bundle.cc
+++ b/chrome/common/extensions/extension_message_bundle.cc
@@ -14,6 +14,7 @@
#include "base/scoped_ptr.h"
#include "base/singleton.h"
#include "base/stl_util-inl.h"
+#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/common/extensions/extension_constants.h"
@@ -211,6 +212,9 @@ bool ExtensionMessageBundle::ReplaceMessages(std::string* text,
return ReplaceMessagesWithExternalDictionary(dictionary_, text, error);
}
+ExtensionMessageBundle::~ExtensionMessageBundle() {
+}
+
// static
bool ExtensionMessageBundle::ReplaceMessagesWithExternalDictionary(
const SubstitutionMap& dictionary, std::string* text, std::string* error) {
@@ -270,6 +274,21 @@ bool ExtensionMessageBundle::ReplaceVariables(
return true;
}
+// static
+bool ExtensionMessageBundle::IsValidName(const std::string& name) {
+ if (name.empty())
+ return false;
+
+ std::string::const_iterator it = name.begin();
+ for (; it != name.end(); ++it) {
+ // Allow only ascii 0-9, a-z, A-Z, and _ in the name.
+ if (!IsAsciiAlpha(*it) && !IsAsciiDigit(*it) && *it != '_' && *it != '@')
+ return false;
+ }
+
+ return true;
+}
+
// Dictionary interface.
std::string ExtensionMessageBundle::GetL10nMessage(

Powered by Google App Engine
This is Rietveld 408576698