diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 16:24:25 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 16:24:25 +0000 |
commit | 99922661cbee0b313a07115912316f93b2cd5c95 (patch) | |
tree | 0036de373dc2d878d2a3f2280054b1477c358bc5 | |
parent | dbba57ffa3c2f14bf5a3b16a47307188539df0b6 (diff) | |
download | chromium_src-99922661cbee0b313a07115912316f93b2cd5c95.zip chromium_src-99922661cbee0b313a07115912316f93b2cd5c95.tar.gz chromium_src-99922661cbee0b313a07115912316f93b2cd5c95.tar.bz2 |
Remove remaining deprecated wstring methods from base/values.{cc,h}.
BUG=23581
TEST=builds and passes tests
Review URL: http://codereview.chromium.org/3109025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56362 0039d316-1c4b-4281-b951-d872f2087c98
31 files changed, 320 insertions, 401 deletions
diff --git a/base/json/json_writer_unittest.cc b/base/json/json_writer_unittest.cc index 7d8db69..937d083 100644 --- a/base/json/json_writer_unittest.cc +++ b/base/json/json_writer_unittest.cc @@ -50,10 +50,10 @@ TEST(JSONWriterTest, Writing) { // list list nesting, etc. DictionaryValue root_dict; ListValue* list = new ListValue; - root_dict.Set(L"list", list); + root_dict.Set("list", list); DictionaryValue* inner_dict = new DictionaryValue; list->Append(inner_dict); - inner_dict->SetInteger(L"inner int", 10); + inner_dict->SetInteger("inner int", 10); ListValue* inner_list = new ListValue; list->Append(inner_list); list->Append(Value::CreateBooleanValue(true)); @@ -89,7 +89,7 @@ TEST(JSONWriterTest, Writing) { ASSERT_EQ("{\"a.b\":3,\"c\":2,\"d.e.f\":{\"g.h.i.j\":1}}", output_js); DictionaryValue period_dict3; - period_dict3.Set(L"a.b", Value::CreateIntegerValue(2)); + period_dict3.Set("a.b", Value::CreateIntegerValue(2)); period_dict3.SetWithoutPathExpansion("a.b", Value::CreateIntegerValue(1)); JSONWriter::Write(&period_dict3, false, &output_js); ASSERT_EQ("{\"a\":{\"b\":2},\"a.b\":1}", output_js); diff --git a/base/values.cc b/base/values.cc index 20e6175..926202e 100644 --- a/base/values.cc +++ b/base/values.cc @@ -224,14 +224,6 @@ StringValue::StringValue(const string16& in_value) value_(UTF16ToUTF8(in_value)) { } -#if !defined(WCHAR_T_IS_UTF16) -// TODO(viettrungluu): Deprecated and to be removed: -StringValue::StringValue(const std::wstring& in_value) - : Value(TYPE_STRING), - value_(WideToUTF8(in_value)) { -} -#endif - StringValue::~StringValue() { } @@ -360,11 +352,6 @@ bool DictionaryValue::HasKey(const std::string& key) const { return current_entry != dictionary_.end(); } -// TODO(viettrungluu): Deprecated and to be removed: -bool DictionaryValue::HasKey(const std::wstring& key) const { - return HasKey(WideToUTF8(key)); -} - void DictionaryValue::Clear() { ValueMap::iterator dict_iterator = dictionary_.begin(); while (dict_iterator != dictionary_.end()) { @@ -399,11 +386,6 @@ void DictionaryValue::Set(const std::string& path, Value* in_value) { current_dictionary->SetWithoutPathExpansion(current_path, in_value); } -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::Set(const std::wstring& path, Value* in_value) { - Set(WideToUTF8(path), in_value); -} - void DictionaryValue::SetBoolean(const std::string& path, bool in_value) { Set(path, CreateBooleanValue(in_value)); } @@ -426,41 +408,6 @@ void DictionaryValue::SetString(const std::string& path, Set(path, CreateStringValue(in_value)); } -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetBoolean(const std::wstring& path, bool in_value) { - Set(path, CreateBooleanValue(in_value)); -} - -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetInteger(const std::wstring& path, int in_value) { - Set(path, CreateIntegerValue(in_value)); -} - -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetReal(const std::wstring& path, double in_value) { - Set(path, CreateRealValue(in_value)); -} - -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetString(const std::wstring& path, - const std::string& in_value) { - Set(path, CreateStringValue(in_value)); -} - -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetString(const std::wstring& path, - const string16& in_value) { - Set(path, CreateStringValue(in_value)); -} - -#if !defined(WCHAR_T_IS_UTF16) -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetString(const std::wstring& path, - const std::wstring& in_value) { - Set(WideToUTF8(path), CreateStringValue(WideToUTF8(in_value))); -} -#endif - void DictionaryValue::SetWithoutPathExpansion(const std::string& key, Value* in_value) { // If there's an existing value here, we need to delete it, because @@ -492,11 +439,6 @@ bool DictionaryValue::Get(const std::string& path, Value** out_value) const { return current_dictionary->GetWithoutPathExpansion(current_path, out_value); } -// TODO(viettrungluu): Deprecated and to be removed: -bool DictionaryValue::Get(const std::wstring& path, Value** out_value) const { - return Get(WideToUTF8(path), out_value); -} - bool DictionaryValue::GetBoolean(const std::string& path, bool* bool_value) const { Value* value; @@ -681,11 +623,6 @@ bool DictionaryValue::Remove(const std::string& path, Value** out_value) { out_value); } -// TODO(viettrungluu): Deprecated and to be removed: -bool DictionaryValue::Remove(const std::wstring& path, Value** out_value) { - return Remove(WideToUTF8(path), out_value); -} - bool DictionaryValue::RemoveWithoutPathExpansion(const std::string& key, Value** out_value) { DCHECK(IsStringUTF8(key)); diff --git a/base/values.h b/base/values.h index 479e0fc..b729b52 100644 --- a/base/values.h +++ b/base/values.h @@ -146,11 +146,6 @@ class StringValue : public Value { // Initializes a StringValue with a string16. explicit StringValue(const string16& in_value); -#if !defined(WCHAR_T_IS_UTF16) - // Initializes a StringValue with a wide character string. - /*DEPRECATED*/explicit StringValue(const std::wstring& in_value); -#endif - ~StringValue(); // Subclassed methods @@ -202,7 +197,6 @@ class BinaryValue: public Value { // DictionaryValue provides a key-value dictionary with (optional) "path" // parsing for recursive access; see the comment at the top of the file. Keys // are |std::string|s and should be UTF-8 encoded. -// TODO(viettrungluu): Things marked DEPRECATED will be removed. crbug.com/23581 class DictionaryValue : public Value { public: DictionaryValue(); @@ -214,7 +208,6 @@ class DictionaryValue : public Value { // Returns true if the current dictionary has a value for the given key. bool HasKey(const std::string& key) const; - /*DEPRECATED*/bool HasKey(const std::wstring& key) const; // Returns the number of Values in this dictionary. size_t size() const { return dictionary_.size(); } @@ -235,7 +228,6 @@ class DictionaryValue : public Value { // Note that the dictionary takes ownership of the value referenced by // |in_value|, and therefore |in_value| must be non-NULL. void Set(const std::string& path, Value* in_value); - /*DEPRECATED*/void Set(const std::wstring& path, Value* in_value); // Convenience forms of Set(). These methods will replace any existing // value at that path, even if it has a different type. @@ -244,17 +236,6 @@ class DictionaryValue : public Value { void SetReal(const std::string& path, double in_value); void SetString(const std::string& path, const std::string& in_value); void SetString(const std::string& path, const string16& in_value); - /*DEPRECATED*/void SetBoolean(const std::wstring& path, bool in_value); - /*DEPRECATED*/void SetInteger(const std::wstring& path, int in_value); - /*DEPRECATED*/void SetReal(const std::wstring& path, double in_value); - /*DEPRECATED*/void SetString(const std::wstring& path, - const std::string& in_value); - /*DEPRECATED*/void SetString(const std::wstring& path, - const string16& in_value); -#if !defined(WCHAR_T_IS_UTF16) - /*DEPRECATED*/void SetString(const std::wstring& path, - const std::wstring& in_value); -#endif // Like Set(), but without special treatment of '.'. This allows e.g. URLs to // be used as paths. @@ -268,7 +249,6 @@ class DictionaryValue : public Value { // Otherwise, it will return false and |out_value| will be untouched. // Note that the dictionary always owns the value that's returned. bool Get(const std::string& path, Value** out_value) const; - /*DEPRECATED*/bool Get(const std::wstring& path, Value** out_value) const; // These are convenience forms of Get(). The value will be retrieved // and the return value will be true if the path is valid and the value at @@ -306,7 +286,6 @@ class DictionaryValue : public Value { // be deleted. This method returns true if |path| is a valid path; otherwise // it will return false and the DictionaryValue object will be unchanged. bool Remove(const std::string& path, Value** out_value); - /*DEPRECATED*/bool Remove(const std::wstring& path, Value** out_value); // Like Remove(), but without special treatment of '.'. This allows e.g. URLs // to be used as paths. diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index a10406d..ed37ea4 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -3137,7 +3137,7 @@ ListValue* AutomationProvider::GetListFromAutoFillProfiles( type_it != autofill_type_to_string.end(); ++type_it) { string16 value = profile->GetFieldText(AutoFillType(type_it->first)); if (value.length()) { // If there was something stored for that value. - profile_info->SetString(type_it->second, value); + profile_info->SetString(WideToUTF8(type_it->second), value); } } profiles->Append(profile_info); @@ -3166,7 +3166,7 @@ ListValue* AutomationProvider::GetListFromCreditCards( string16 value = card->GetFieldText(AutoFillType(type_it->first)); // If there was something stored for that value. if (value.length()) { - card_info->SetString(type_it->second, value); + card_info->SetString(WideToUTF8(type_it->second), value); } } cards->Append(card_info); @@ -3195,7 +3195,7 @@ std::vector<AutoFillProfile> AutomationProvider::GetAutoFillProfilesFromList( for (std::map<AutoFillFieldType, std::wstring>::iterator type_it = autofill_type_to_string.begin(); type_it != autofill_type_to_string.end(); ++type_it) { - if (profile_info->HasKey(type_it->second)) { + if (profile_info->HasKey(WideToUTF8(type_it->second))) { if (profile_info->GetString(WideToUTF8(type_it->second), ¤t_value)) { profile.SetInfo(AutoFillType(type_it->first), current_value); @@ -3230,7 +3230,7 @@ std::vector<CreditCard> AutomationProvider::GetCreditCardsFromList( for (std::map<AutoFillFieldType, std::wstring>::iterator type_it = credit_card_type_to_string.begin(); type_it != credit_card_type_to_string.end(); ++type_it) { - if (card_info->HasKey(type_it->second)) { + if (card_info->HasKey(WideToUTF8(type_it->second))) { if (card_info->GetString(WideToUTF8(type_it->second), ¤t_value)) { card.SetInfo(AutoFillType(type_it->first), current_value); } else { diff --git a/chrome/browser/background_contents_service_unittest.cc b/chrome/browser/background_contents_service_unittest.cc index 964d111..5a0819d 100644 --- a/chrome/browser/background_contents_service_unittest.cc +++ b/chrome/browser/background_contents_service_unittest.cc @@ -36,7 +36,7 @@ class BackgroundContentsServiceTest : public testing::Test { // Returns the stored pref URL for the passed app id. std::string GetPrefURLForApp(Profile* profile, const string16& appid) { DictionaryValue* pref = GetPrefs(profile); - EXPECT_TRUE(pref->HasKey(UTF16ToWide(appid))); + EXPECT_TRUE(pref->HasKey(UTF16ToUTF8(appid))); DictionaryValue* value; pref->GetDictionaryWithoutPathExpansion(UTF16ToUTF8(appid), &value); std::string url; diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 94e7650..6d0765f 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -952,7 +952,7 @@ void AboutMemoryHandler::AppendProcess(ListValue* child_data, ListValue* titles = new ListValue(); child->Set("titles", titles); for (size_t i = 0; i < info->titles.size(); ++i) - titles->Append(new StringValue(info->titles[i])); + titles->Append(new StringValue(WideToUTF16Hack(info->titles[i]))); } diff --git a/chrome/browser/chromeos/dom_ui/system_options_handler.cc b/chrome/browser/chromeos/dom_ui/system_options_handler.cc index e3f7ae8..507f42d 100644 --- a/chrome/browser/chromeos/dom_ui/system_options_handler.cc +++ b/chrome/browser/chromeos/dom_ui/system_options_handler.cc @@ -97,7 +97,7 @@ void SystemOptionsHandler::GetLocalizedValues( l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_ACCESSIBILITY_DESCRIPTION)); - localized_strings->Set(L"timezoneList", + localized_strings->Set("timezoneList", reinterpret_cast<chromeos::SystemSettingsProvider*>( settings_provider_.get())->GetTimezoneList()); } diff --git a/chrome/browser/chromeos/offline/offline_load_page.cc b/chrome/browser/chromeos/offline/offline_load_page.cc index 10c78d8..fa66e4b 100644 --- a/chrome/browser/chromeos/offline/offline_load_page.cc +++ b/chrome/browser/chromeos/offline/offline_load_page.cc @@ -28,8 +28,8 @@ namespace { const int kMaxBlankPeriod = 3000; // A utility function to set the dictionary's value given by |resource_id|. -void SetString(DictionaryValue* strings, const wchar_t* name, int resource_id) { - strings->SetString(name, l10n_util::GetString(resource_id)); +void SetString(DictionaryValue* strings, const char* name, int resource_id) { + strings->SetString(name, l10n_util::GetStringUTF16(resource_id)); } } // namespace @@ -62,27 +62,28 @@ OfflineLoadPage::OfflineLoadPage(TabContents* tab_contents, std::string OfflineLoadPage::GetHTMLContents() { DictionaryValue strings; - SetString(&strings, L"headLine", IDS_OFFLINE_LOAD_HEADLINE); - SetString(&strings, L"description", IDS_OFFLINE_LOAD_DESCRIPTION); - SetString(&strings, L"load_button", IDS_OFFLINE_LOAD_BUTTON); - SetString(&strings, L"back_button", IDS_OFFLINE_BACK_BUTTON); + SetString(&strings, "headLine", IDS_OFFLINE_LOAD_HEADLINE); + SetString(&strings, "description", IDS_OFFLINE_LOAD_DESCRIPTION); + SetString(&strings, "load_button", IDS_OFFLINE_LOAD_BUTTON); + SetString(&strings, "back_button", IDS_OFFLINE_BACK_BUTTON); // TODO(oshima): tab()->GetTitle() always return url. This has to be // a cached title. - strings.SetString(L"title", UTF16ToWide(tab()->GetTitle())); - strings.SetString(L"textdirection", base::i18n::IsRTL() ? L"rtl" : L"ltr"); - strings.SetString(L"display_go_back", - tab()->controller().CanGoBack() ? L"inline" : L"none"); + strings.SetString("title", tab()->GetTitle()); + strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr"); + strings.SetString("display_go_back", + tab()->controller().CanGoBack() ? "inline" : "none"); int64 time_to_wait = std::max( static_cast<int64>(0), kMaxBlankPeriod - NetworkStateNotifier::GetOfflineDuration().InMilliseconds()); - strings.SetString(L"on_load", - StringPrintf(L"startTimer(%ld)", time_to_wait)); + strings.SetString("on_load", + WideToUTF16Hack(StringPrintf(L"startTimer(%ld)", + time_to_wait))); // TODO(oshima): thumbnail is not working yet. fix this. const std::string url = "chrome://thumb/" + GetURL().spec(); - strings.SetString(L"thumbnailUrl", "url(" + url + ")"); + strings.SetString("thumbnailUrl", "url(" + url + ")"); base::StringPiece html( ResourceBundle::GetSharedInstance().GetRawDataResource( diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index 400951f..a2334e7 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.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. @@ -212,12 +212,12 @@ void DevToolsWindow::CreateDevToolsBrowser() { const DictionaryValue* wp_pref = prefs->GetDictionary(wp_key.c_str()); if (!wp_pref) { DictionaryValue* defaults = prefs->GetMutableDictionary(wp_key.c_str()); - defaults->SetInteger(L"left", 100); - defaults->SetInteger(L"top", 100); - defaults->SetInteger(L"right", 740); - defaults->SetInteger(L"bottom", 740); - defaults->SetBoolean(L"maximized", false); - defaults->SetBoolean(L"always_on_top", false); + defaults->SetInteger("left", 100); + defaults->SetInteger("top", 100); + defaults->SetInteger("right", 740); + defaults->SetInteger("bottom", 740); + defaults->SetBoolean("maximized", false); + defaults->SetBoolean("always_on_top", false); } browser_ = Browser::CreateForDevTools(profile_); @@ -259,7 +259,7 @@ void DevToolsWindow::AddDevToolsExtensionsToClient() { if ((*extension)->devtools_url().is_empty()) continue; DictionaryValue* extension_info = new DictionaryValue(); - extension_info->Set(L"startPage", + extension_info->Set("startPage", new StringValue((*extension)->devtools_url().spec())); results.Append(extension_info); } diff --git a/chrome/browser/dom_ui/about_page_handler.cc b/chrome/browser/dom_ui/about_page_handler.cc index dfb992d..f96f1ac 100644 --- a/chrome/browser/dom_ui/about_page_handler.cc +++ b/chrome/browser/dom_ui/about_page_handler.cc @@ -56,37 +56,37 @@ std::wstring StringSubRange(const std::wstring& text, size_t start, } struct LocalizeEntry { - const wchar_t* identifier; - int resource; + const char* identifier; + int resource; }; const LocalizeEntry localize_table[] = { #if defined (OS_CHROMEOS) - { L"product", IDS_PRODUCT_OS_NAME }, - { L"os", IDS_PRODUCT_OS_NAME }, - { L"loading", IDS_ABOUT_PAGE_LOADING }, - { L"check_now", IDS_ABOUT_PAGE_CHECK_NOW }, - { L"update_status", IDS_UPGRADE_CHECK_STARTED }, + { "product", IDS_PRODUCT_OS_NAME }, + { "os", IDS_PRODUCT_OS_NAME }, + { "loading", IDS_ABOUT_PAGE_LOADING }, + { "check_now", IDS_ABOUT_PAGE_CHECK_NOW }, + { "update_status", IDS_UPGRADE_CHECK_STARTED }, #else - { L"product", IDS_PRODUCT_NAME }, - { L"check_now", IDS_ABOUT_CHROME_UPDATE_CHECK }, + { "product", IDS_PRODUCT_NAME }, + { "check_now", IDS_ABOUT_CHROME_UPDATE_CHECK }, #endif - { L"browser", IDS_PRODUCT_NAME }, - { L"more_info", IDS_ABOUT_PAGE_MORE_INFO }, - { L"copyright", IDS_ABOUT_VERSION_COPYRIGHT }, - { L"channel", IDS_ABOUT_PAGE_CHANNEL }, - { L"release", IDS_ABOUT_PAGE_CHANNEL_RELEASE }, - { L"beta", IDS_ABOUT_PAGE_CHANNEL_BETA }, - { L"development", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT }, - { L"user_agent", IDS_ABOUT_VERSION_USER_AGENT }, - { L"command_line", IDS_ABOUT_VERSION_COMMAND_LINE }, - { L"aboutPage", IDS_ABOUT_PAGE_TITLE } + { "browser", IDS_PRODUCT_NAME }, + { "more_info", IDS_ABOUT_PAGE_MORE_INFO }, + { "copyright", IDS_ABOUT_VERSION_COPYRIGHT }, + { "channel", IDS_ABOUT_PAGE_CHANNEL }, + { "release", IDS_ABOUT_PAGE_CHANNEL_RELEASE }, + { "beta", IDS_ABOUT_PAGE_CHANNEL_BETA }, + { "development", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT }, + { "user_agent", IDS_ABOUT_VERSION_USER_AGENT }, + { "command_line", IDS_ABOUT_VERSION_COMMAND_LINE }, + { "aboutPage", IDS_ABOUT_PAGE_TITLE } }; void LocalizedStrings(DictionaryValue* localized_strings) { for (size_t n = 0; n != arraysize(localize_table); ++n) { localized_strings->SetString(localize_table[n].identifier, - l10n_util::GetString(localize_table[n].resource)); + l10n_util::GetStringUTF16(localize_table[n].resource)); } } diff --git a/chrome/browser/dom_ui/autofill_options_handler.cc b/chrome/browser/dom_ui/autofill_options_handler.cc index db63e8b..5b5e500 100644 --- a/chrome/browser/dom_ui/autofill_options_handler.cc +++ b/chrome/browser/dom_ui/autofill_options_handler.cc @@ -21,22 +21,22 @@ void AutoFillOptionsHandler::GetLocalizedValues( localized_strings->SetString("autoFillOptionsTitle", l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_TITLE)); - localized_strings->SetString(L"autoFillEnabled", - l10n_util::GetString(IDS_OPTIONS_AUTOFILL_ENABLE)); - localized_strings->SetString(L"addressesHeader", - l10n_util::GetString(IDS_AUTOFILL_ADDRESSES_GROUP_NAME)); - localized_strings->SetString(L"creditCardsHeader", - l10n_util::GetString(IDS_AUTOFILL_CREDITCARDS_GROUP_NAME)); - localized_strings->SetString(L"addAddressButton", - l10n_util::GetString(IDS_AUTOFILL_ADD_ADDRESS_BUTTON)); - localized_strings->SetString(L"addCreditCardButton", - l10n_util::GetString(IDS_AUTOFILL_ADD_CREDITCARD_BUTTON)); - localized_strings->SetString(L"editButton", - l10n_util::GetString(IDS_AUTOFILL_EDIT_BUTTON)); - localized_strings->SetString(L"deleteButton", - l10n_util::GetString(IDS_AUTOFILL_DELETE_BUTTON)); - localized_strings->SetString(L"helpButton", - l10n_util::GetString(IDS_AUTOFILL_HELP_LABEL)); + localized_strings->SetString("autoFillEnabled", + l10n_util::GetStringUTF16(IDS_OPTIONS_AUTOFILL_ENABLE)); + localized_strings->SetString("addressesHeader", + l10n_util::GetStringUTF16(IDS_AUTOFILL_ADDRESSES_GROUP_NAME)); + localized_strings->SetString("creditCardsHeader", + l10n_util::GetStringUTF16(IDS_AUTOFILL_CREDITCARDS_GROUP_NAME)); + localized_strings->SetString("addAddressButton", + l10n_util::GetStringUTF16(IDS_AUTOFILL_ADD_ADDRESS_BUTTON)); + localized_strings->SetString("addCreditCardButton", + l10n_util::GetStringUTF16(IDS_AUTOFILL_ADD_CREDITCARD_BUTTON)); + localized_strings->SetString("editButton", + l10n_util::GetStringUTF16(IDS_AUTOFILL_EDIT_BUTTON)); + localized_strings->SetString("deleteButton", + l10n_util::GetStringUTF16(IDS_AUTOFILL_DELETE_BUTTON)); + localized_strings->SetString("helpButton", + l10n_util::GetStringUTF16(IDS_AUTOFILL_HELP_LABEL)); } void AutoFillOptionsHandler::RegisterMessages() { diff --git a/chrome/browser/dom_ui/core_options_handler.cc b/chrome/browser/dom_ui/core_options_handler.cc index 73cbd8e..4e6d021 100644 --- a/chrome/browser/dom_ui/core_options_handler.cc +++ b/chrome/browser/dom_ui/core_options_handler.cc @@ -124,8 +124,8 @@ Value* CoreOptionsHandler::FetchPref(const std::string& pref_name) { Value* return_value; if (pref) { DictionaryValue* dict = new DictionaryValue; - dict->Set(L"value", pref->GetValue()->DeepCopy()); - dict->SetBoolean(L"managed", pref->IsManaged()); + dict->Set("value", pref->GetValue()->DeepCopy()); + dict->SetBoolean("managed", pref->IsManaged()); return_value = dict; } else { return_value = Value::CreateNullValue(); @@ -292,8 +292,8 @@ void CoreOptionsHandler::NotifyPrefChanged(const std::string* pref_name) { result_value.Append(Value::CreateStringValue(pref_name->c_str())); DictionaryValue* dict = new DictionaryValue; - dict->Set(L"value", pref->GetValue()->DeepCopy()); - dict->SetBoolean(L"managed", pref->IsManaged()); + dict->Set("value", pref->GetValue()->DeepCopy()); + dict->SetBoolean("managed", pref->IsManaged()); result_value.Append(dict); dom_ui_->CallJavascriptFunction(callback_function, result_value); diff --git a/chrome/browser/dom_ui/font_settings_handler.cc b/chrome/browser/dom_ui/font_settings_handler.cc index 67c46316..e210904 100644 --- a/chrome/browser/dom_ui/font_settings_handler.cc +++ b/chrome/browser/dom_ui/font_settings_handler.cc @@ -31,31 +31,31 @@ void FontSettingsHandler::GetLocalizedValues( localized_strings->SetString("fontSettingsTitle", l10n_util::GetStringUTF16(IDS_FONT_LANGUAGE_SETTING_FONT_TAB_TITLE)); - localized_strings->SetString(L"fontSettingsFontTitle", - l10n_util::GetString( + localized_strings->SetString("fontSettingsFontTitle", + l10n_util::GetStringUTF16( IDS_FONT_LANGUAGE_SETTING_FONT_SUB_DIALOG_FONT_TITLE)); - localized_strings->SetString(L"fontSettingsSerifLabel", - l10n_util::GetString( + localized_strings->SetString("fontSettingsSerifLabel", + l10n_util::GetStringUTF16( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SERIF_LABEL)); - localized_strings->SetString(L"fontSettingsSansSerifLabel", - l10n_util::GetString( + localized_strings->SetString("fontSettingsSansSerifLabel", + l10n_util::GetStringUTF16( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SANS_SERIF_LABEL)); - localized_strings->SetString(L"fontSettingsFixedWidthLabel", - l10n_util::GetString( + localized_strings->SetString("fontSettingsFixedWidthLabel", + l10n_util::GetStringUTF16( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_FIXED_WIDTH_LABEL)); - localized_strings->SetString(L"fontSettingsSizeLabel", - l10n_util::GetString( + localized_strings->SetString("fontSettingsSizeLabel", + l10n_util::GetStringUTF16( IDS_FONT_LANGUAGE_SETTING_FONT_SIZE_SELECTOR_LABEL)); - localized_strings->SetString(L"fontSettingsEncodingTitle", - l10n_util::GetString( + localized_strings->SetString("fontSettingsEncodingTitle", + l10n_util::GetStringUTF16( IDS_FONT_LANGUAGE_SETTING_FONT_SUB_DIALOG_ENCODING_TITLE)); - localized_strings->SetString(L"fontSettingsEncodingLabel", - l10n_util::GetString( + localized_strings->SetString("fontSettingsEncodingLabel", + l10n_util::GetStringUTF16( IDS_FONT_LANGUAGE_SETTING_FONT_DEFAULT_ENCODING_SELECTOR_LABEL)); // Fonts ListValue* font_list = FontSettingsUtilities::GetFontsList(); - if (font_list) localized_strings->Set(L"fontSettingsFontList", font_list); + if (font_list) localized_strings->Set("fontSettingsFontList", font_list); // Font sizes int font_sizes[] = { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, @@ -68,7 +68,7 @@ void FontSettingsHandler::GetLocalizedValues( option->Append(Value::CreateStringValue(base::IntToString(font_sizes[i]))); font_size_list->Append(option); } - localized_strings->Set(L"fontSettingsFontSizeList", font_size_list); + localized_strings->Set("fontSettingsFontSizeList", font_size_list); // Encodings count = CharacterEncoding::GetSupportCanonicalEncodingCount(); @@ -85,7 +85,7 @@ void FontSettingsHandler::GetLocalizedValues( option->Append(Value::CreateStringValue(name)); encoding_list->Append(option); } - localized_strings->Set(L"fontSettingsEncodingList", encoding_list); + localized_strings->Set("fontSettingsEncodingList", encoding_list); } void FontSettingsHandler::Initialize() { diff --git a/chrome/browser/dom_ui/net_internals_ui.cc b/chrome/browser/dom_ui/net_internals_ui.cc index a3cfed4..aa39cab9 100644 --- a/chrome/browser/dom_ui/net_internals_ui.cc +++ b/chrome/browser/dom_ui/net_internals_ui.cc @@ -444,8 +444,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( for (size_t i = 0; i < event_types.size(); ++i) { const char* name = net::NetLog::EventTypeToString(event_types[i]); - dict->SetInteger(ASCIIToWide(name), - static_cast<int>(event_types[i])); + dict->SetInteger(name, static_cast<int>(event_types[i])); } CallJavascriptFunction(L"g_browser.receivedLogEventTypeConstants", dict); @@ -490,7 +489,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( DictionaryValue* dict = new DictionaryValue(); #define LOAD_FLAG(label, value) \ - dict->SetInteger(ASCIIToWide(# label), static_cast<int>(value)); + dict->SetInteger(# label, static_cast<int>(value)); #include "net/base/load_flags_list.h" #undef LOAD_FLAG @@ -503,7 +502,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( DictionaryValue* dict = new DictionaryValue(); #define NET_ERROR(label, value) \ - dict->SetInteger(ASCIIToWide(# label), static_cast<int>(value)); + dict->SetInteger(# label, static_cast<int>(value)); #include "net/base/net_error_list.h" #undef NET_ERROR @@ -527,7 +526,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( { DictionaryValue* dict = new DictionaryValue(); -#define SOURCE_TYPE(label, value) dict->SetInteger(ASCIIToWide(# label), value); +#define SOURCE_TYPE(label, value) dict->SetInteger(# label, value); #include "net/base/net_log_source_type_list.h" #undef SOURCE_TYPE @@ -746,7 +745,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetHttpCacheInfo( std::vector<std::pair<std::string, std::string> > stats; disk_cache->GetStats(&stats); for (size_t i = 0; i < stats.size(); ++i) { - stats_dict->Set(ASCIIToWide(stats[i].first), + stats_dict->Set(stats[i].first, Value::CreateStringValue(stats[i].second)); } } diff --git a/chrome/browser/dom_ui/personal_options_handler.cc b/chrome/browser/dom_ui/personal_options_handler.cc index 4697605..f3725a5 100644 --- a/chrome/browser/dom_ui/personal_options_handler.cc +++ b/chrome/browser/dom_ui/personal_options_handler.cc @@ -68,18 +68,18 @@ void PersonalOptionsHandler::GetLocalizedValues( l10n_util::GetStringUTF16(IDS_OPTIONS_IMPORT_DATA_BUTTON)); #if defined(TOOLKIT_GTK) - localized_strings->SetString(L"appearance", - l10n_util::GetString(IDS_APPEARANCE_GROUP_NAME)); - localized_strings->SetString(L"themes_GTK_button", - l10n_util::GetString(IDS_THEMES_GTK_BUTTON)); - localized_strings->SetString(L"themes_set_classic", - l10n_util::GetString(IDS_THEMES_SET_CLASSIC)); - localized_strings->SetString(L"showWindow_decorations_radio", - l10n_util::GetString(IDS_SHOW_WINDOW_DECORATIONS_RADIO)); - localized_strings->SetString(L"hideWindow_decorations_radio", - l10n_util::GetString(IDS_HIDE_WINDOW_DECORATIONS_RADIO)); - localized_strings->SetString(L"themes_gallery", - l10n_util::GetString(IDS_THEMES_GALLERY_BUTTON)); + localized_strings->SetString("appearance", + l10n_util::GetStringUTF16(IDS_APPEARANCE_GROUP_NAME)); + localized_strings->SetString("themes_GTK_button", + l10n_util::GetStringUTF16(IDS_THEMES_GTK_BUTTON)); + localized_strings->SetString("themes_set_classic", + l10n_util::GetStringUTF16(IDS_THEMES_SET_CLASSIC)); + localized_strings->SetString("showWindow_decorations_radio", + l10n_util::GetStringUTF16(IDS_SHOW_WINDOW_DECORATIONS_RADIO)); + localized_strings->SetString("hideWindow_decorations_radio", + l10n_util::GetStringUTF16(IDS_HIDE_WINDOW_DECORATIONS_RADIO)); + localized_strings->SetString("themes_gallery", + l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_BUTTON)); #else localized_strings->SetString("themes", l10n_util::GetStringUTF16(IDS_THEMES_GROUP_NAME)); diff --git a/chrome/browser/geolocation/geolocation_content_settings_map_unittest.cc b/chrome/browser/geolocation/geolocation_content_settings_map_unittest.cc index aa863c5..a46b611 100644 --- a/chrome/browser/geolocation/geolocation_content_settings_map_unittest.cc +++ b/chrome/browser/geolocation/geolocation_content_settings_map_unittest.cc @@ -213,11 +213,11 @@ TEST_F(GeolocationContentSettingsMapTests, IgnoreInvalidURLsInPrefs) { prefs::kGeolocationContentSettings); // For simplicity, use the overloads that do path expansion. As '.' is the // path separator, we can't have dotted hostnames (which is fine). - all_settings_dictionary->SetInteger(L"http://a/.http://b/", + all_settings_dictionary->SetInteger("http://a/.http://b/", CONTENT_SETTING_ALLOW); - all_settings_dictionary->SetInteger(L"bad_requester.http://b/", + all_settings_dictionary->SetInteger("bad_requester.http://b/", CONTENT_SETTING_ALLOW); - all_settings_dictionary->SetInteger(L"http://a/.bad-embedder", + all_settings_dictionary->SetInteger("http://a/.bad-embedder", CONTENT_SETTING_ALLOW); GeolocationContentSettingsMap* map = diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc index 1fd21d0..8f8aee1 100644 --- a/chrome/browser/importer/firefox_importer_utils.cc +++ b/chrome/browser/importer/firefox_importer_utils.cc @@ -133,35 +133,35 @@ void ParseProfileINI(const FilePath& file, DictionaryValue* root) { // Parses the file. root->Clear(); - std::wstring current_section; + std::string current_section; for (size_t i = 0; i < lines.size(); ++i) { - std::wstring line = UTF8ToWide(lines[i]); + std::string line = lines[i]; if (line.empty()) { // Skips the empty line. continue; } - if (line[0] == L'#' || line[0] == L';') { + if (line[0] == '#' || line[0] == ';') { // This line is a comment. continue; } - if (line[0] == L'[') { + if (line[0] == '[') { // It is a section header. current_section = line.substr(1); - size_t end = current_section.rfind(L']'); - if (end != std::wstring::npos) + size_t end = current_section.rfind(']'); + if (end != std::string::npos) current_section.erase(end); } else { - std::wstring key, value; - size_t equal = line.find(L'='); - if (equal != std::wstring::npos) { + std::string key, value; + size_t equal = line.find('='); + if (equal != std::string::npos) { key = line.substr(0, equal); value = line.substr(equal + 1); // Checks whether the section and key contain a '.' character. // Those sections and keys break DictionaryValue's path format, // so we discard them. - if (current_section.find(L'.') == std::wstring::npos && - key.find(L'.') == std::wstring::npos) - root->SetString(current_section + L"." + key, value); + if (current_section.find('.') == std::string::npos && + key.find('.') == std::string::npos) + root->SetString(current_section + "." + key, value); } } } @@ -420,7 +420,7 @@ bool ParsePrefFile(const FilePath& pref_file, DictionaryValue* prefs) { // Value could be a boolean. bool is_value_true = LowerCaseEqualsASCII(value, "true"); if (is_value_true || LowerCaseEqualsASCII(value, "false")) { - prefs->SetBoolean(ASCIIToWide(key), is_value_true); + prefs->SetBoolean(key, is_value_true); continue; } @@ -431,7 +431,7 @@ bool ParsePrefFile(const FilePath& pref_file, DictionaryValue* prefs) { // ValueString only accept valid UTF-8. Simply ignore that entry if it is // not UTF-8. if (IsStringUTF8(value)) - prefs->SetString(ASCIIToWide(key), value); + prefs->SetString(key, value); else LOG(INFO) << "Non UTF8 value for key " << key << ", ignored."; continue; @@ -440,7 +440,7 @@ bool ParsePrefFile(const FilePath& pref_file, DictionaryValue* prefs) { // Or value could be an integer. int int_value = 0; if (base::StringToInt(value, &int_value)) { - prefs->SetInteger(ASCIIToWide(key), int_value); + prefs->SetInteger(key, int_value); continue; } diff --git a/chrome/browser/policy/config_dir_policy_provider.cc b/chrome/browser/policy/config_dir_policy_provider.cc index 92e9714..59509fc 100644 --- a/chrome/browser/policy/config_dir_policy_provider.cc +++ b/chrome/browser/policy/config_dir_policy_provider.cc @@ -64,8 +64,7 @@ void ConfigDirPolicyProvider::DecodePolicyValueTree( i != mapping->end(); ++i) { const PolicyValueMapEntry& entry(*i); Value* value; - if (policies->Get(UTF8ToWide(entry.name), &value) && - value->IsType(entry.value_type)) + if (policies->Get(entry.name, &value) && value->IsType(entry.value_type)) store->Apply(entry.policy_type, value->DeepCopy()); } diff --git a/chrome/browser/remoting/remoting_resources_source.cc b/chrome/browser/remoting/remoting_resources_source.cc index b7e68dc..f49e335 100644 --- a/chrome/browser/remoting/remoting_resources_source.cc +++ b/chrome/browser/remoting/remoting_resources_source.cc @@ -42,48 +42,48 @@ void RemotingResourcesSource::StartDataRequest(const std::string& path_raw, DictionaryValue localized_strings; // Start by setting the per-locale URLs we show on the setup wizard. - localized_strings.SetString(L"invalidpasswordhelpurl", + localized_strings.SetString("invalidpasswordhelpurl", GetLocalizedUrl(kInvalidPasswordHelpUrl)); - localized_strings.SetString(L"cannotaccessaccounturl", + localized_strings.SetString("cannotaccessaccounturl", GetLocalizedUrl(kCanNotAccessAccountUrl)); - localized_strings.SetString(L"createnewaccounturl", + localized_strings.SetString("createnewaccounturl", GetLocalizedUrl(kCreateNewAccountUrl)); - localized_strings.SetString(L"settingupsync", - l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP_SYNC)); - localized_strings.SetString(L"introduction", - std::wstring(L"Remoting ") + - l10n_util::GetString(IDS_PRODUCT_NAME)); - localized_strings.SetString(L"signinprefix", - l10n_util::GetString(IDS_SYNC_LOGIN_SIGNIN_PREFIX)); - localized_strings.SetString(L"signinsuffix", - l10n_util::GetString(IDS_SYNC_LOGIN_SIGNIN_SUFFIX)); - localized_strings.SetString(L"cannotbeblank", - l10n_util::GetString(IDS_SYNC_CANNOT_BE_BLANK)); - localized_strings.SetString(L"emaillabel", - l10n_util::GetString(IDS_SYNC_LOGIN_EMAIL)); - localized_strings.SetString(L"passwordlabel", - l10n_util::GetString(IDS_SYNC_LOGIN_PASSWORD)); - localized_strings.SetString(L"invalidcredentials", - l10n_util::GetString(IDS_SYNC_INVALID_USER_CREDENTIALS)); - localized_strings.SetString(L"signin", - l10n_util::GetString(IDS_SYNC_SIGNIN)); - localized_strings.SetString(L"couldnotconnect", - l10n_util::GetString(IDS_SYNC_LOGIN_COULD_NOT_CONNECT)); - localized_strings.SetString(L"cannotaccessaccount", - l10n_util::GetString(IDS_SYNC_CANNOT_ACCESS_ACCOUNT)); - localized_strings.SetString(L"createaccount", - l10n_util::GetString(IDS_SYNC_CREATE_ACCOUNT)); - localized_strings.SetString(L"cancel", - l10n_util::GetString(IDS_CANCEL)); - localized_strings.SetString(L"settingup", - l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP)); - localized_strings.SetString(L"success", - l10n_util::GetString(IDS_SYNC_SUCCESS)); - localized_strings.SetString(L"errorsigningin", - l10n_util::GetString(IDS_SYNC_ERROR_SIGNING_IN)); - localized_strings.SetString(L"captchainstructions", - l10n_util::GetString(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS)); + localized_strings.SetString("settingupsync", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SETTING_UP_SYNC)); + localized_strings.SetString("introduction", + ASCIIToUTF16("Remoting ") + + l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); + localized_strings.SetString("signinprefix", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SIGNIN_PREFIX)); + localized_strings.SetString("signinsuffix", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SIGNIN_SUFFIX)); + localized_strings.SetString("cannotbeblank", + l10n_util::GetStringUTF16(IDS_SYNC_CANNOT_BE_BLANK)); + localized_strings.SetString("emaillabel", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_EMAIL)); + localized_strings.SetString("passwordlabel", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_PASSWORD)); + localized_strings.SetString("invalidcredentials", + l10n_util::GetStringUTF16(IDS_SYNC_INVALID_USER_CREDENTIALS)); + localized_strings.SetString("signin", + l10n_util::GetStringUTF16(IDS_SYNC_SIGNIN)); + localized_strings.SetString("couldnotconnect", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_COULD_NOT_CONNECT)); + localized_strings.SetString("cannotaccessaccount", + l10n_util::GetStringUTF16(IDS_SYNC_CANNOT_ACCESS_ACCOUNT)); + localized_strings.SetString("createaccount", + l10n_util::GetStringUTF16(IDS_SYNC_CREATE_ACCOUNT)); + localized_strings.SetString("cancel", + l10n_util::GetStringUTF16(IDS_CANCEL)); + localized_strings.SetString("settingup", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SETTING_UP)); + localized_strings.SetString("success", + l10n_util::GetStringUTF16(IDS_SYNC_SUCCESS)); + localized_strings.SetString("errorsigningin", + l10n_util::GetStringUTF16(IDS_SYNC_ERROR_SIGNING_IN)); + localized_strings.SetString("captchainstructions", + l10n_util::GetStringUTF16(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS)); static const base::StringPiece html(ResourceBundle::GetSharedInstance() .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); SetFontAndTextDirection(&localized_strings); @@ -91,10 +91,10 @@ void RemotingResourcesSource::StartDataRequest(const std::string& path_raw, html, &localized_strings); } else if (path_raw == kRemotingSetupDonePath) { DictionaryValue localized_strings; - localized_strings.SetString(L"success", - l10n_util::GetString(IDS_SYNC_SUCCESS)); - localized_strings.SetString(L"okay", - l10n_util::GetString(IDS_SYNC_SETUP_OK_BUTTON_LABEL)); + localized_strings.SetString("success", + l10n_util::GetStringUTF16(IDS_SYNC_SUCCESS)); + localized_strings.SetString("okay", + l10n_util::GetStringUTF16(IDS_SYNC_SETUP_OK_BUTTON_LABEL)); static const base::StringPiece html(ResourceBundle::GetSharedInstance() .GetRawDataResource(IDR_REMOTING_SETUP_DONE_HTML)); SetFontAndTextDirection(&localized_strings); diff --git a/chrome/browser/remoting/remoting_setup_flow.cc b/chrome/browser/remoting/remoting_setup_flow.cc index ce5574e..27deaff 100644 --- a/chrome/browser/remoting/remoting_setup_flow.cc +++ b/chrome/browser/remoting/remoting_setup_flow.cc @@ -70,10 +70,10 @@ void RemotingSetupFlow::OnDialogClosed(const std::string& json_retval) { // static void RemotingSetupFlow::GetArgsForGaiaLogin(DictionaryValue* args) { - args->SetString(L"iframeToShow", "login"); - args->SetString(L"user", std::wstring()); - args->SetInteger(L"error", 0); - args->SetBoolean(L"editable_user", true); + args->SetString("iframeToShow", "login"); + args->SetString("user", ""); + args->SetInteger("error", 0); + args->SetBoolean("editable_user", true); } void RemotingSetupFlow::GetDOMMessageHandlers( diff --git a/chrome/browser/session_startup_pref.cc b/chrome/browser/session_startup_pref.cc index 1da5802..b0c2b6e 100644 --- a/chrome/browser/session_startup_pref.cc +++ b/chrome/browser/session_startup_pref.cc @@ -72,7 +72,7 @@ void SessionStartupPref::SetStartupPref(PrefService* prefs, url_pref_list->Clear(); for (size_t i = 0; i < pref.urls.size(); ++i) { url_pref_list->Set(static_cast<int>(i), - new StringValue(UTF8ToWide(pref.urls[i].spec()))); + new StringValue(pref.urls[i].spec())); } } diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc index b6be8ed..6b9cd97 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -9,6 +9,7 @@ #include "base/histogram.h" #include "base/i18n/rtl.h" #include "base/string_piece.h" +#include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser.h" #include "chrome/browser/cert_store.h" @@ -67,30 +68,32 @@ std::string SSLBlockingPage::GetHTMLContents() { // Let's build the html error page. DictionaryValue strings; SSLErrorInfo error_info = delegate_->GetSSLErrorInfo(handler_); - strings.SetString(L"headLine", error_info.title()); - strings.SetString(L"description", error_info.details()); + strings.SetString("headLine", WideToUTF16Hack(error_info.title())); + strings.SetString("description", WideToUTF16Hack(error_info.details())); - strings.SetString(L"moreInfoTitle", - l10n_util::GetString(IDS_CERT_ERROR_EXTRA_INFO_TITLE)); + strings.SetString("moreInfoTitle", + l10n_util::GetStringUTF16(IDS_CERT_ERROR_EXTRA_INFO_TITLE)); SetExtraInfo(&strings, error_info.extra_information()); int resource_id; if (error_level_ == ERROR_OVERRIDABLE) { resource_id = IDR_SSL_ROAD_BLOCK_HTML; - strings.SetString(L"title", - l10n_util::GetString(IDS_SSL_BLOCKING_PAGE_TITLE)); - strings.SetString(L"proceed", - l10n_util::GetString(IDS_SSL_BLOCKING_PAGE_PROCEED)); - strings.SetString(L"exit", - l10n_util::GetString(IDS_SSL_BLOCKING_PAGE_EXIT)); + strings.SetString("title", + l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_TITLE)); + strings.SetString("proceed", + l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_PROCEED)); + strings.SetString("exit", + l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_EXIT)); } else { DCHECK_EQ(error_level_, ERROR_FATAL); resource_id = IDR_SSL_ERROR_HTML; - strings.SetString(L"title", l10n_util::GetString(IDS_SSL_ERROR_PAGE_TITLE)); - strings.SetString(L"back", l10n_util::GetString(IDS_SSL_ERROR_PAGE_BACK)); + strings.SetString("title", + l10n_util::GetStringUTF16(IDS_SSL_ERROR_PAGE_TITLE)); + strings.SetString("back", + l10n_util::GetStringUTF16(IDS_SSL_ERROR_PAGE_BACK)); } - strings.SetString(L"textdirection", base::i18n::IsRTL() ? L"rtl" : L"ltr"); + strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr"); base::StringPiece html( ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id)); @@ -157,14 +160,14 @@ void SSLBlockingPage::SetExtraInfo( DictionaryValue* strings, const std::vector<std::wstring>& extra_info) { DCHECK(extra_info.size() < 5); // We allow 5 paragraphs max. - const std::wstring keys[5] = { - L"moreInfo1", L"moreInfo2", L"moreInfo3", L"moreInfo4", L"moreInfo5" + const char* keys[5] = { + "moreInfo1", "moreInfo2", "moreInfo3", "moreInfo4", "moreInfo5" }; int i; for (i = 0; i < static_cast<int>(extra_info.size()); i++) { - strings->SetString(keys[i], extra_info[i]); + strings->SetString(keys[i], WideToUTF16Hack(extra_info[i])); } - for (;i < 5; i++) { - strings->SetString(keys[i], L""); + for (; i < 5; i++) { + strings->SetString(keys[i], ""); } } diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/sync/sync_setup_wizard.cc index 9998025..1809c33 100644 --- a/chrome/browser/sync/sync_setup_wizard.cc +++ b/chrome/browser/sync/sync_setup_wizard.cc @@ -70,48 +70,48 @@ void SyncResourcesSource::StartDataRequest(const std::string& path_raw, DictionaryValue localized_strings; // Start by setting the per-locale URLs we show on the setup wizard. - localized_strings.SetString(L"invalidpasswordhelpurl", + localized_strings.SetString("invalidpasswordhelpurl", GetLocalizedUrl(kInvalidPasswordHelpUrl)); - localized_strings.SetString(L"cannotaccessaccounturl", + localized_strings.SetString("cannotaccessaccounturl", GetLocalizedUrl(kCanNotAccessAccountUrl)); - localized_strings.SetString(L"createnewaccounturl", + localized_strings.SetString("createnewaccounturl", GetLocalizedUrl(kCreateNewAccountUrl)); - localized_strings.SetString(L"settingupsync", - l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP_SYNC)); - localized_strings.SetString(L"introduction", - l10n_util::GetStringF(IDS_SYNC_LOGIN_INTRODUCTION, - l10n_util::GetString(IDS_PRODUCT_NAME))); - localized_strings.SetString(L"signinprefix", - l10n_util::GetString(IDS_SYNC_LOGIN_SIGNIN_PREFIX)); - localized_strings.SetString(L"signinsuffix", - l10n_util::GetString(IDS_SYNC_LOGIN_SIGNIN_SUFFIX)); - localized_strings.SetString(L"cannotbeblank", - l10n_util::GetString(IDS_SYNC_CANNOT_BE_BLANK)); - localized_strings.SetString(L"emaillabel", - l10n_util::GetString(IDS_SYNC_LOGIN_EMAIL)); - localized_strings.SetString(L"passwordlabel", - l10n_util::GetString(IDS_SYNC_LOGIN_PASSWORD)); - localized_strings.SetString(L"invalidcredentials", - l10n_util::GetString(IDS_SYNC_INVALID_USER_CREDENTIALS)); - localized_strings.SetString(L"signin", - l10n_util::GetString(IDS_SYNC_SIGNIN)); - localized_strings.SetString(L"couldnotconnect", - l10n_util::GetString(IDS_SYNC_LOGIN_COULD_NOT_CONNECT)); - localized_strings.SetString(L"cannotaccessaccount", - l10n_util::GetString(IDS_SYNC_CANNOT_ACCESS_ACCOUNT)); - localized_strings.SetString(L"createaccount", - l10n_util::GetString(IDS_SYNC_CREATE_ACCOUNT)); - localized_strings.SetString(L"cancel", - l10n_util::GetString(IDS_CANCEL)); - localized_strings.SetString(L"settingup", - l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP)); - localized_strings.SetString(L"success", - l10n_util::GetString(IDS_SYNC_SUCCESS)); - localized_strings.SetString(L"errorsigningin", - l10n_util::GetString(IDS_SYNC_ERROR_SIGNING_IN)); - localized_strings.SetString(L"captchainstructions", - l10n_util::GetString(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS)); + localized_strings.SetString("settingupsync", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SETTING_UP_SYNC)); + localized_strings.SetString("introduction", + l10n_util::GetStringFUTF16(IDS_SYNC_LOGIN_INTRODUCTION, + l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); + localized_strings.SetString("signinprefix", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SIGNIN_PREFIX)); + localized_strings.SetString("signinsuffix", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SIGNIN_SUFFIX)); + localized_strings.SetString("cannotbeblank", + l10n_util::GetStringUTF16(IDS_SYNC_CANNOT_BE_BLANK)); + localized_strings.SetString("emaillabel", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_EMAIL)); + localized_strings.SetString("passwordlabel", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_PASSWORD)); + localized_strings.SetString("invalidcredentials", + l10n_util::GetStringUTF16(IDS_SYNC_INVALID_USER_CREDENTIALS)); + localized_strings.SetString("signin", + l10n_util::GetStringUTF16(IDS_SYNC_SIGNIN)); + localized_strings.SetString("couldnotconnect", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_COULD_NOT_CONNECT)); + localized_strings.SetString("cannotaccessaccount", + l10n_util::GetStringUTF16(IDS_SYNC_CANNOT_ACCESS_ACCOUNT)); + localized_strings.SetString("createaccount", + l10n_util::GetStringUTF16(IDS_SYNC_CREATE_ACCOUNT)); + localized_strings.SetString("cancel", + l10n_util::GetStringUTF16(IDS_CANCEL)); + localized_strings.SetString("settingup", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SETTING_UP)); + localized_strings.SetString("success", + l10n_util::GetStringUTF16(IDS_SYNC_SUCCESS)); + localized_strings.SetString("errorsigningin", + l10n_util::GetStringUTF16(IDS_SYNC_ERROR_SIGNING_IN)); + localized_strings.SetString("captchainstructions", + l10n_util::GetStringUTF16(IDS_SYNC_GAIA_CAPTCHA_INSTRUCTIONS)); static const base::StringPiece html(ResourceBundle::GetSharedInstance() .GetRawDataResource(IDR_GAIA_LOGIN_HTML)); SetFontAndTextDirection(&localized_strings); @@ -119,41 +119,41 @@ void SyncResourcesSource::StartDataRequest(const std::string& path_raw, html, &localized_strings); } else if (path_raw == kSyncChooseDataTypesPath) { DictionaryValue localized_strings; - localized_strings.SetString(L"choosedatatypesheader", - l10n_util::GetString(IDS_SYNC_CHOOSE_DATATYPES_HEADER)); - localized_strings.SetString(L"choosedatatypesinstructions", - l10n_util::GetStringF(IDS_SYNC_CHOOSE_DATATYPES_INSTRUCTIONS, - l10n_util::GetString(IDS_PRODUCT_NAME))); - localized_strings.SetString(L"keepeverythingsynced", - l10n_util::GetString(IDS_SYNC_EVERYTHING)); - localized_strings.SetString(L"choosedatatypes", - l10n_util::GetString(IDS_SYNC_CHOOSE_DATATYPES)); - localized_strings.SetString(L"bookmarks", - l10n_util::GetString(IDS_SYNC_DATATYPE_BOOKMARKS)); - localized_strings.SetString(L"preferences", - l10n_util::GetString(IDS_SYNC_DATATYPE_PREFERENCES)); - localized_strings.SetString(L"autofill", - l10n_util::GetString(IDS_SYNC_DATATYPE_AUTOFILL)); - localized_strings.SetString(L"themes", - l10n_util::GetString(IDS_SYNC_DATATYPE_THEMES)); - localized_strings.SetString(L"passwords", - l10n_util::GetString(IDS_SYNC_DATATYPE_PASSWORDS)); - localized_strings.SetString(L"extensions", - l10n_util::GetString(IDS_SYNC_DATATYPE_EXTENSIONS)); - localized_strings.SetString(L"typedurls", - l10n_util::GetString(IDS_SYNC_DATATYPE_TYPED_URLS)); - localized_strings.SetString(L"apps", - l10n_util::GetString(IDS_SYNC_DATATYPE_APPS)); - localized_strings.SetString(L"synczerodatatypeserror", - l10n_util::GetString(IDS_SYNC_ZERO_DATA_TYPES_ERROR)); - localized_strings.SetString(L"setupabortederror", - l10n_util::GetString(IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR)); - localized_strings.SetString(L"ok", - l10n_util::GetString(IDS_OK)); - localized_strings.SetString(L"cancel", - l10n_util::GetString(IDS_CANCEL)); - localized_strings.SetString(L"settingup", - l10n_util::GetString(IDS_SYNC_LOGIN_SETTING_UP)); + localized_strings.SetString("choosedatatypesheader", + l10n_util::GetStringUTF16(IDS_SYNC_CHOOSE_DATATYPES_HEADER)); + localized_strings.SetString("choosedatatypesinstructions", + l10n_util::GetStringFUTF16(IDS_SYNC_CHOOSE_DATATYPES_INSTRUCTIONS, + l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); + localized_strings.SetString("keepeverythingsynced", + l10n_util::GetStringUTF16(IDS_SYNC_EVERYTHING)); + localized_strings.SetString("choosedatatypes", + l10n_util::GetStringUTF16(IDS_SYNC_CHOOSE_DATATYPES)); + localized_strings.SetString("bookmarks", + l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_BOOKMARKS)); + localized_strings.SetString("preferences", + l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_PREFERENCES)); + localized_strings.SetString("autofill", + l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_AUTOFILL)); + localized_strings.SetString("themes", + l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_THEMES)); + localized_strings.SetString("passwords", + l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_PASSWORDS)); + localized_strings.SetString("extensions", + l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_EXTENSIONS)); + localized_strings.SetString("typedurls", + l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_TYPED_URLS)); + localized_strings.SetString("apps", + l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_APPS)); + localized_strings.SetString("synczerodatatypeserror", + l10n_util::GetStringUTF16(IDS_SYNC_ZERO_DATA_TYPES_ERROR)); + localized_strings.SetString("setupabortederror", + l10n_util::GetStringUTF16(IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR)); + localized_strings.SetString("ok", + l10n_util::GetStringUTF16(IDS_OK)); + localized_strings.SetString("cancel", + l10n_util::GetStringUTF16(IDS_CANCEL)); + localized_strings.SetString("settingup", + l10n_util::GetStringUTF16(IDS_SYNC_LOGIN_SETTING_UP)); static const base::StringPiece html(ResourceBundle::GetSharedInstance() .GetRawDataResource(IDR_SYNC_CHOOSE_DATATYPES_HTML)); SetFontAndTextDirection(&localized_strings); @@ -161,15 +161,15 @@ void SyncResourcesSource::StartDataRequest(const std::string& path_raw, html, &localized_strings); } else if (path_raw == kSyncSetupDonePath) { DictionaryValue localized_strings; - localized_strings.SetString(L"success", - l10n_util::GetString(IDS_SYNC_SUCCESS)); - localized_strings.SetString(L"setupsummary", - l10n_util::GetStringF(IDS_SYNC_SETUP_ALL_DONE, - l10n_util::GetString(IDS_PRODUCT_NAME))); - localized_strings.SetString(L"firsttimesetupsummary", - l10n_util::GetString(IDS_SYNC_SETUP_FIRST_TIME_ALL_DONE)); - localized_strings.SetString(L"okay", - l10n_util::GetString(IDS_SYNC_SETUP_OK_BUTTON_LABEL)); + localized_strings.SetString("success", + l10n_util::GetStringUTF16(IDS_SYNC_SUCCESS)); + localized_strings.SetString("setupsummary", + l10n_util::GetStringFUTF16(IDS_SYNC_SETUP_ALL_DONE, + l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); + localized_strings.SetString("firsttimesetupsummary", + l10n_util::GetStringUTF16(IDS_SYNC_SETUP_FIRST_TIME_ALL_DONE)); + localized_strings.SetString("okay", + l10n_util::GetStringUTF16(IDS_SYNC_SETUP_OK_BUTTON_LABEL)); static const base::StringPiece html(ResourceBundle::GetSharedInstance() .GetRawDataResource(IDR_SYNC_SETUP_DONE_HTML)); SetFontAndTextDirection(&localized_strings); diff --git a/chrome/common/common_param_traits_unittest.cc b/chrome/common/common_param_traits_unittest.cc index 032f471..37b846c 100644 --- a/chrome/common/common_param_traits_unittest.cc +++ b/chrome/common/common_param_traits_unittest.cc @@ -146,21 +146,21 @@ TEST(IPCMessageTest, ListValue) { TEST(IPCMessageTest, DictionaryValue) { DictionaryValue input; - input.Set(L"null", Value::CreateNullValue()); - input.Set(L"bool", Value::CreateBooleanValue(true)); - input.Set(L"int", Value::CreateIntegerValue(42)); + input.Set("null", Value::CreateNullValue()); + input.Set("bool", Value::CreateBooleanValue(true)); + input.Set("int", Value::CreateIntegerValue(42)); scoped_ptr<DictionaryValue> subdict(new DictionaryValue()); - subdict->Set(L"str", Value::CreateStringValue("forty two")); - subdict->Set(L"bool", Value::CreateBooleanValue(false)); + subdict->Set("str", Value::CreateStringValue("forty two")); + subdict->Set("bool", Value::CreateBooleanValue(false)); scoped_ptr<ListValue> sublist(new ListValue()); sublist->Set(0, Value::CreateRealValue(42.42)); sublist->Set(1, Value::CreateStringValue("forty")); sublist->Set(2, Value::CreateStringValue("two")); - subdict->Set(L"list", sublist.release()); + subdict->Set("list", sublist.release()); - input.Set(L"dict", subdict.release()); + input.Set("dict", subdict.release()); IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); IPC::WriteParam(&msg, input); diff --git a/chrome/common/extensions/extension_l10n_util_unittest.cc b/chrome/common/extensions/extension_l10n_util_unittest.cc index b00044c..2aafebb 100644 --- a/chrome/common/extensions/extension_l10n_util_unittest.cc +++ b/chrome/common/extensions/extension_l10n_util_unittest.cc @@ -230,16 +230,16 @@ ExtensionMessageBundle* CreateManifestBundle() { linked_ptr<DictionaryValue> catalog(new DictionaryValue); DictionaryValue* name_tree = new DictionaryValue(); - name_tree->SetString(L"message", "name"); - catalog->Set(L"name", name_tree); + name_tree->SetString("message", "name"); + catalog->Set("name", name_tree); DictionaryValue* description_tree = new DictionaryValue(); - description_tree->SetString(L"message", "description"); - catalog->Set(L"description", description_tree); + description_tree->SetString("message", "description"); + catalog->Set("description", description_tree); DictionaryValue* action_title_tree = new DictionaryValue(); - action_title_tree->SetString(L"message", "action title"); - catalog->Set(L"title", action_title_tree); + action_title_tree->SetString("message", "action title"); + catalog->Set("title", action_title_tree); std::vector<linked_ptr<DictionaryValue> > catalogs; catalogs.push_back(catalog); diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc index 3eab112..1bed28b 100644 --- a/chrome/common/extensions/extension_unittest.cc +++ b/chrome/common/extensions/extension_unittest.cc @@ -126,7 +126,7 @@ TEST(ExtensionTest, InitFromValueInvalid) { DictionaryValue* icons = NULL; input_value->GetDictionary(keys::kIcons, &icons); ASSERT_FALSE(NULL == icons); - icons->SetInteger(ASCIIToWide(base::IntToString(128)), 42); + icons->SetInteger(base::IntToString(128), 42); EXPECT_FALSE(extension.InitFromValue(*input_value, true, &error)); EXPECT_TRUE(MatchPatternASCII(error, errors::kInvalidIconPath)); diff --git a/chrome/common/extensions/extension_unpacker.cc b/chrome/common/extensions/extension_unpacker.cc index 64ff857..014a0e3 100644 --- a/chrome/common/extensions/extension_unpacker.cc +++ b/chrome/common/extensions/extension_unpacker.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. @@ -10,6 +10,7 @@ #include "base/scoped_temp_dir.h" #include "base/string_util.h" #include "base/thread.h" +#include "base/utf_string_conversions.h" #include "base/values.h" #include "net/base/file_stream.h" #include "chrome/common/chrome_switches.h" @@ -313,7 +314,7 @@ bool ExtensionUnpacker::ReadMessageCatalog(const FilePath& message_path) { if (!temp_install_dir_.AppendRelativePath(message_path, &relative_path)) NOTREACHED(); - parsed_catalogs_->Set(relative_path.DirName().ToWStringHack(), + parsed_catalogs_->Set(WideToUTF8(relative_path.DirName().ToWStringHack()), root.release()); return true; diff --git a/chrome/common/net/net_resource_provider.cc b/chrome/common/net/net_resource_provider.cc index 6992470..c64c81d 100644 --- a/chrome/common/net/net_resource_provider.cc +++ b/chrome/common/net/net_resource_provider.cc @@ -25,19 +25,19 @@ namespace { struct LazyDirectoryListerCacher { LazyDirectoryListerCacher() { DictionaryValue value; - value.SetString(L"header", - l10n_util::GetString(IDS_DIRECTORY_LISTING_HEADER)); - value.SetString(L"parentDirText", - l10n_util::GetString(IDS_DIRECTORY_LISTING_PARENT)); - value.SetString(L"headerName", - l10n_util::GetString(IDS_DIRECTORY_LISTING_NAME)); - value.SetString(L"headerSize", - l10n_util::GetString(IDS_DIRECTORY_LISTING_SIZE)); - value.SetString(L"headerDateModified", - l10n_util::GetString(IDS_DIRECTORY_LISTING_DATE_MODIFIED)); - value.SetString(L"listingParsingErrorBoxText", - l10n_util::GetStringF(IDS_DIRECTORY_LISTING_PARSING_ERROR_BOX_TEXT, - l10n_util::GetString(IDS_PRODUCT_NAME))); + value.SetString("header", + l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_HEADER)); + value.SetString("parentDirText", + l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_PARENT)); + value.SetString("headerName", + l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_NAME)); + value.SetString("headerSize", + l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_SIZE)); + value.SetString("headerDateModified", + l10n_util::GetStringUTF16(IDS_DIRECTORY_LISTING_DATE_MODIFIED)); + value.SetString("listingParsingErrorBoxText", + l10n_util::GetStringFUTF16(IDS_DIRECTORY_LISTING_PARSING_ERROR_BOX_TEXT, + l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); html_data = jstemplate_builder::GetI18nTemplateHtml( ResourceBundle::GetSharedInstance().GetRawDataResource( IDR_DIR_HEADER_HTML), diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc index b3c0973..b2b9aee 100644 --- a/chrome/renderer/blocked_plugin.cc +++ b/chrome/renderer/blocked_plugin.cc @@ -52,14 +52,14 @@ BlockedPlugin::BlockedPlugin(RenderView* render_view, << resource_id; DictionaryValue values; - values.SetString(L"loadPlugin", + values.SetString("loadPlugin", l10n_util::GetStringUTF16(IDS_PLUGIN_LOAD)); - values.SetString(L"updatePlugin", + values.SetString("updatePlugin", l10n_util::GetStringUTF16(IDS_PLUGIN_UPDATE)); - values.SetString(L"message", + values.SetString("message", l10n_util::GetStringUTF16(IDS_BLOCKED_PLUGINS_TITLE)); if (group) - values.Set(L"pluginGroup", group->GetDataForUI()); + values.Set("pluginGroup", group->GetDataForUI()); // "t" is the id of the templates root node. std::string htmlData = jstemplate_builder::GetTemplatesHtml( diff --git a/chrome/test/automation/javascript_message_utils.h b/chrome/test/automation/javascript_message_utils.h index bdfe400..1f48337 100644 --- a/chrome/test/automation/javascript_message_utils.h +++ b/chrome/test/automation/javascript_message_utils.h @@ -73,8 +73,8 @@ struct ValueConversionTraits<DOMElementProxy::By> { NOTREACHED(); break; } - value->SetString(L"type", by_type); - value->SetString(L"queryString", t.query()); + value->SetString("type", by_type); + value->SetString("queryString", t.query()); return value; } }; diff --git a/ipc/ipc_message_unittest.cc b/ipc/ipc_message_unittest.cc index 36a3229..f66751f 100644 --- a/ipc/ipc_message_unittest.cc +++ b/ipc/ipc_message_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -34,21 +34,21 @@ TEST(IPCMessageTest, ListValue) { TEST(IPCMessageTest, DictionaryValue) { DictionaryValue input; - input.Set(L"null", Value::CreateNullValue()); - input.Set(L"bool", Value::CreateBooleanValue(true)); - input.Set(L"int", Value::CreateIntegerValue(42)); + input.Set("null", Value::CreateNullValue()); + input.Set("bool", Value::CreateBooleanValue(true)); + input.Set("int", Value::CreateIntegerValue(42)); scoped_ptr<DictionaryValue> subdict(new DictionaryValue()); - subdict->Set(L"str", Value::CreateStringValue("forty two")); - subdict->Set(L"bool", Value::CreateBooleanValue(false)); + subdict->Set("str", Value::CreateStringValue("forty two")); + subdict->Set("bool", Value::CreateBooleanValue(false)); scoped_ptr<ListValue> sublist(new ListValue()); sublist->Set(0, Value::CreateRealValue(42.42)); sublist->Set(1, Value::CreateStringValue("forty")); sublist->Set(2, Value::CreateStringValue("two")); - subdict->Set(L"list", sublist.release()); + subdict->Set("list", sublist.release()); - input.Set(L"dict", subdict.release()); + input.Set("dict", subdict.release()); IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); IPC::WriteParam(&msg, input); |