summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 01:22:23 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 01:22:23 +0000
commite1cec06c06fb5a404a37b4d048d51b7d774f26f0 (patch)
treedd8293dc61881c39632d96c0fb692baebb48bda5 /chrome/browser/extensions
parent3f521a36f1a3cb1042822db29b4c75281357ba9e (diff)
downloadchromium_src-e1cec06c06fb5a404a37b4d048d51b7d774f26f0.zip
chromium_src-e1cec06c06fb5a404a37b4d048d51b7d774f26f0.tar.gz
chromium_src-e1cec06c06fb5a404a37b4d048d51b7d774f26f0.tar.bz2
Switch Extension over to UTF8 strings.
Value now stores everything internally as UTF8 strings, so I'm going around switching code over from wstring to string. Feel free to reject the change if you need wstring! Review URL: http://codereview.chromium.org/15020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7199 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extension.cc2
-rw-r--r--chrome/browser/extensions/extension.h16
-rw-r--r--chrome/browser/extensions/extensions_service_unittest.cc16
3 files changed, 17 insertions, 17 deletions
diff --git a/chrome/browser/extensions/extension.cc b/chrome/browser/extensions/extension.cc
index a11afb0..3c5dff0 100644
--- a/chrome/browser/extensions/extension.cc
+++ b/chrome/browser/extensions/extension.cc
@@ -73,7 +73,7 @@ bool Extension::InitFromValue(const DictionaryValue& source,
}
for (size_t i = 0; i < list_value->GetSize(); ++i) {
- std::wstring content_script;
+ std::string content_script;
if (!list_value->Get(i, &value) || !value->GetAsString(&content_script)) {
*error = kInvalidContentScriptError;
*error += IntToString(i);
diff --git a/chrome/browser/extensions/extension.h b/chrome/browser/extensions/extension.h
index 6b9ba52..691a0b7 100644
--- a/chrome/browser/extensions/extension.h
+++ b/chrome/browser/extensions/extension.h
@@ -45,16 +45,16 @@ class Extension {
// is expected to not change across versions. In the case of conflicts,
// updates will only be allowed if the extension can be validated using the
// previous version's update key.
- const std::wstring& id() const { return id_; }
+ const std::string& id() const { return id_; }
// A human-readable name of the extension.
- const std::wstring& name() const { return name_; }
+ const std::string& name() const { return name_; }
// An optional longer description of the extension.
- const std::wstring& description() const { return description_; }
+ const std::string& description() const { return description_; }
// Paths to the content scripts that the extension contains.
- const std::vector<std::wstring>& content_scripts() const {
+ const std::vector<std::string>& content_scripts() const {
return content_scripts_;
}
@@ -65,10 +65,10 @@ class Extension {
void CopyToValue(DictionaryValue* value);
private:
- std::wstring id_;
- std::wstring name_;
- std::wstring description_;
- std::vector<std::wstring> content_scripts_;
+ std::string id_;
+ std::string name_;
+ std::string description_;
+ std::vector<std::string> content_scripts_;
DISALLOW_COPY_AND_ASSIGN(Extension);
};
diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc
index d6dc00d..19794a1 100644
--- a/chrome/browser/extensions/extensions_service_unittest.cc
+++ b/chrome/browser/extensions/extensions_service_unittest.cc
@@ -95,23 +95,23 @@ TEST_F(ExtensionsServiceTest, LoadAllExtensionsFromDirectory) {
EXPECT_TRUE(frontend->errors()->size() >= 2u);
ASSERT_EQ(2u, frontend->extensions()->size());
- EXPECT_EQ(std::wstring(L"com.google.myextension1"),
+ EXPECT_EQ(std::string("com.google.myextension1"),
frontend->extensions()->at(0)->id());
- EXPECT_EQ(std::wstring(L"My extension 1"),
+ EXPECT_EQ(std::string("My extension 1"),
frontend->extensions()->at(0)->name());
- EXPECT_EQ(std::wstring(L"The first extension that I made."),
+ EXPECT_EQ(std::string("The first extension that I made."),
frontend->extensions()->at(0)->description());
ASSERT_EQ(2u, frontend->extensions()->at(0)->content_scripts().size());
- EXPECT_EQ(std::wstring(L"script1.user.js"),
+ EXPECT_EQ(std::string("script1.user.js"),
frontend->extensions()->at(0)->content_scripts().at(0));
- EXPECT_EQ(std::wstring(L"script2.user.js"),
+ EXPECT_EQ(std::string("script2.user.js"),
frontend->extensions()->at(0)->content_scripts().at(1));
- EXPECT_EQ(std::wstring(L"com.google.myextension2"),
+ EXPECT_EQ(std::string("com.google.myextension2"),
frontend->extensions()->at(1)->id());
- EXPECT_EQ(std::wstring(L"My extension 2"),
+ EXPECT_EQ(std::string("My extension 2"),
frontend->extensions()->at(1)->name());
- EXPECT_EQ(std::wstring(L""),
+ EXPECT_EQ(std::string(""),
frontend->extensions()->at(1)->description());
ASSERT_EQ(0u, frontend->extensions()->at(1)->content_scripts().size());
};