summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-12 05:54:34 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-12 05:54:34 +0000
commite2194749382acb33e16f9cb312feea67ab8a61f5 (patch)
treeb7f3ab1cf6dece5b8b47993ac5f2e2a1961f5986 /chrome
parent0c71e930267d4542ea1b05636773927a79f5bab4 (diff)
downloadchromium_src-e2194749382acb33e16f9cb312feea67ab8a61f5.zip
chromium_src-e2194749382acb33e16f9cb312feea67ab8a61f5.tar.gz
chromium_src-e2194749382acb33e16f9cb312feea67ab8a61f5.tar.bz2
Remove wchar_t* methods from prefs.
BUG=23581 TEST=builds and passes tests Review URL: http://codereview.chromium.org/3136004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extension_dom_ui.cc4
-rw-r--r--chrome/browser/extensions/extension_dom_ui.h2
-rw-r--r--chrome/browser/extensions/extension_override_apitest.cc6
-rw-r--r--chrome/browser/extensions/extension_prefs.cc68
-rw-r--r--chrome/browser/extensions/extension_prefs.h6
-rw-r--r--chrome/browser/extensions/extensions_service_unittest.cc184
-rw-r--r--chrome/browser/gtk/options/languages_page_gtk.cc4
-rw-r--r--chrome/browser/language_combobox_model.cc2
-rw-r--r--chrome/browser/language_combobox_model.h2
-rw-r--r--chrome/browser/pref_service.cc189
-rw-r--r--chrome/browser/pref_service.h48
-rw-r--r--chrome/browser/views/chrome_views_delegate.cc39
-rw-r--r--chrome/browser/views/options/languages_page_view.cc8
-rw-r--r--chrome/browser/views/task_manager_view.cc9
-rw-r--r--chrome/common/extensions/extension.cc27
-rw-r--r--chrome/common/extensions/extension.h4
-rw-r--r--chrome/common/extensions/extension_constants.cc118
-rw-r--r--chrome/common/extensions/extension_constants.h120
-rw-r--r--chrome/common/extensions/extension_l10n_util.cc8
-rw-r--r--chrome/common/extensions/extension_l10n_util_unittest.cc4
-rw-r--r--chrome/common/extensions/extension_unittest.cc8
21 files changed, 309 insertions, 551 deletions
diff --git a/chrome/browser/extensions/extension_dom_ui.cc b/chrome/browser/extensions/extension_dom_ui.cc
index 4a5f24c..b23d12c 100644
--- a/chrome/browser/extensions/extension_dom_ui.cc
+++ b/chrome/browser/extensions/extension_dom_ui.cc
@@ -117,8 +117,8 @@ class ExtensionDOMUIImageLoadingTracker : public ImageLoadingTracker::Observer {
} // namespace
-const wchar_t ExtensionDOMUI::kExtensionURLOverrides[] =
- L"extensions.chrome_url_overrides";
+const char ExtensionDOMUI::kExtensionURLOverrides[] =
+ "extensions.chrome_url_overrides";
ExtensionDOMUI::ExtensionDOMUI(TabContents* tab_contents)
: DOMUI(tab_contents) {
diff --git a/chrome/browser/extensions/extension_dom_ui.h b/chrome/browser/extensions/extension_dom_ui.h
index 343a486..e0698e7 100644
--- a/chrome/browser/extensions/extension_dom_ui.h
+++ b/chrome/browser/extensions/extension_dom_ui.h
@@ -27,7 +27,7 @@ class ExtensionDOMUI
: public DOMUI,
public ExtensionFunctionDispatcher::Delegate {
public:
- static const wchar_t kExtensionURLOverrides[];
+ static const char kExtensionURLOverrides[];
explicit ExtensionDOMUI(TabContents* tab_contents);
diff --git a/chrome/browser/extensions/extension_override_apitest.cc b/chrome/browser/extensions/extension_override_apitest.cc
index 3063975..3e5369a 100644
--- a/chrome/browser/extensions/extension_override_apitest.cc
+++ b/chrome/browser/extensions/extension_override_apitest.cc
@@ -1,4 +1,4 @@
-// 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.
@@ -22,7 +22,7 @@ class ExtensionOverrideTest : public ExtensionApiTest {
ExtensionDOMUI::kExtensionURLOverrides);
ListValue* values = NULL;
- if (!overrides->GetList(L"history", &values))
+ if (!overrides->GetList("history", &values))
return false;
std::set<std::string> seen_overrides;
@@ -120,7 +120,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionOverrideTest, ShouldCleanUpDuplicateEntries) {
list->Append(Value::CreateStringValue("http://www.google.com/"));
browser()->profile()->GetPrefs()->GetMutableDictionary(
- ExtensionDOMUI::kExtensionURLOverrides)->Set(L"history", list);
+ ExtensionDOMUI::kExtensionURLOverrides)->Set("history", list);
ASSERT_FALSE(CheckHistoryOverridesContainsNoDupes());
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index f8dbc59..e987065 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -18,67 +18,68 @@ namespace {
// A preference that keeps track of per-extension settings. This is a dictionary
// object read from the Preferences file, keyed off of extension id's.
-const wchar_t kExtensionsPref[] = L"extensions.settings";
+const char kExtensionsPref[] = "extensions.settings";
// Where an extension was installed from. (see Extension::Location)
-const wchar_t kPrefLocation[] = L"location";
+const char kPrefLocation[] = "location";
// Enabled, disabled, killed, etc. (see Extension::State)
-const wchar_t kPrefState[] = L"state";
+const char kPrefState[] = "state";
// The path to the current version's manifest file.
-const wchar_t kPrefPath[] = L"path";
+const char kPrefPath[] = "path";
// The dictionary containing the extension's manifest.
-const wchar_t kPrefManifest[] = L"manifest";
+const char kPrefManifest[] = "manifest";
// The version number.
-const wchar_t kPrefVersion[] = L"manifest.version";
+const char kPrefVersion[] = "manifest.version";
// Indicates if an extension is blacklisted:
-const wchar_t kPrefBlacklist[] = L"blacklist";
+const char kPrefBlacklist[] = "blacklist";
// Indicates whether to show an install warning when the user enables.
-const wchar_t kExtensionDidEscalatePermissions[] = L"install_warning_on_enable";
+const char kExtensionDidEscalatePermissions[] = "install_warning_on_enable";
// A preference that tracks extension shelf configuration. This is a list
// object read from the Preferences file, containing a list of toolstrip URLs.
-const wchar_t kExtensionShelf[] = L"extensions.shelf";
+const char kExtensionShelf[] = "extensions.shelf";
// A preference that tracks admin policy regarding which extensions the user
// can and can not install. This preference is a list object, containing
// strings that list extension ids. Denylist can contain "*" meaning all
// extensions.
-const wchar_t kExtensionInstallAllowList[] = L"extensions.install.allowlist";
-const wchar_t kExtensionInstallDenyList[] = L"extensions.install.denylist";
+const char kExtensionInstallAllowList[] = "extensions.install.allowlist";
+const char kExtensionInstallDenyList[] = "extensions.install.denylist";
// A preference that tracks browser action toolbar configuration. This is a list
// object stored in the Preferences file. The extensions are stored by ID.
-const wchar_t kExtensionToolbar[] = L"extensions.toolbar";
+const char kExtensionToolbar[] = "extensions.toolbar";
// The key for a serialized Time value indicating the start of the day (from the
// server's perspective) an extension last included a "ping" parameter during
// its update check.
-const wchar_t kLastPingDay[] = L"lastpingday";
+const char kLastPingDay[] = "lastpingday";
// Path for settings specific to blacklist update.
-const wchar_t kExtensionsBlacklistUpdate[] = L"extensions.blacklistupdate";
+const char kExtensionsBlacklistUpdate[] = "extensions.blacklistupdate";
// Path and sub-keys for the idle install info dictionary preference.
-const wchar_t kIdleInstallInfo[] = L"idle_install_info";
-const wchar_t kIdleInstallInfoCrxPath[] = L"crx_path";
-const wchar_t kIdleInstallInfoVersion[] = L"version";
-const wchar_t kIdleInstallInfoFetchTime[] = L"fetch_time";
+const char kIdleInstallInfo[] = "idle_install_info";
+const char kIdleInstallInfoCrxPath[] = "crx_path";
+const char kIdleInstallInfoVersion[] = "version";
+const char kIdleInstallInfoFetchTime[] = "fetch_time";
// A preference that, if true, will allow this extension to run in incognito
// mode.
-const wchar_t kPrefIncognitoEnabled[] = L"incognito";
+const char kPrefIncognitoEnabled[] = "incognito";
// A preference to control whether an extension is allowed to inject script in
// pages with file URLs.
-const wchar_t kPrefAllowFileAccess[] = L"allowFileAccess";
-}
+const char kPrefAllowFileAccess[] = "allowFileAccess";
+
+} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -207,7 +208,7 @@ DictionaryValue* ExtensionPrefs::CopyCurrentExtensions() {
}
bool ExtensionPrefs::ReadBooleanFromPref(
- DictionaryValue* ext, const std::wstring& pref_key) {
+ DictionaryValue* ext, const std::string& pref_key) {
if (!ext->HasKey(pref_key)) return false;
bool bool_value = false;
if (!ext->GetBoolean(pref_key, &bool_value)) {
@@ -219,7 +220,7 @@ bool ExtensionPrefs::ReadBooleanFromPref(
}
bool ExtensionPrefs::ReadExtensionPrefBoolean(
- const std::string& extension_id, const std::wstring& pref_key) {
+ const std::string& extension_id, const std::string& pref_key) {
const DictionaryValue* extensions = prefs_->GetDictionary(kExtensionsPref);
if (!extensions)
return false;
@@ -574,15 +575,15 @@ FilePath ExtensionPrefs::GetExtensionPath(const std::string& extension_id) {
if (!dict || dict->empty())
return FilePath();
- std::wstring path;
- if (!dict->GetString(ASCIIToWide(extension_id) + L"." + kPrefPath, &path))
+ std::string path;
+ if (!dict->GetString(extension_id + "." + kPrefPath, &path))
return FilePath();
- return install_directory_.Append(FilePath::FromWStringHack(path));
+ return install_directory_.Append(FilePath::FromWStringHack(UTF8ToWide(path)));
}
void ExtensionPrefs::UpdateExtensionPref(const std::string& extension_id,
- const std::wstring& key,
+ const std::string& key,
Value* data_value) {
if (!Extension::IdIsValid(extension_id)) {
NOTREACHED() << "Invalid extension_id " << extension_id;
@@ -593,10 +594,9 @@ void ExtensionPrefs::UpdateExtensionPref(const std::string& extension_id,
}
void ExtensionPrefs::DeleteExtensionPrefs(const std::string& extension_id) {
- std::wstring id = ASCIIToWide(extension_id);
DictionaryValue* dict = prefs_->GetMutableDictionary(kExtensionsPref);
- if (dict->HasKey(id)) {
- dict->Remove(id, NULL);
+ if (dict->HasKey(extension_id)) {
+ dict->Remove(extension_id, NULL);
prefs_->ScheduleSavePersistentPrefs();
}
}
@@ -606,11 +606,10 @@ DictionaryValue* ExtensionPrefs::GetOrCreateExtensionPref(
DCHECK(Extension::IdIsValid(extension_id));
DictionaryValue* dict = prefs_->GetMutableDictionary(kExtensionsPref);
DictionaryValue* extension = NULL;
- std::wstring id = ASCIIToWide(extension_id);
- if (!dict->GetDictionary(id, &extension)) {
+ if (!dict->GetDictionary(extension_id, &extension)) {
// Extension pref does not exist, create it.
extension = new DictionaryValue();
- dict->Set(id, extension);
+ dict->Set(extension_id, extension);
}
return extension;
}
@@ -621,8 +620,7 @@ DictionaryValue* ExtensionPrefs::GetExtensionPref(
if (!dict)
return NULL;
DictionaryValue* extension = NULL;
- std::wstring id = ASCIIToWide(extension_id);
- dict->GetDictionary(id, &extension);
+ dict->GetDictionary(extension_id, &extension);
return extension;
}
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index f61cdc1..de900fe 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -163,7 +163,7 @@ class ExtensionPrefs {
// Sets the pref |key| for extension |id| to |value|.
void UpdateExtensionPref(const std::string& id,
- const std::wstring& key,
+ const std::string& key,
Value* value);
// Deletes the pref dictionary for extension |id|.
@@ -171,11 +171,11 @@ class ExtensionPrefs {
// Reads a boolean pref from |ext| with key |pref_key|.
// Return false if the value is false or kPrefBlacklist does not exist.
- bool ReadBooleanFromPref(DictionaryValue* ext, const std::wstring& pref_key);
+ bool ReadBooleanFromPref(DictionaryValue* ext, const std::string& pref_key);
// Reads a boolean pref |pref_key| from extension with id |extension_id|.
bool ReadExtensionPrefBoolean(const std::string& extension_id,
- const std::wstring& pref_key);
+ const std::string& pref_key);
// Ensures and returns a mutable dictionary for extension |id|'s prefs.
DictionaryValue* GetOrCreateExtensionPref(const std::string& id);
diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc
index 15e5eef..c23f451 100644
--- a/chrome/browser/extensions/extensions_service_unittest.cc
+++ b/chrome/browser/extensions/extensions_service_unittest.cc
@@ -159,7 +159,7 @@ class MockProviderVisitor : public ExternalExtensionProvider::Visitor {
Value* json_value = serializer.Deserialize(NULL, NULL);
if (!json_value || !json_value->IsType(Value::TYPE_DICTIONARY)) {
- NOTREACHED() << L"Unable to deserialize json data";
+ NOTREACHED() << "Unable to deserialize json data";
return -1;
} else {
DictionaryValue* external_extensions =
@@ -185,8 +185,8 @@ class MockProviderVisitor : public ExternalExtensionProvider::Visitor {
// This tests is to make sure that the provider only notifies us of the
// values we gave it. So if the id we doesn't exist in our internal
// dictionary then something is wrong.
- EXPECT_TRUE(prefs_->GetDictionary(ASCIIToWide(id), &pref))
- << L"Got back ID (" << id.c_str() << ") we weren't expecting";
+ EXPECT_TRUE(prefs_->GetDictionary(id, &pref))
+ << "Got back ID (" << id.c_str() << ") we weren't expecting";
if (pref) {
// Ask provider if the extension we got back is registered.
@@ -198,7 +198,7 @@ class MockProviderVisitor : public ExternalExtensionProvider::Visitor {
EXPECT_EQ(Extension::EXTERNAL_PREF, location);
// Remove it so we won't count it ever again.
- prefs_->Remove(ASCIIToWide(id), NULL);
+ prefs_->Remove(id, NULL);
}
}
@@ -485,26 +485,25 @@ class ExtensionsServiceTest
void ValidatePrefKeyCount(size_t count) {
DictionaryValue* dict =
- prefs_->GetMutableDictionary(L"extensions.settings");
+ prefs_->GetMutableDictionary("extensions.settings");
ASSERT_TRUE(dict != NULL);
EXPECT_EQ(count, dict->size());
}
void ValidateBooleanPref(const std::string& extension_id,
- const std::wstring& pref_path,
+ const std::string& pref_path,
bool expected_val) {
- std::wstring msg = L" while checking: ";
- msg += ASCIIToWide(extension_id);
- msg += L" ";
+ std::string msg = " while checking: ";
+ msg += extension_id;
+ msg += " ";
msg += pref_path;
- msg += L" == ";
- msg += expected_val ? L"true" : L"false";
+ msg += " == ";
+ msg += expected_val ? "true" : "false";
- const DictionaryValue* dict =
- prefs_->GetDictionary(L"extensions.settings");
+ const DictionaryValue* dict = prefs_->GetDictionary("extensions.settings");
ASSERT_TRUE(dict != NULL) << msg;
DictionaryValue* pref = NULL;
- ASSERT_TRUE(dict->GetDictionary(ASCIIToWide(extension_id), &pref)) << msg;
+ ASSERT_TRUE(dict->GetDictionary(extension_id, &pref)) << msg;
EXPECT_TRUE(pref != NULL) << msg;
bool val;
ASSERT_TRUE(pref->GetBoolean(pref_path, &val)) << msg;
@@ -512,12 +511,11 @@ class ExtensionsServiceTest
}
bool IsPrefExist(const std::string& extension_id,
- const std::wstring& pref_path) {
- const DictionaryValue* dict =
- prefs_->GetDictionary(L"extensions.settings");
+ const std::string& pref_path) {
+ const DictionaryValue* dict = prefs_->GetDictionary("extensions.settings");
if (dict == NULL) return false;
DictionaryValue* pref = NULL;
- if (!dict->GetDictionary(ASCIIToWide(extension_id), &pref)) {
+ if (!dict->GetDictionary(extension_id, &pref)) {
return false;
}
if (pref == NULL) {
@@ -531,20 +529,19 @@ class ExtensionsServiceTest
}
void ValidateIntegerPref(const std::string& extension_id,
- const std::wstring& pref_path,
+ const std::string& pref_path,
int expected_val) {
- std::wstring msg = L" while checking: ";
- msg += ASCIIToWide(extension_id);
- msg += L" ";
+ std::string msg = " while checking: ";
+ msg += extension_id;
+ msg += " ";
msg += pref_path;
- msg += L" == ";
- msg += UTF8ToWide(base::IntToString(expected_val));
+ msg += " == ";
+ msg += base::IntToString(expected_val);
- const DictionaryValue* dict =
- prefs_->GetDictionary(L"extensions.settings");
+ const DictionaryValue* dict = prefs_->GetDictionary("extensions.settings");
ASSERT_TRUE(dict != NULL) << msg;
DictionaryValue* pref = NULL;
- ASSERT_TRUE(dict->GetDictionary(ASCIIToWide(extension_id), &pref)) << msg;
+ ASSERT_TRUE(dict->GetDictionary(extension_id, &pref)) << msg;
EXPECT_TRUE(pref != NULL) << msg;
int val;
ASSERT_TRUE(pref->GetInteger(pref_path, &val)) << msg;
@@ -552,21 +549,20 @@ class ExtensionsServiceTest
}
void ValidateStringPref(const std::string& extension_id,
- const std::wstring& pref_path,
+ const std::string& pref_path,
const std::string& expected_val) {
- std::wstring msg = L" while checking: ";
- msg += ASCIIToWide(extension_id);
- msg += L".manifest.";
+ std::string msg = " while checking: ";
+ msg += extension_id;
+ msg += ".manifest.";
msg += pref_path;
- msg += L" == ";
- msg += ASCIIToWide(expected_val);
+ msg += " == ";
+ msg += expected_val;
- const DictionaryValue* dict =
- prefs_->GetDictionary(L"extensions.settings");
+ const DictionaryValue* dict = prefs_->GetDictionary("extensions.settings");
ASSERT_TRUE(dict != NULL) << msg;
DictionaryValue* pref = NULL;
std::string manifest_path = extension_id + ".manifest";
- ASSERT_TRUE(dict->GetDictionary(ASCIIToWide(manifest_path), &pref)) << msg;
+ ASSERT_TRUE(dict->GetDictionary(manifest_path, &pref)) << msg;
EXPECT_TRUE(pref != NULL) << msg;
std::string val;
ASSERT_TRUE(pref->GetString(pref_path, &val)) << msg;
@@ -574,20 +570,20 @@ class ExtensionsServiceTest
}
void SetPrefInteg(const std::string& extension_id,
- const std::wstring& pref_path,
+ const std::string& pref_path,
int value) {
- std::wstring msg = L" while setting: ";
- msg += ASCIIToWide(extension_id);
- msg += L" ";
+ std::string msg = " while setting: ";
+ msg += extension_id;
+ msg += " ";
msg += pref_path;
- msg += L" = ";
- msg += UTF8ToWide(base::IntToString(value));
+ msg += " = ";
+ msg += base::IntToString(value);
const DictionaryValue* dict =
- prefs_->GetMutableDictionary(L"extensions.settings");
+ prefs_->GetMutableDictionary("extensions.settings");
ASSERT_TRUE(dict != NULL) << msg;
DictionaryValue* pref = NULL;
- ASSERT_TRUE(dict->GetDictionary(ASCIIToWide(extension_id), &pref)) << msg;
+ ASSERT_TRUE(dict->GetDictionary(extension_id, &pref)) << msg;
EXPECT_TRUE(pref != NULL) << msg;
pref->SetInteger(pref_path, value);
}
@@ -680,12 +676,12 @@ TEST_F(ExtensionsServiceTest, LoadAllExtensionsFromDirectorySuccess) {
EXPECT_EQ(3u, service_->extensions()->size());
ValidatePrefKeyCount(3);
- ValidateIntegerPref(good0, L"state", Extension::ENABLED);
- ValidateIntegerPref(good0, L"location", Extension::INTERNAL);
- ValidateIntegerPref(good1, L"state", Extension::ENABLED);
- ValidateIntegerPref(good1, L"location", Extension::INTERNAL);
- ValidateIntegerPref(good2, L"state", Extension::ENABLED);
- ValidateIntegerPref(good2, L"location", Extension::INTERNAL);
+ ValidateIntegerPref(good0, "state", Extension::ENABLED);
+ ValidateIntegerPref(good0, "location", Extension::INTERNAL);
+ ValidateIntegerPref(good1, "state", Extension::ENABLED);
+ ValidateIntegerPref(good1, "location", Extension::INTERNAL);
+ ValidateIntegerPref(good2, "state", Extension::ENABLED);
+ ValidateIntegerPref(good2, "location", Extension::INTERNAL);
Extension* extension = loaded_[0];
const UserScriptList& scripts = extension->content_scripts();
@@ -811,9 +807,9 @@ TEST_F(ExtensionsServiceTest, CleanupOnStartup) {
InitializeInstalledExtensionsService(pref_path, source_install_dir);
// Simulate that one of them got partially deleted by clearing its pref.
- DictionaryValue* dict = prefs_->GetMutableDictionary(L"extensions.settings");
+ DictionaryValue* dict = prefs_->GetMutableDictionary("extensions.settings");
ASSERT_TRUE(dict != NULL);
- dict->Remove(L"behllobkkfkfnphdnhnkndlbkcpglgmj", NULL);
+ dict->Remove("behllobkkfkfnphdnhnkndlbkcpglgmj", NULL);
service_->Init();
loop_.RunAllPending();
@@ -858,15 +854,15 @@ TEST_F(ExtensionsServiceTest, InstallExtension) {
int pref_count = 0;
ValidatePrefKeyCount(++pref_count);
- ValidateIntegerPref(good_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(good_crx, L"location", Extension::INTERNAL);
+ ValidateIntegerPref(good_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(good_crx, "location", Extension::INTERNAL);
// An extension with page actions.
path = extensions_path.AppendASCII("page_action.crx");
InstallExtension(path, true);
ValidatePrefKeyCount(++pref_count);
- ValidateIntegerPref(page_action, L"state", Extension::ENABLED);
- ValidateIntegerPref(page_action, L"location", Extension::INTERNAL);
+ ValidateIntegerPref(page_action, "state", Extension::ENABLED);
+ ValidateIntegerPref(page_action, "location", Extension::INTERNAL);
// Bad signature.
path = extensions_path.AppendASCII("bad_signature.crx");
@@ -1095,8 +1091,8 @@ TEST_F(ExtensionsServiceTest, InstallTheme) {
InstallExtension(path, true);
int pref_count = 0;
ValidatePrefKeyCount(++pref_count);
- ValidateIntegerPref(theme_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(theme_crx, L"location", Extension::INTERNAL);
+ ValidateIntegerPref(theme_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(theme_crx, "location", Extension::INTERNAL);
// A theme when extensions are disabled. Themes can be installed, even when
// extensions are disabled.
@@ -1104,8 +1100,8 @@ TEST_F(ExtensionsServiceTest, InstallTheme) {
path = extensions_path.AppendASCII("theme2.crx");
InstallExtension(path, true);
ValidatePrefKeyCount(++pref_count);
- ValidateIntegerPref(theme2_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(theme2_crx, L"location", Extension::INTERNAL);
+ ValidateIntegerPref(theme2_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(theme2_crx, "location", Extension::INTERNAL);
// A theme with extension elements. Themes cannot have extension elements so
// this test should fail.
@@ -1166,8 +1162,8 @@ TEST_F(ExtensionsServiceTest, InstallApps) {
ValidatePrefKeyCount(++pref_count);
ASSERT_EQ(1u, service_->extensions()->size());
std::string id = service_->extensions()->at(0)->id();
- ValidateIntegerPref(id, L"state", Extension::ENABLED);
- ValidateIntegerPref(id, L"location", Extension::INTERNAL);
+ ValidateIntegerPref(id, "state", Extension::ENABLED);
+ ValidateIntegerPref(id, "location", Extension::INTERNAL);
// Another app with non-overlapping extent. Should succeed.
PackAndInstallExtension(extensions_path.AppendASCII("app2"), true);
@@ -1195,8 +1191,8 @@ TEST_F(ExtensionsServiceTest, Reinstall) {
ASSERT_EQ(1u, loaded_.size());
ASSERT_EQ(0u, GetErrors().size());
ValidatePrefKeyCount(1);
- ValidateIntegerPref(good_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(good_crx, L"location", Extension::INTERNAL);
+ ValidateIntegerPref(good_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(good_crx, "location", Extension::INTERNAL);
installed_ = NULL;
loaded_.clear();
@@ -1210,8 +1206,8 @@ TEST_F(ExtensionsServiceTest, Reinstall) {
ASSERT_EQ(1u, loaded_.size());
ASSERT_EQ(0u, GetErrors().size());
ValidatePrefKeyCount(1);
- ValidateIntegerPref(good_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(good_crx, L"location", Extension::INTERNAL);
+ ValidateIntegerPref(good_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(good_crx, "location", Extension::INTERNAL);
}
// Test upgrading a signed extension.
@@ -1526,10 +1522,10 @@ TEST_F(ExtensionsServiceTest, SetUnsetBlacklistInPrefs) {
loop_.RunAllPending();
// blacklist is set for good0,1,2
- ValidateBooleanPref(good0, L"blacklist", true);
- ValidateBooleanPref(good1, L"blacklist", true);
+ ValidateBooleanPref(good0, "blacklist", true);
+ ValidateBooleanPref(good1, "blacklist", true);
// invalid_id should not be inserted to pref.
- EXPECT_FALSE(IsPrefExist("invalid_id", L"blacklist"));
+ EXPECT_FALSE(IsPrefExist("invalid_id", "blacklist"));
// remove good1, add good2
blacklist.pop_back();
@@ -1537,10 +1533,10 @@ TEST_F(ExtensionsServiceTest, SetUnsetBlacklistInPrefs) {
service_->UpdateExtensionBlacklist(blacklist);
// only good0 and good1 should be set
- ValidateBooleanPref(good0, L"blacklist", true);
- EXPECT_FALSE(IsPrefExist(good1, L"blacklist"));
- ValidateBooleanPref(good2, L"blacklist", true);
- EXPECT_FALSE(IsPrefExist("invalid_id", L"blacklist"));
+ ValidateBooleanPref(good0, "blacklist", true);
+ EXPECT_FALSE(IsPrefExist(good1, "blacklist"));
+ ValidateBooleanPref(good2, "blacklist", true);
+ EXPECT_FALSE(IsPrefExist("invalid_id", "blacklist"));
}
// Unload installed extension from blacklist.
@@ -1564,7 +1560,7 @@ TEST_F(ExtensionsServiceTest, UnloadBlacklistedExtension) {
loop_.RunAllPending();
// Now, the good_crx is blacklisted.
- ValidateBooleanPref(good_crx, L"blacklist", true);
+ ValidateBooleanPref(good_crx, "blacklist", true);
EXPECT_EQ(0u, service_->extensions()->size());
// Remove good_crx from blacklist
@@ -1573,7 +1569,7 @@ TEST_F(ExtensionsServiceTest, UnloadBlacklistedExtension) {
// Make sure pref is updated
loop_.RunAllPending();
// blacklist value should not be set for good_crx
- EXPECT_FALSE(IsPrefExist(good_crx, L"blacklist"));
+ EXPECT_FALSE(IsPrefExist(good_crx, "blacklist"));
}
// Unload installed extension from blacklist.
@@ -1586,7 +1582,7 @@ TEST_F(ExtensionsServiceTest, BlacklistedExtensionWillNotInstall) {
loop_.RunAllPending();
// Now, the good_crx is blacklisted.
- ValidateBooleanPref(good_crx, L"blacklist", true);
+ ValidateBooleanPref(good_crx, "blacklist", true);
// We can not install good_crx.
FilePath extensions_path;
@@ -1596,7 +1592,7 @@ TEST_F(ExtensionsServiceTest, BlacklistedExtensionWillNotInstall) {
service_->InstallExtension(path);
loop_.RunAllPending();
EXPECT_EQ(0u, service_->extensions()->size());
- ValidateBooleanPref(good_crx, L"blacklist", true);
+ ValidateBooleanPref(good_crx, "blacklist", true);
}
// Test loading extensions from the profile directory, except
@@ -1621,7 +1617,7 @@ TEST_F(ExtensionsServiceTest, WillNotLoadBlacklistedExtensionsFromDirectory) {
// Make sure pref is updated
loop_.RunAllPending();
- ValidateBooleanPref(good0, L"blacklist", true);
+ ValidateBooleanPref(good0, "blacklist", true);
// Load extensions.
service_->Init();
@@ -1642,10 +1638,8 @@ TEST_F(ExtensionsServiceTest, WillNotLoadBlacklistedExtensionsFromDirectory) {
TEST_F(ExtensionsServiceTest, BlacklistedByPolicyWillNotInstall) {
InitializeEmptyExtensionsService();
- ListValue* whitelist = prefs_->GetMutableList(
- L"extensions.install.allowlist");
- ListValue* blacklist = prefs_->GetMutableList(
- L"extensions.install.denylist");
+ ListValue* whitelist = prefs_->GetMutableList("extensions.install.allowlist");
+ ListValue* blacklist = prefs_->GetMutableList("extensions.install.denylist");
ASSERT_TRUE(whitelist != NULL && blacklist != NULL);
// Blacklist everything.
@@ -1750,8 +1744,8 @@ TEST_F(ExtensionsServiceTest, UninstallExtension) {
EXPECT_TRUE(file_util::PathExists(extension_path));
ValidatePrefKeyCount(1);
- ValidateIntegerPref(good_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(good_crx, L"location", Extension::INTERNAL);
+ ValidateIntegerPref(good_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(good_crx, "location", Extension::INTERNAL);
// Uninstall it.
service_->UninstallExtension(extension_id, false);
@@ -1932,8 +1926,8 @@ void ExtensionsServiceTest::TestExternalProvider(
ASSERT_EQ(location, loaded_[0]->location());
ASSERT_EQ("1.0.0.0", loaded_[0]->version()->GetString());
ValidatePrefKeyCount(1);
- ValidateIntegerPref(good_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(good_crx, L"location", location);
+ ValidateIntegerPref(good_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(good_crx, "location", location);
// Reload extensions without changing anything. The extension should be
// loaded again.
@@ -1943,8 +1937,8 @@ void ExtensionsServiceTest::TestExternalProvider(
ASSERT_EQ(0u, GetErrors().size());
ASSERT_EQ(1u, loaded_.size());
ValidatePrefKeyCount(1);
- ValidateIntegerPref(good_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(good_crx, L"location", location);
+ ValidateIntegerPref(good_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(good_crx, "location", location);
// Now update the extension with a new version. We should get upgraded.
source_path = source_path.DirName().AppendASCII("good2.crx");
@@ -1957,8 +1951,8 @@ void ExtensionsServiceTest::TestExternalProvider(
ASSERT_EQ(1u, loaded_.size());
ASSERT_EQ("1.0.0.1", loaded_[0]->version()->GetString());
ValidatePrefKeyCount(1);
- ValidateIntegerPref(good_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(good_crx, L"location", location);
+ ValidateIntegerPref(good_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(good_crx, "location", location);
// Uninstall the extension and reload. Nothing should happen because the
// preference should prevent us from reinstalling.
@@ -1975,11 +1969,11 @@ void ExtensionsServiceTest::TestExternalProvider(
loop_.RunAllPending();
ASSERT_EQ(0u, loaded_.size());
ValidatePrefKeyCount(1);
- ValidateIntegerPref(good_crx, L"state", Extension::KILLBIT);
- ValidateIntegerPref(good_crx, L"location", location);
+ ValidateIntegerPref(good_crx, "state", Extension::KILLBIT);
+ ValidateIntegerPref(good_crx, "location", location);
// Now clear the preference and reinstall.
- SetPrefInteg(good_crx, L"state", Extension::ENABLED);
+ SetPrefInteg(good_crx, "state", Extension::ENABLED);
prefs_->ScheduleSavePersistentPrefs();
loaded_.clear();
@@ -1987,8 +1981,8 @@ void ExtensionsServiceTest::TestExternalProvider(
loop_.RunAllPending();
ASSERT_EQ(1u, loaded_.size());
ValidatePrefKeyCount(1);
- ValidateIntegerPref(good_crx, L"state", Extension::ENABLED);
- ValidateIntegerPref(good_crx, L"location", location);
+ ValidateIntegerPref(good_crx, "state", Extension::ENABLED);
+ ValidateIntegerPref(good_crx, "location", location);
// Now test an externally triggered uninstall (deleting the registry key or
// the pref entry).
diff --git a/chrome/browser/gtk/options/languages_page_gtk.cc b/chrome/browser/gtk/options/languages_page_gtk.cc
index 19c2d15..e39972f 100644
--- a/chrome/browser/gtk/options/languages_page_gtk.cc
+++ b/chrome/browser/gtk/options/languages_page_gtk.cc
@@ -321,7 +321,7 @@ void LanguagesPageGtk::NotifyPrefChanged(const std::string* pref_name) {
}
if (!pref_name || *pref_name == prefs::kSpellCheckDictionary) {
int index = dictionary_language_model_->GetSelectedLanguageIndex(
- UTF8ToWide(prefs::kSpellCheckDictionary));
+ prefs::kSpellCheckDictionary);
// If not found, fall back from "language-region" to "language".
if (index < 0) {
@@ -329,7 +329,7 @@ void LanguagesPageGtk::NotifyPrefChanged(const std::string* pref_name) {
dictionary_language_.SetValue(
SpellCheckCommon::GetLanguageFromLanguageRegion(lang_region));
index = dictionary_language_model_->GetSelectedLanguageIndex(
- UTF8ToWide(prefs::kSpellCheckDictionary));
+ prefs::kSpellCheckDictionary);
}
gtk_combo_box_set_active(GTK_COMBO_BOX(dictionary_language_combobox_),
diff --git a/chrome/browser/language_combobox_model.cc b/chrome/browser/language_combobox_model.cc
index 2d16a73..1745167 100644
--- a/chrome/browser/language_combobox_model.cc
+++ b/chrome/browser/language_combobox_model.cc
@@ -158,7 +158,7 @@ LanguageComboboxModel::LanguageComboboxModel(
// shouldn't be reflected in this combo box. We return -1 if the value in
// the pref doesn't map to a know language (possible if the user edited the
// prefs file manually).
-int LanguageComboboxModel::GetSelectedLanguageIndex(const std::wstring& prefs) {
+int LanguageComboboxModel::GetSelectedLanguageIndex(const std::string& prefs) {
PrefService* local_state;
if (!profile_)
local_state = g_browser_process->local_state();
diff --git a/chrome/browser/language_combobox_model.h b/chrome/browser/language_combobox_model.h
index f247af7..b30aa29 100644
--- a/chrome/browser/language_combobox_model.h
+++ b/chrome/browser/language_combobox_model.h
@@ -88,7 +88,7 @@ class LanguageComboboxModel : public LanguageList, public ComboboxModel {
// shouldn't be reflected in this combo box. We return -1 if the value in
// the pref doesn't map to a know language (possible if the user edited the
// prefs file manually).
- int GetSelectedLanguageIndex(const std::wstring& prefs);
+ int GetSelectedLanguageIndex(const std::string& prefs);
private:
// Profile.
diff --git a/chrome/browser/pref_service.cc b/chrome/browser/pref_service.cc
index 2a7dbe9..96964e9 100644
--- a/chrome/browser/pref_service.cc
+++ b/chrome/browser/pref_service.cc
@@ -176,34 +176,18 @@ void PrefService::RegisterBooleanPref(const char* path,
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterBooleanPref(const wchar_t* path, bool default_value) {
- RegisterBooleanPref(WideToUTF8(path).c_str(), default_value);
-}
-
void PrefService::RegisterIntegerPref(const char* path, int default_value) {
Preference* pref = new Preference(pref_value_store_.get(), path,
Value::CreateIntegerValue(default_value));
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterIntegerPref(const wchar_t* path, int default_value) {
- RegisterIntegerPref(WideToUTF8(path).c_str(), default_value);
-}
-
void PrefService::RegisterRealPref(const char* path, double default_value) {
Preference* pref = new Preference(pref_value_store_.get(), path,
Value::CreateRealValue(default_value));
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterRealPref(const wchar_t* path,
- double default_value) {
- RegisterRealPref(WideToUTF8(path).c_str(), default_value);
-}
-
void PrefService::RegisterStringPref(const char* path,
const std::string& default_value) {
Preference* pref = new Preference(pref_value_store_.get(), path,
@@ -211,12 +195,6 @@ void PrefService::RegisterStringPref(const char* path,
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterStringPref(const wchar_t* path,
- const std::string& default_value) {
- RegisterStringPref(WideToUTF8(path).c_str(), default_value);
-}
-
void PrefService::RegisterFilePathPref(const char* path,
const FilePath& default_value) {
Preference* pref = new Preference(pref_value_store_.get(), path,
@@ -224,34 +202,18 @@ void PrefService::RegisterFilePathPref(const char* path,
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterFilePathPref(const wchar_t* path,
- const FilePath& default_value) {
- RegisterFilePathPref(WideToUTF8(path).c_str(), default_value);
-}
-
void PrefService::RegisterListPref(const char* path) {
Preference* pref = new Preference(pref_value_store_.get(), path,
new ListValue);
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterListPref(const wchar_t* path) {
- RegisterListPref(WideToUTF8(path).c_str());
-}
-
void PrefService::RegisterDictionaryPref(const char* path) {
Preference* pref = new Preference(pref_value_store_.get(), path,
new DictionaryValue());
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterDictionaryPref(const wchar_t* path) {
- RegisterDictionaryPref(WideToUTF8(path).c_str());
-}
-
void PrefService::RegisterLocalizedBooleanPref(const char* path,
int locale_default_message_id) {
Preference* pref = new Preference(pref_value_store_.get(), path,
@@ -259,13 +221,6 @@ void PrefService::RegisterLocalizedBooleanPref(const char* path,
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterLocalizedBooleanPref(const wchar_t* path,
- int locale_default_message_id) {
- RegisterLocalizedBooleanPref(WideToUTF8(path).c_str(),
- locale_default_message_id);
-}
-
void PrefService::RegisterLocalizedIntegerPref(const char* path,
int locale_default_message_id) {
Preference* pref = new Preference(pref_value_store_.get(), path,
@@ -273,13 +228,6 @@ void PrefService::RegisterLocalizedIntegerPref(const char* path,
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterLocalizedIntegerPref(const wchar_t* path,
- int locale_default_message_id) {
- RegisterLocalizedIntegerPref(WideToUTF8(path).c_str(),
- locale_default_message_id);
-}
-
void PrefService::RegisterLocalizedRealPref(const char* path,
int locale_default_message_id) {
Preference* pref = new Preference(pref_value_store_.get(), path,
@@ -287,13 +235,6 @@ void PrefService::RegisterLocalizedRealPref(const char* path,
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterLocalizedRealPref(const wchar_t* path,
- int locale_default_message_id) {
- RegisterLocalizedRealPref(WideToUTF8(path).c_str(),
- locale_default_message_id);
-}
-
void PrefService::RegisterLocalizedStringPref(const char* path,
int locale_default_message_id) {
Preference* pref = new Preference(pref_value_store_.get(), path,
@@ -301,13 +242,6 @@ void PrefService::RegisterLocalizedStringPref(const char* path,
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterLocalizedStringPref(const wchar_t* path,
- int locale_default_message_id) {
- RegisterLocalizedStringPref(WideToUTF8(path).c_str(),
- locale_default_message_id);
-}
-
bool PrefService::GetBoolean(const char* path) const {
DCHECK(CalledOnValidThread());
@@ -323,11 +257,6 @@ bool PrefService::GetBoolean(const char* path) const {
return result;
}
-// TODO(viettrungluu): deprecate:
-bool PrefService::GetBoolean(const wchar_t* path) const {
- return GetBoolean(WideToUTF8(path).c_str());
-}
-
int PrefService::GetInteger(const char* path) const {
DCHECK(CalledOnValidThread());
@@ -343,11 +272,6 @@ int PrefService::GetInteger(const char* path) const {
return result;
}
-// TODO(viettrungluu): deprecate:
-int PrefService::GetInteger(const wchar_t* path) const {
- return GetInteger(WideToUTF8(path).c_str());
-}
-
double PrefService::GetReal(const char* path) const {
DCHECK(CalledOnValidThread());
@@ -363,11 +287,6 @@ double PrefService::GetReal(const char* path) const {
return result;
}
-// TODO(viettrungluu): deprecate:
-double PrefService::GetReal(const wchar_t* path) const {
- return GetReal(WideToUTF8(path).c_str());
-}
-
std::string PrefService::GetString(const char* path) const {
DCHECK(CalledOnValidThread());
@@ -383,11 +302,6 @@ std::string PrefService::GetString(const char* path) const {
return result;
}
-// TODO(viettrungluu): deprecate:
-std::string PrefService::GetString(const wchar_t* path) const {
- return GetString(WideToUTF8(path).c_str());
-}
-
FilePath PrefService::GetFilePath(const char* path) const {
DCHECK(CalledOnValidThread());
@@ -407,20 +321,10 @@ FilePath PrefService::GetFilePath(const char* path) const {
return FilePath(result);
}
-// TODO(viettrungluu): deprecate:
-FilePath PrefService::GetFilePath(const wchar_t* path) const {
- return GetFilePath(WideToUTF8(path).c_str());
-}
-
bool PrefService::HasPrefPath(const char* path) const {
return pref_value_store_->HasPrefPath(path);
}
-// TODO(viettrungluu): deprecate:
-bool PrefService::HasPrefPath(const wchar_t* path) const {
- return HasPrefPath(WideToUTF8(path).c_str());
-}
-
const PrefService::Preference* PrefService::FindPreference(
const char* pref_name) const {
DCHECK(CalledOnValidThread());
@@ -429,12 +333,6 @@ const PrefService::Preference* PrefService::FindPreference(
return it == prefs_.end() ? NULL : *it;
}
-// TODO(viettrungluu): deprecate:
-const PrefService::Preference* PrefService::FindPreference(
- const wchar_t* pref_name) const {
- return FindPreference(WideToUTF8(pref_name).c_str());
-}
-
bool PrefService::IsManagedPreference(const char* pref_name) const {
const Preference* pref = FindPreference(pref_name);
if (pref && pref->IsManaged()) {
@@ -443,11 +341,6 @@ bool PrefService::IsManagedPreference(const char* pref_name) const {
return false;
}
-// TODO(viettrungluu): deprecate:
-bool PrefService::IsManagedPreference(const wchar_t* pref_name) const {
- return IsManagedPreference(WideToUTF8(pref_name).c_str());
-}
-
void PrefService::FireObserversIfChanged(const char* path,
const Value* old_value) {
if (PrefIsChanged(path, old_value))
@@ -495,11 +388,6 @@ const DictionaryValue* PrefService::GetDictionary(const char* path) const {
return static_cast<const DictionaryValue*>(value);
}
-// TODO(viettrungluu): deprecate:
-const DictionaryValue* PrefService::GetDictionary(const wchar_t* path) const {
- return GetDictionary(WideToUTF8(path).c_str());
-}
-
const ListValue* PrefService::GetList(const char* path) const {
DCHECK(CalledOnValidThread());
@@ -514,11 +402,6 @@ const ListValue* PrefService::GetList(const char* path) const {
return static_cast<const ListValue*>(value);
}
-// TODO(viettrungluu): deprecate:
-const ListValue* PrefService::GetList(const wchar_t* path) const {
- return GetList(WideToUTF8(path).c_str());
-}
-
void PrefService::AddPrefObserver(const char* path,
NotificationObserver* obs) {
DCHECK(CalledOnValidThread());
@@ -553,12 +436,6 @@ void PrefService::AddPrefObserver(const char* path,
observer_list->AddObserver(obs);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::AddPrefObserver(const wchar_t* path,
- NotificationObserver* obs) {
- AddPrefObserver(WideToUTF8(path).c_str(), obs);
-}
-
void PrefService::RemovePrefObserver(const char* path,
NotificationObserver* obs) {
DCHECK(CalledOnValidThread());
@@ -572,12 +449,6 @@ void PrefService::RemovePrefObserver(const char* path,
observer_list->RemoveObserver(obs);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RemovePrefObserver(const wchar_t* path,
- NotificationObserver* obs) {
- RemovePrefObserver(WideToUTF8(path).c_str(), obs);
-}
-
void PrefService::RegisterPreference(Preference* pref) {
DCHECK(CalledOnValidThread());
@@ -605,11 +476,6 @@ void PrefService::ClearPref(const char* path) {
FireObservers(path);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::ClearPref(const wchar_t* path) {
- ClearPref(WideToUTF8(path).c_str());
-}
-
void PrefService::Set(const char* path, const Value& value) {
DCHECK(CalledOnValidThread());
@@ -641,11 +507,6 @@ void PrefService::Set(const char* path, const Value& value) {
FireObserversIfChanged(path, old_value.get());
}
-// TODO(viettrungluu): deprecate:
-void PrefService::Set(const wchar_t* path, const Value& value) {
- Set(WideToUTF8(path).c_str(), value);
-}
-
void PrefService::SetBoolean(const char* path, bool value) {
DCHECK(CalledOnValidThread());
@@ -670,11 +531,6 @@ void PrefService::SetBoolean(const char* path, bool value) {
FireObserversIfChanged(path, old_value.get());
}
-// TODO(viettrungluu): deprecate:
-void PrefService::SetBoolean(const wchar_t* path, bool value) {
- SetBoolean(WideToUTF8(path).c_str(), value);
-}
-
void PrefService::SetInteger(const char* path, int value) {
DCHECK(CalledOnValidThread());
@@ -699,11 +555,6 @@ void PrefService::SetInteger(const char* path, int value) {
FireObserversIfChanged(path, old_value.get());
}
-// TODO(viettrungluu): deprecate:
-void PrefService::SetInteger(const wchar_t* path, int value) {
- SetInteger(WideToUTF8(path).c_str(), value);
-}
-
void PrefService::SetReal(const char* path, double value) {
DCHECK(CalledOnValidThread());
@@ -728,11 +579,6 @@ void PrefService::SetReal(const char* path, double value) {
FireObserversIfChanged(path, old_value.get());
}
-// TODO(viettrungluu): deprecate:
-void PrefService::SetReal(const wchar_t* path, double value) {
- SetReal(WideToUTF8(path).c_str(), value);
-}
-
void PrefService::SetString(const char* path, const std::string& value) {
DCHECK(CalledOnValidThread());
@@ -757,11 +603,6 @@ void PrefService::SetString(const char* path, const std::string& value) {
FireObserversIfChanged(path, old_value.get());
}
-// TODO(viettrungluu): deprecate:
-void PrefService::SetString(const wchar_t* path, const std::string& value) {
- SetString(WideToUTF8(path).c_str(), value);
-}
-
void PrefService::SetFilePath(const char* path, const FilePath& value) {
DCHECK(CalledOnValidThread());
@@ -794,11 +635,6 @@ void PrefService::SetFilePath(const char* path, const FilePath& value) {
FireObserversIfChanged(path, old_value.get());
}
-// TODO(viettrungluu): deprecate:
-void PrefService::SetFilePath(const wchar_t* path, const FilePath& value) {
- SetFilePath(WideToUTF8(path).c_str(), value);
-}
-
void PrefService::SetInt64(const char* path, int64 value) {
DCHECK(CalledOnValidThread());
@@ -823,11 +659,6 @@ void PrefService::SetInt64(const char* path, int64 value) {
FireObserversIfChanged(path, old_value.get());
}
-// TODO(viettrungluu): deprecate:
-void PrefService::SetInt64(const wchar_t* path, int64 value) {
- SetInt64(WideToUTF8(path).c_str(), value);
-}
-
int64 PrefService::GetInt64(const char* path) const {
DCHECK(CalledOnValidThread());
@@ -845,22 +676,12 @@ int64 PrefService::GetInt64(const char* path) const {
return val;
}
-// TODO(viettrungluu): deprecate:
-int64 PrefService::GetInt64(const wchar_t* path) const {
- return GetInt64(WideToUTF8(path).c_str());
-}
-
void PrefService::RegisterInt64Pref(const char* path, int64 default_value) {
Preference* pref = new Preference(pref_value_store_.get(), path,
Value::CreateStringValue(base::Int64ToString(default_value)));
RegisterPreference(pref);
}
-// TODO(viettrungluu): deprecate:
-void PrefService::RegisterInt64Pref(const wchar_t* path, int64 default_value) {
- RegisterInt64Pref(WideToUTF8(path).c_str(), default_value);
-}
-
DictionaryValue* PrefService::GetMutableDictionary(const char* path) {
DCHECK(CalledOnValidThread());
@@ -886,11 +707,6 @@ DictionaryValue* PrefService::GetMutableDictionary(const char* path) {
return dict;
}
-// TODO(viettrungluu): deprecate:
-DictionaryValue* PrefService::GetMutableDictionary(const wchar_t* path) {
- return GetMutableDictionary(WideToUTF8(path).c_str());
-}
-
ListValue* PrefService::GetMutableList(const char* path) {
DCHECK(CalledOnValidThread());
@@ -915,11 +731,6 @@ ListValue* PrefService::GetMutableList(const char* path) {
return list;
}
-// TODO(viettrungluu): deprecate:
-ListValue* PrefService::GetMutableList(const wchar_t* path) {
- return GetMutableList(WideToUTF8(path).c_str());
-}
-
Value* PrefService::GetPrefCopy(const char* path) {
DCHECK(CalledOnValidThread());
diff --git a/chrome/browser/pref_service.h b/chrome/browser/pref_service.h
index 58e5ea9..53a8523 100644
--- a/chrome/browser/pref_service.h
+++ b/chrome/browser/pref_service.h
@@ -128,7 +128,6 @@ class PrefService : public NonThreadSafe,
// Returns true if the preference for the given preference name is available
// and is managed.
bool IsManagedPreference(const char* pref_name) const;
- /*DEPRECATED*/bool IsManagedPreference(const wchar_t* pref_name) const;
// Writes the data to disk. The return value only reflects whether
// serialization was successful; we don't know whether the data actually made
@@ -148,18 +147,6 @@ class PrefService : public NonThreadSafe,
void RegisterFilePathPref(const char* path, const FilePath& default_value);
void RegisterListPref(const char* path);
void RegisterDictionaryPref(const char* path);
- /*DEPRECATED*/void RegisterBooleanPref(const wchar_t* path,
- bool default_value);
- /*DEPRECATED*/void RegisterIntegerPref(const wchar_t* path,
- int default_value);
- /*DEPRECATED*/void RegisterRealPref(const wchar_t* path,
- double default_value);
- /*DEPRECATED*/void RegisterStringPref(const wchar_t* path,
- const std::string& default_value);
- /*DEPRECATED*/void RegisterFilePathPref(const wchar_t* path,
- const FilePath& default_value);
- /*DEPRECATED*/void RegisterListPref(const wchar_t* path);
- /*DEPRECATED*/void RegisterDictionaryPref(const wchar_t* path);
// These varients use a default value from the locale dll instead.
void RegisterLocalizedBooleanPref(const char* path,
@@ -170,14 +157,6 @@ class PrefService : public NonThreadSafe,
int locale_default_message_id);
void RegisterLocalizedStringPref(const char* path,
int locale_default_message_id);
- /*DEPRECATED*/void RegisterLocalizedBooleanPref(const wchar_t* path,
- int locale_default_message_id);
- /*DEPRECATED*/void RegisterLocalizedIntegerPref(const wchar_t* path,
- int locale_default_message_id);
- /*DEPRECATED*/void RegisterLocalizedRealPref(const wchar_t* path,
- int locale_default_message_id);
- /*DEPRECATED*/void RegisterLocalizedStringPref(const wchar_t* path,
- int locale_default_message_id);
// If the path is valid and the value at the end of the path matches the type
// specified, it will return the specified value. Otherwise, the default
@@ -187,31 +166,19 @@ class PrefService : public NonThreadSafe,
double GetReal(const char* path) const;
std::string GetString(const char* path) const;
FilePath GetFilePath(const char* path) const;
- /*DEPRECATED*/bool GetBoolean(const wchar_t* path) const;
- /*DEPRECATED*/int GetInteger(const wchar_t* path) const;
- /*DEPRECATED*/double GetReal(const wchar_t* path) const;
- /*DEPRECATED*/std::string GetString(const wchar_t* path) const;
- /*DEPRECATED*/FilePath GetFilePath(const wchar_t* path) const;
// Returns the branch if it exists. If it's not a branch or the branch does
// not exist, returns NULL.
const DictionaryValue* GetDictionary(const char* path) const;
const ListValue* GetList(const char* path) const;
- /*DEPRECATED*/const DictionaryValue* GetDictionary(const wchar_t* path) const;
- /*DEPRECATED*/const ListValue* GetList(const wchar_t* path) const;
// If the pref at the given path changes, we call the observer's Observe
// method with NOTIFY_PREF_CHANGED.
virtual void AddPrefObserver(const char* path, NotificationObserver* obs);
void RemovePrefObserver(const char* path, NotificationObserver* obs);
- /*DEPRECATED*/virtual void AddPrefObserver(const wchar_t* path,
- NotificationObserver* obs);
- /*DEPRECATED*/void RemovePrefObserver(const wchar_t* path,
- NotificationObserver* obs);
// Removes a user pref and restores the pref to its default value.
void ClearPref(const char* path);
- /*DEPRECATED*/void ClearPref(const wchar_t* path);
// If the path is valid (i.e., registered), update the pref value in the user
// prefs.
@@ -221,12 +188,6 @@ class PrefService : public NonThreadSafe,
void SetReal(const char* path, double value);
void SetString(const char* path, const std::string& value);
void SetFilePath(const char* path, const FilePath& value);
- /*DEPRECATED*/void Set(const wchar_t* path, const Value& value);
- /*DEPRECATED*/void SetBoolean(const wchar_t* path, bool value);
- /*DEPRECATED*/void SetInteger(const wchar_t* path, int value);
- /*DEPRECATED*/void SetReal(const wchar_t* path, double value);
- /*DEPRECATED*/void SetString(const wchar_t* path, const std::string& value);
- /*DEPRECATED*/void SetFilePath(const wchar_t* path, const FilePath& value);
// Int64 helper methods that actually store the given value as a string.
// Note that if obtaining the named value via GetDictionary or GetList, the
@@ -234,10 +195,6 @@ class PrefService : public NonThreadSafe,
void SetInt64(const char* path, int64 value);
int64 GetInt64(const char* path) const;
void RegisterInt64Pref(const char* path, int64 default_value);
- /*DEPRECATED*/void SetInt64(const wchar_t* path, int64 value);
- /*DEPRECATED*/int64 GetInt64(const wchar_t* path) const;
- /*DEPRECATED*/void RegisterInt64Pref(const wchar_t* path,
- int64 default_value);
// Used to set the value of dictionary or list values in the pref tree. This
// will create a dictionary or list if one does not exist in the pref tree.
@@ -248,15 +205,12 @@ class PrefService : public NonThreadSafe,
// Use a ScopedPrefUpdate to update observers on changes.
DictionaryValue* GetMutableDictionary(const char* path);
ListValue* GetMutableList(const char* path);
- /*DEPRECATED*/DictionaryValue* GetMutableDictionary(const wchar_t* path);
- /*DEPRECATED*/ListValue* GetMutableList(const wchar_t* path);
// Returns true if a value has been set for the specified path.
// NOTE: this is NOT the same as FindPreference. In particular
// FindPreference returns whether RegisterXXX has been invoked, where as
// this checks if a value exists for the path.
bool HasPrefPath(const char* path) const;
- /*DEPRECATED*/bool HasPrefPath(const wchar_t* path) const;
class PreferencePathComparator {
public:
@@ -270,8 +224,6 @@ class PrefService : public NonThreadSafe,
// A helper method to quickly look up a preference. Returns NULL if the
// preference is not registered.
const Preference* FindPreference(const char* pref_name) const;
- /*DEPRECATED*/const Preference* FindPreference(
- const wchar_t* pref_name) const;
// For the given pref_name, fire any observer of the pref only if |old_value|
// is different from the current value. Virtual so it can be mocked for a
diff --git a/chrome/browser/views/chrome_views_delegate.cc b/chrome/browser/views/chrome_views_delegate.cc
index de824db..d56748e 100644
--- a/chrome/browser/views/chrome_views_delegate.cc
+++ b/chrome/browser/views/chrome_views_delegate.cc
@@ -1,4 +1,4 @@
-// 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.
@@ -6,6 +6,7 @@
#include "app/clipboard/clipboard.h"
#include "base/scoped_ptr.h"
+#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/views/accessibility_event_router_views.h"
@@ -31,21 +32,21 @@ void ChromeViewsDelegate::SaveWindowPlacement(const std::wstring& window_name,
DictionaryValue* window_preferences =
g_browser_process->local_state()->GetMutableDictionary(
- window_name.c_str());
- window_preferences->SetInteger(L"left", bounds.x());
- window_preferences->SetInteger(L"top", bounds.y());
- window_preferences->SetInteger(L"right", bounds.right());
- window_preferences->SetInteger(L"bottom", bounds.bottom());
- window_preferences->SetBoolean(L"maximized", maximized);
+ WideToUTF8(window_name).c_str());
+ window_preferences->SetInteger("left", bounds.x());
+ window_preferences->SetInteger("top", bounds.y());
+ window_preferences->SetInteger("right", bounds.right());
+ window_preferences->SetInteger("bottom", bounds.bottom());
+ window_preferences->SetBoolean("maximized", maximized);
scoped_ptr<WindowSizer::MonitorInfoProvider> monitor_info_provider(
WindowSizer::CreateDefaultMonitorInfoProvider());
gfx::Rect work_area(
monitor_info_provider->GetMonitorWorkAreaMatching(bounds));
- window_preferences->SetInteger(L"work_area_left", work_area.x());
- window_preferences->SetInteger(L"work_area_top", work_area.y());
- window_preferences->SetInteger(L"work_area_right", work_area.right());
- window_preferences->SetInteger(L"work_area_bottom", work_area.bottom());
+ window_preferences->SetInteger("work_area_left", work_area.x());
+ window_preferences->SetInteger("work_area_top", work_area.y());
+ window_preferences->SetInteger("work_area_right", work_area.right());
+ window_preferences->SetInteger("work_area_bottom", work_area.bottom());
}
bool ChromeViewsDelegate::GetSavedWindowBounds(const std::wstring& window_name,
@@ -54,12 +55,13 @@ bool ChromeViewsDelegate::GetSavedWindowBounds(const std::wstring& window_name,
return false;
const DictionaryValue* dictionary =
- g_browser_process->local_state()->GetDictionary(window_name.c_str());
+ g_browser_process->local_state()->GetDictionary(
+ WideToUTF8(window_name).c_str());
int left, top, right, bottom;
- if (!dictionary || !dictionary->GetInteger(L"left", &left) ||
- !dictionary->GetInteger(L"top", &top) ||
- !dictionary->GetInteger(L"right", &right) ||
- !dictionary->GetInteger(L"bottom", &bottom))
+ if (!dictionary || !dictionary->GetInteger("left", &left) ||
+ !dictionary->GetInteger("top", &top) ||
+ !dictionary->GetInteger("right", &right) ||
+ !dictionary->GetInteger("bottom", &bottom))
return false;
bounds->SetRect(left, top, right - left, bottom - top);
@@ -73,8 +75,9 @@ bool ChromeViewsDelegate::GetSavedMaximizedState(
return false;
const DictionaryValue* dictionary =
- g_browser_process->local_state()->GetDictionary(window_name.c_str());
- return dictionary && dictionary->GetBoolean(L"maximized", maximized) &&
+ g_browser_process->local_state()->GetDictionary(
+ WideToUTF8(window_name).c_str());
+ return dictionary && dictionary->GetBoolean("maximized", maximized) &&
maximized;
}
diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc
index 8a2df06..68db592 100644
--- a/chrome/browser/views/options/languages_page_view.cc
+++ b/chrome/browser/views/options/languages_page_view.cc
@@ -1,4 +1,4 @@
-// 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.
@@ -405,7 +405,7 @@ void LanguagesPageView::NotifyPrefChanged(const std::string* pref_name) {
}
if (!pref_name || *pref_name == prefs::kApplicationLocale) {
int index = ui_language_model_->GetSelectedLanguageIndex(
- UTF8ToWide(prefs::kApplicationLocale));
+ prefs::kApplicationLocale);
if (-1 == index) {
// The pref value for locale isn't valid. Use the current app locale
// (which is what we're currently using).
@@ -418,7 +418,7 @@ void LanguagesPageView::NotifyPrefChanged(const std::string* pref_name) {
}
if (!pref_name || *pref_name == prefs::kSpellCheckDictionary) {
int index = dictionary_language_model_->GetSelectedLanguageIndex(
- UTF8ToWide(prefs::kSpellCheckDictionary));
+ prefs::kSpellCheckDictionary);
// If the index for the current language cannot be found, it is due to
// the fact that the pref-member value for the last dictionary language
@@ -435,7 +435,7 @@ void LanguagesPageView::NotifyPrefChanged(const std::string* pref_name) {
dictionary_language_.SetValue(
SpellCheckCommon::GetLanguageFromLanguageRegion(lang_region));
index = dictionary_language_model_->GetSelectedLanguageIndex(
- UTF8ToWide(prefs::kSpellCheckDictionary));
+ prefs::kSpellCheckDictionary);
}
change_dictionary_language_combobox_->SetSelectedItem(index);
diff --git a/chrome/browser/views/task_manager_view.cc b/chrome/browser/views/task_manager_view.cc
index b83c42b..59142c3 100644
--- a/chrome/browser/views/task_manager_view.cc
+++ b/chrome/browser/views/task_manager_view.cc
@@ -540,8 +540,8 @@ bool TaskManagerView::ExecuteWindowsCommand(int command_id) {
if (g_browser_process->local_state()) {
DictionaryValue* window_preferences =
g_browser_process->local_state()->GetMutableDictionary(
- GetWindowName().c_str());
- window_preferences->SetBoolean(L"always_on_top", is_always_on_top_);
+ WideToUTF8(GetWindowName()).c_str());
+ window_preferences->SetBoolean("always_on_top", is_always_on_top_);
}
return true;
}
@@ -673,9 +673,10 @@ bool TaskManagerView::GetSavedAlwaysOnTopState(bool* always_on_top) const {
return false;
const DictionaryValue* dictionary =
- g_browser_process->local_state()->GetDictionary(GetWindowName().c_str());
+ g_browser_process->local_state()->GetDictionary(
+ WideToUTF8(GetWindowName()).c_str());
return dictionary &&
- dictionary->GetBoolean(L"always_on_top", always_on_top) && always_on_top;
+ dictionary->GetBoolean("always_on_top", always_on_top) && always_on_top;
}
} // namespace
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index acb88f4..f494c67 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -81,7 +81,7 @@ const FilePath::CharType Extension::kMessagesFilename[] =
FILE_PATH_LITERAL("messages.json");
// A list of all the keys allowed by themes.
-static const wchar_t* kValidThemeKeys[] = {
+static const char* kValidThemeKeys[] = {
keys::kCurrentLocale,
keys::kDefaultLocale,
keys::kDescription,
@@ -362,7 +362,7 @@ bool Extension::LoadUserScriptHelper(const DictionaryValue* content_script,
bool Extension::LoadGlobsHelper(
const DictionaryValue* content_script,
int content_script_index,
- const wchar_t* globs_property_name,
+ const char* globs_property_name,
std::string* error,
void(UserScript::*add_method)(const std::string& glob),
UserScript *instance) {
@@ -373,7 +373,7 @@ bool Extension::LoadGlobsHelper(
if (!content_script->GetList(globs_property_name, &list)) {
*error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidGlobList,
base::IntToString(content_script_index),
- WideToUTF8(globs_property_name));
+ globs_property_name);
return false;
}
@@ -382,7 +382,7 @@ bool Extension::LoadGlobsHelper(
if (!list->GetString(i, &glob)) {
*error = ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidGlob,
base::IntToString(content_script_index),
- WideToUTF8(globs_property_name),
+ globs_property_name,
base::IntToString(i));
return false;
}
@@ -457,7 +457,7 @@ ExtensionAction* Extension::LoadExtensionActionHelper(
result->SetTitle(ExtensionAction::kDefaultTabId, title);
// Read the action's |popup| (optional).
- const wchar_t* popup_key = NULL;
+ const char* popup_key = NULL;
if (extension_action->HasKey(keys::kPageActionDefaultPopup))
popup_key = keys::kPageActionDefaultPopup;
@@ -467,8 +467,8 @@ ExtensionAction* Extension::LoadExtensionActionHelper(
if (popup_key) {
*error = ExtensionErrorUtils::FormatErrorMessage(
errors::kInvalidPageActionOldAndNewKeys,
- WideToASCII(keys::kPageActionDefaultPopup),
- WideToASCII(keys::kPageActionPopup));
+ keys::kPageActionDefaultPopup,
+ keys::kPageActionPopup);
return NULL;
}
popup_key = keys::kPageActionPopup;
@@ -517,8 +517,7 @@ bool Extension::ContainsNonThemeKeys(const DictionaryValue& source) {
static bool theme_key_mapped = false;
if (!theme_key_mapped) {
for (size_t i = 0; i < arraysize(kValidThemeKeys); ++i) {
- // TODO(viettrungluu): Make the constants |char*|s and avoid converting.
- theme_keys[WideToUTF8(kValidThemeKeys[i])] = true;
+ theme_keys[kValidThemeKeys[i]] = true;
}
theme_key_mapped = true;
}
@@ -549,7 +548,7 @@ bool Extension::LoadIsApp(const DictionaryValue* manifest,
}
bool Extension::LoadExtent(const DictionaryValue* manifest,
- const wchar_t* key,
+ const char* key,
ExtensionExtent* extent,
const char* list_error,
const char* value_error,
@@ -996,13 +995,13 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
}
// Initialize name.
- std::wstring localized_name;
+ string16 localized_name;
if (!source.GetString(keys::kName, &localized_name)) {
*error = errors::kInvalidName;
return false;
}
base::i18n::AdjustStringForLocaleDirection(localized_name, &localized_name);
- name_ = WideToUTF8(localized_name);
+ name_ = UTF16ToUTF8(localized_name);
// Initialize description (if present).
if (source.HasKey(keys::kDescription)) {
@@ -1081,12 +1080,12 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
}
for (size_t i = 0; i < arraysize(kIconSizes); ++i) {
- std::wstring key = ASCIIToWide(base::IntToString(kIconSizes[i]));
+ std::string key = base::IntToString(kIconSizes[i]);
if (icons_value->HasKey(key)) {
std::string icon_path;
if (!icons_value->GetString(key, &icon_path)) {
*error = ExtensionErrorUtils::FormatErrorMessage(
- errors::kInvalidIconPath, WideToASCII(key));
+ errors::kInvalidIconPath, key);
return false;
}
icons_[kIconSizes[i]] = icon_path;
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 9f3ca6c..d4ffbdb 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -410,14 +410,14 @@ class Extension {
// from an entry in the content_script lists of the manifest.
bool LoadGlobsHelper(const DictionaryValue* content_script,
int content_script_index,
- const wchar_t* globs_property_name,
+ const char* globs_property_name,
std::string* error,
void(UserScript::*add_method)(const std::string& glob),
UserScript *instance);
// Helpers to load various chunks of the manifest.
bool LoadIsApp(const DictionaryValue* manifest, std::string* error);
- bool LoadExtent(const DictionaryValue* manifest, const wchar_t* key,
+ bool LoadExtent(const DictionaryValue* manifest, const char* key,
ExtensionExtent* extent, const char* list_error,
const char* value_error, std::string* error);
bool LoadLaunchContainer(const DictionaryValue* manifest, std::string* error);
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index ce4d74f..8c306c7 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -6,65 +6,65 @@
namespace extension_manifest_keys {
-const wchar_t* kAllFrames = L"all_frames";
-const wchar_t* kApp = L"app";
-const wchar_t* kBackground = L"background_page";
-const wchar_t* kBrowserAction = L"browser_action";
-const wchar_t* kBrowseURLs = L"app.browse_urls";
-const wchar_t* kChromeURLOverrides = L"chrome_url_overrides";
-const wchar_t* kContentScripts = L"content_scripts";
-const wchar_t* kConvertedFromUserScript = L"converted_from_user_script";
-const wchar_t* kCss = L"css";
-const wchar_t* kCurrentLocale = L"current_locale";
-const wchar_t* kDefaultLocale = L"default_locale";
-const wchar_t* kDescription = L"description";
-const wchar_t* kDevToolsPage = L"devtools_page";
-const wchar_t* kExcludeGlobs = L"exclude_globs";
-const wchar_t* kIcons = L"icons";
-const wchar_t* kIncludeGlobs = L"include_globs";
-const wchar_t* kJs = L"js";
-const wchar_t* kLaunch = L"app.launch";
-const wchar_t* kLaunchContainer = L"app.launch.container";
-const wchar_t* kLaunchFullscreen = L"app.launch.fullscreen";
-const wchar_t* kLaunchHeight = L"app.launch.height";
-const wchar_t* kLaunchLocalPath = L"app.launch.local_path";
-const wchar_t* kLaunchWebURL = L"app.launch.web_url";
-const wchar_t* kLaunchWidth = L"app.launch.width";
-const wchar_t* kMatches = L"matches";
-const wchar_t* kMinimumChromeVersion = L"minimum_chrome_version";
-const wchar_t* kName = L"name";
-const wchar_t* kOmniboxKeyword = L"omnibox_keyword";
-const wchar_t* kOptionsPage = L"options_page";
-const wchar_t* kPageAction = L"page_action";
-const wchar_t* kPageActionDefaultIcon = L"default_icon";
-const wchar_t* kPageActionDefaultPopup = L"default_popup";
-const wchar_t* kPageActionDefaultTitle = L"default_title";
-const wchar_t* kPageActionIcons = L"icons";
-const wchar_t* kPageActionId = L"id";
-const wchar_t* kPageActionPopup = L"popup";
-const wchar_t* kPageActionPopupHeight = L"height";
-const wchar_t* kPageActionPopupPath = L"path";
-const wchar_t* kPageActions = L"page_actions";
-const wchar_t* kPermissions = L"permissions";
-const wchar_t* kPlugins = L"plugins";
-const wchar_t* kPluginsPath = L"path";
-const wchar_t* kPluginsPublic = L"public";
-const wchar_t* kPublicKey = L"key";
-const wchar_t* kRunAt = L"run_at";
-const wchar_t* kSignature = L"signature";
-const wchar_t* kTheme = L"theme";
-const wchar_t* kThemeColors = L"colors";
-const wchar_t* kThemeDisplayProperties = L"properties";
-const wchar_t* kThemeImages = L"images";
-const wchar_t* kThemeTints = L"tints";
-const wchar_t* kToolstripMoleHeight = L"mole_height";
-const wchar_t* kToolstripMolePath = L"mole";
-const wchar_t* kToolstripPath = L"path";
-const wchar_t* kToolstrips = L"toolstrips";
-const wchar_t* kType = L"type";
-const wchar_t* kUpdateURL = L"update_url";
-const wchar_t* kVersion = L"version";
-const wchar_t* kWebURLs = L"app.urls";
+const char* kAllFrames = "all_frames";
+const char* kApp = "app";
+const char* kBackground = "background_page";
+const char* kBrowserAction = "browser_action";
+const char* kBrowseURLs = "app.browse_urls";
+const char* kChromeURLOverrides = "chrome_url_overrides";
+const char* kContentScripts = "content_scripts";
+const char* kConvertedFromUserScript = "converted_from_user_script";
+const char* kCss = "css";
+const char* kCurrentLocale = "current_locale";
+const char* kDefaultLocale = "default_locale";
+const char* kDescription = "description";
+const char* kDevToolsPage = "devtools_page";
+const char* kExcludeGlobs = "exclude_globs";
+const char* kIcons = "icons";
+const char* kIncludeGlobs = "include_globs";
+const char* kJs = "js";
+const char* kLaunch = "app.launch";
+const char* kLaunchContainer = "app.launch.container";
+const char* kLaunchFullscreen = "app.launch.fullscreen";
+const char* kLaunchHeight = "app.launch.height";
+const char* kLaunchLocalPath = "app.launch.local_path";
+const char* kLaunchWebURL = "app.launch.web_url";
+const char* kLaunchWidth = "app.launch.width";
+const char* kMatches = "matches";
+const char* kMinimumChromeVersion = "minimum_chrome_version";
+const char* kName = "name";
+const char* kOmniboxKeyword = "omnibox_keyword";
+const char* kOptionsPage = "options_page";
+const char* kPageAction = "page_action";
+const char* kPageActionDefaultIcon = "default_icon";
+const char* kPageActionDefaultPopup = "default_popup";
+const char* kPageActionDefaultTitle = "default_title";
+const char* kPageActionIcons = "icons";
+const char* kPageActionId = "id";
+const char* kPageActionPopup = "popup";
+const char* kPageActionPopupHeight = "height";
+const char* kPageActionPopupPath = "path";
+const char* kPageActions = "page_actions";
+const char* kPermissions = "permissions";
+const char* kPlugins = "plugins";
+const char* kPluginsPath = "path";
+const char* kPluginsPublic = "public";
+const char* kPublicKey = "key";
+const char* kRunAt = "run_at";
+const char* kSignature = "signature";
+const char* kTheme = "theme";
+const char* kThemeColors = "colors";
+const char* kThemeDisplayProperties = "properties";
+const char* kThemeImages = "images";
+const char* kThemeTints = "tints";
+const char* kToolstripMoleHeight = "mole_height";
+const char* kToolstripMolePath = "mole";
+const char* kToolstripPath = "path";
+const char* kToolstrips = "toolstrips";
+const char* kType = "type";
+const char* kUpdateURL = "update_url";
+const char* kVersion = "version";
+const char* kWebURLs = "app.urls";
} // namespace extension_manifest_keys
namespace extension_manifest_values {
diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h
index bc85b3c..2b04abe 100644
--- a/chrome/common/extensions/extension_constants.h
+++ b/chrome/common/extensions/extension_constants.h
@@ -8,66 +8,66 @@
// Keys used in JSON representation of extensions.
namespace extension_manifest_keys {
- extern const wchar_t* kAllFrames;
- extern const wchar_t* kApp;
- extern const wchar_t* kBackground;
- extern const wchar_t* kBrowserAction;
- extern const wchar_t* kBrowseURLs;
- extern const wchar_t* kChromeURLOverrides;
- extern const wchar_t* kContentScripts;
- extern const wchar_t* kConvertedFromUserScript;
- extern const wchar_t* kCss;
- extern const wchar_t* kCurrentLocale;
- extern const wchar_t* kDefaultLocale;
- extern const wchar_t* kDescription;
- extern const wchar_t* kDevToolsPage;
- extern const wchar_t* kExcludeGlobs;
- extern const wchar_t* kIcons;
- extern const wchar_t* kIncludeGlobs;
- extern const wchar_t* kJs;
- extern const wchar_t* kLaunch;
- extern const wchar_t* kLaunchContainer;
- extern const wchar_t* kLaunchFullscreen;
- extern const wchar_t* kLaunchHeight;
- extern const wchar_t* kLaunchLocalPath;
- extern const wchar_t* kLaunchWebURL;
- extern const wchar_t* kLaunchWidth;
- extern const wchar_t* kMatches;
- extern const wchar_t* kMinimumChromeVersion;
- extern const wchar_t* kName;
- extern const wchar_t* kOmniboxKeyword;
- extern const wchar_t* kOptionsPage;
- extern const wchar_t* kPageAction;
- extern const wchar_t* kPageActionDefaultIcon;
- extern const wchar_t* kPageActionDefaultPopup;
- extern const wchar_t* kPageActionDefaultTitle;
- extern const wchar_t* kPageActionIcons;
- extern const wchar_t* kPageActionId;
- extern const wchar_t* kPageActionPopup;
- extern const wchar_t* kPageActionPopupHeight;
- extern const wchar_t* kPageActionPopupPath;
- extern const wchar_t* kPageActions;
- extern const wchar_t* kPermissions;
- extern const wchar_t* kPlugins;
- extern const wchar_t* kPluginsPath;
- extern const wchar_t* kPluginsPublic;
- extern const wchar_t* kPublicKey;
- extern const wchar_t* kRunAt;
- extern const wchar_t* kSignature;
- extern const wchar_t* kTheme;
- extern const wchar_t* kThemeColors;
- extern const wchar_t* kThemeDisplayProperties;
- extern const wchar_t* kThemeImages;
- extern const wchar_t* kThemeTints;
- extern const wchar_t* kToolstripMoleHeight;
- extern const wchar_t* kToolstripMolePath;
- extern const wchar_t* kToolstripPath;
- extern const wchar_t* kToolstrips;
- extern const wchar_t* kType;
- extern const wchar_t* kUpdateURL;
- extern const wchar_t* kVersion;
- extern const wchar_t* kWebLaunchUrl;
- extern const wchar_t* kWebURLs;
+ extern const char* kAllFrames;
+ extern const char* kApp;
+ extern const char* kBackground;
+ extern const char* kBrowserAction;
+ extern const char* kBrowseURLs;
+ extern const char* kChromeURLOverrides;
+ extern const char* kContentScripts;
+ extern const char* kConvertedFromUserScript;
+ extern const char* kCss;
+ extern const char* kCurrentLocale;
+ extern const char* kDefaultLocale;
+ extern const char* kDescription;
+ extern const char* kDevToolsPage;
+ extern const char* kExcludeGlobs;
+ extern const char* kIcons;
+ extern const char* kIncludeGlobs;
+ extern const char* kJs;
+ extern const char* kLaunch;
+ extern const char* kLaunchContainer;
+ extern const char* kLaunchFullscreen;
+ extern const char* kLaunchHeight;
+ extern const char* kLaunchLocalPath;
+ extern const char* kLaunchWebURL;
+ extern const char* kLaunchWidth;
+ extern const char* kMatches;
+ extern const char* kMinimumChromeVersion;
+ extern const char* kName;
+ extern const char* kOmniboxKeyword;
+ extern const char* kOptionsPage;
+ extern const char* kPageAction;
+ extern const char* kPageActionDefaultIcon;
+ extern const char* kPageActionDefaultPopup;
+ extern const char* kPageActionDefaultTitle;
+ extern const char* kPageActionIcons;
+ extern const char* kPageActionId;
+ extern const char* kPageActionPopup;
+ extern const char* kPageActionPopupHeight;
+ extern const char* kPageActionPopupPath;
+ extern const char* kPageActions;
+ extern const char* kPermissions;
+ extern const char* kPlugins;
+ extern const char* kPluginsPath;
+ extern const char* kPluginsPublic;
+ extern const char* kPublicKey;
+ extern const char* kRunAt;
+ extern const char* kSignature;
+ extern const char* kTheme;
+ extern const char* kThemeColors;
+ extern const char* kThemeDisplayProperties;
+ extern const char* kThemeImages;
+ extern const char* kThemeTints;
+ extern const char* kToolstripMoleHeight;
+ extern const char* kToolstripMolePath;
+ extern const char* kToolstripPath;
+ extern const char* kToolstrips;
+ extern const char* kType;
+ extern const char* kUpdateURL;
+ extern const char* kVersion;
+ extern const char* kWebLaunchUrl;
+ extern const char* kWebURLs;
} // namespace extension_manifest_keys
// Some values expected in manifests.
diff --git a/chrome/common/extensions/extension_l10n_util.cc b/chrome/common/extensions/extension_l10n_util.cc
index b9c2b1c..4187689 100644
--- a/chrome/common/extensions/extension_l10n_util.cc
+++ b/chrome/common/extensions/extension_l10n_util.cc
@@ -61,7 +61,7 @@ bool ShouldRelocalizeManifest(const ExtensionInfo& info) {
}
// Localizes manifest value for a given key.
-static bool LocalizeManifestValue(const std::wstring& key,
+static bool LocalizeManifestValue(const std::string& key,
const ExtensionMessageBundle& messages,
DictionaryValue* manifest,
std::string* error) {
@@ -94,15 +94,15 @@ bool LocalizeManifest(const ExtensionMessageBundle& messages,
return false;
// Initialize browser_action.default_title
- std::wstring key(keys::kBrowserAction);
- key.append(L".");
+ std::string key(keys::kBrowserAction);
+ key.append(".");
key.append(keys::kPageActionDefaultTitle);
if (!LocalizeManifestValue(key, messages, manifest, error))
return false;
// Initialize page_action.default_title
key.assign(keys::kPageAction);
- key.append(L".");
+ key.append(".");
key.append(keys::kPageActionDefaultTitle);
if (!LocalizeManifestValue(key, messages, manifest, error))
return false;
diff --git a/chrome/common/extensions/extension_l10n_util_unittest.cc b/chrome/common/extensions/extension_l10n_util_unittest.cc
index aa83e05..b00044c 100644
--- a/chrome/common/extensions/extension_l10n_util_unittest.cc
+++ b/chrome/common/extensions/extension_l10n_util_unittest.cc
@@ -323,8 +323,8 @@ TEST(ExtensionL10nUtil, LocalizeManifestWithNameDescriptionDefaultTitleMsgs) {
DictionaryValue manifest;
manifest.SetString(keys::kName, "__MSG_name__");
manifest.SetString(keys::kDescription, "__MSG_description__");
- std::wstring action_title(keys::kBrowserAction);
- action_title.append(L".");
+ std::string action_title(keys::kBrowserAction);
+ action_title.append(".");
action_title.append(keys::kPageActionDefaultTitle);
manifest.SetString(action_title, "__MSG_title__");
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index acb1f95..5a3a3c0 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -370,7 +370,7 @@ TEST(ExtensionTest, InitFromValueValidNameInRTL) {
input_value.SetString(keys::kVersion, "1.0.0.0");
// No strong RTL characters in name.
std::wstring name(L"Dictionary (by Google)");
- input_value.SetString(keys::kName, name);
+ input_value.SetString(keys::kName, WideToUTF16Hack(name));
EXPECT_TRUE(extension.InitFromValue(input_value, false, &error));
EXPECT_EQ("", error);
std::wstring localized_name(name);
@@ -379,7 +379,7 @@ TEST(ExtensionTest, InitFromValueValidNameInRTL) {
// Strong RTL characters in name.
name = L"Dictionary (\x05D1\x05D2"L" Google)";
- input_value.SetString(keys::kName, name);
+ input_value.SetString(keys::kName, WideToUTF16Hack(name));
EXPECT_TRUE(extension.InitFromValue(input_value, false, &error));
EXPECT_EQ("", error);
localized_name = name;
@@ -556,8 +556,8 @@ TEST(ExtensionTest, LoadPageActionHelper) {
ASSERT_STREQ(
ExtensionErrorUtils::FormatErrorMessage(
errors::kInvalidPageActionOldAndNewKeys,
- WideToASCII(keys::kPageActionDefaultPopup),
- WideToASCII(keys::kPageActionPopup)).c_str(),
+ keys::kPageActionDefaultPopup,
+ keys::kPageActionPopup).c_str(),
error_msg.c_str());
error_msg = "";