summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-29 20:35:19 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-29 20:35:19 +0000
commitddd231eaa03153f6d04894cceb0b4480755e1277 (patch)
treefaafed02945c1f8934e6e393ac0c6b094c303cdf /chrome/browser/extensions
parentc5e30d8572ffae1e0d4fbb2fff765f9a8cbace77 (diff)
downloadchromium_src-ddd231eaa03153f6d04894cceb0b4480755e1277.zip
chromium_src-ddd231eaa03153f6d04894cceb0b4480755e1277.tar.gz
chromium_src-ddd231eaa03153f6d04894cceb0b4480755e1277.tar.bz2
Change a bunch of string types.
Started out just trying to change PrefService::GetString and ::SetString. This snowballed a little bit. Had to change a bunch of url strings in search_engines/ from wstring to string (some of them may be better off as GURLs, but UTF-8 is a step in the right direction, since that's what GURL uses internally, as well as externally via its setters/getters). TODO (later patch): things that ask for accepted languages should use std::string, not std::wstring. BUG=none TEST=try bots Review URL: http://codereview.chromium.org/2854015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extension_bookmarks_module.cc3
-rw-r--r--chrome/browser/extensions/extension_i18n_api.cc11
-rw-r--r--chrome/browser/extensions/extension_updater.cc10
-rw-r--r--chrome/browser/extensions/extension_updater_unittest.cc4
4 files changed, 13 insertions, 15 deletions
diff --git a/chrome/browser/extensions/extension_bookmarks_module.cc b/chrome/browser/extensions/extension_bookmarks_module.cc
index a07179e..0eb7a30 100644
--- a/chrome/browser/extensions/extension_bookmarks_module.cc
+++ b/chrome/browser/extensions/extension_bookmarks_module.cc
@@ -323,7 +323,8 @@ bool SearchBookmarksFunction::RunImpl() {
BookmarkModel* model = profile()->GetBookmarkModel();
ListValue* json = new ListValue();
- std::wstring lang = profile()->GetPrefs()->GetString(prefs::kAcceptLanguages);
+ std::wstring lang =
+ UTF8ToWide(profile()->GetPrefs()->GetString(prefs::kAcceptLanguages));
std::vector<const BookmarkNode*> nodes;
bookmark_utils::GetBookmarksContainingText(model, query,
std::numeric_limits<int>::max(),
diff --git a/chrome/browser/extensions/extension_i18n_api.cc b/chrome/browser/extensions/extension_i18n_api.cc
index c39b5d9..146e62a 100644
--- a/chrome/browser/extensions/extension_i18n_api.cc
+++ b/chrome/browser/extensions/extension_i18n_api.cc
@@ -1,21 +1,20 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// 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_i18n_api.h"
+#include "base/utf_string_conversions.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
#include "chrome/common/pref_names.h"
-namespace {
- // Errors.
- const char kEmptyAcceptLanguagesError[] = "accept-languages is empty.";
-} // namespace
+// Errors.
+static const char kEmptyAcceptLanguagesError[] = "accept-languages is empty.";
bool GetAcceptLanguagesFunction::RunImpl() {
std::wstring acceptLanguages =
- profile()->GetPrefs()->GetString(prefs::kAcceptLanguages);
+ UTF8ToWide(profile()->GetPrefs()->GetString(prefs::kAcceptLanguages));
// Currently, there are 2 ways to set browser's accept-languages: through UI
// or directly modify the preference file. The accept-languages set through
// UI is guranteed to be valid, and the accept-languages string returned from
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc
index 95177c6..c3b1907 100644
--- a/chrome/browser/extensions/extension_updater.cc
+++ b/chrome/browser/extensions/extension_updater.cc
@@ -577,7 +577,7 @@ void ExtensionUpdater::ProcessBlacklist(const std::string& data) {
// Update the pref value for blacklist version
prefs_->SetString(kExtensionBlacklistUpdateVersion,
- ASCIIToWide(current_extension_fetch_.version));
+ current_extension_fetch_.version);
prefs_->ScheduleSavePersistentPrefs();
}
@@ -693,11 +693,10 @@ void ExtensionUpdater::CheckNow() {
if (blacklist_checks_enabled_ && service_->HasInstalledExtensions()) {
ManifestFetchData* blacklist_fetch =
new ManifestFetchData(GURL(kBlacklistUpdateUrl));
- std::wstring version = prefs_->GetString(kExtensionBlacklistUpdateVersion);
+ std::string version = prefs_->GetString(kExtensionBlacklistUpdateVersion);
int ping_days =
CalculatePingDays(service_->extension_prefs()->BlacklistLastPingDay());
- blacklist_fetch->AddExtension(kBlacklistAppID, WideToASCII(version),
- ping_days);
+ blacklist_fetch->AddExtension(kBlacklistAppID, version, ping_days);
StartUpdateCheck(blacklist_fetch);
}
@@ -717,8 +716,7 @@ void ExtensionUpdater::CheckNow() {
bool ExtensionUpdater::GetExistingVersion(const std::string& id,
std::string* version) {
if (id == kBlacklistAppID) {
- *version =
- WideToASCII(prefs_->GetString(kExtensionBlacklistUpdateVersion));
+ *version = prefs_->GetString(kExtensionBlacklistUpdateVersion);
return true;
}
Extension* extension = service_->GetExtensionById(id, false);
diff --git a/chrome/browser/extensions/extension_updater_unittest.cc b/chrome/browser/extensions/extension_updater_unittest.cc
index 5266888..416a395 100644
--- a/chrome/browser/extensions/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/extension_updater_unittest.cc
@@ -625,8 +625,8 @@ class ExtensionUpdaterTest : public testing::Test {
// blacklist.
EXPECT_TRUE(service.processed_blacklist());
- EXPECT_EQ(version, WideToASCII(service.pref_service()->
- GetString(prefs::kExtensionBlacklistUpdateVersion)));
+ EXPECT_EQ(version, service.pref_service()->
+ GetString(prefs::kExtensionBlacklistUpdateVersion));
URLFetcher::set_factory(NULL);
}