diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 18:15:40 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 18:15:40 +0000 |
commit | d519b817a17433f6c9ea3813d18dfe084659cd1a (patch) | |
tree | 2f1eca3347e14d496382e3dd1d0076941d0e654a /components | |
parent | 5156aa40ae3fa326660297ec66f73ee5c69ceb2d (diff) | |
download | chromium_src-d519b817a17433f6c9ea3813d18dfe084659cd1a.zip chromium_src-d519b817a17433f6c9ea3813d18dfe084659cd1a.tar.gz chromium_src-d519b817a17433f6c9ea3813d18dfe084659cd1a.tar.bz2 |
Update uses of UTF conversions in chrome_frame/, chromeos/, components/ to use the base:: namespace.
BUG=330556
TEST=no change
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/112433004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
88 files changed, 301 insertions, 220 deletions
diff --git a/components/autofill/content/browser/autofill_driver_impl_unittest.cc b/components/autofill/content/browser/autofill_driver_impl_unittest.cc index 1dcf256..939aa8ce 100644 --- a/components/autofill/content/browser/autofill_driver_impl_unittest.cc +++ b/components/autofill/content/browser/autofill_driver_impl_unittest.cc @@ -252,7 +252,7 @@ TEST_F(AutofillDriverImplTest, FillActionSentToRenderer) { } TEST_F(AutofillDriverImplTest, AcceptDataListSuggestion) { - base::string16 input_value(ASCIIToUTF16("barfoo")); + base::string16 input_value(base::ASCIIToUTF16("barfoo")); base::string16 output_value; driver_->RendererShouldAcceptDataListSuggestion(input_value); EXPECT_TRUE(GetString16FromMessageWithID( @@ -262,7 +262,7 @@ TEST_F(AutofillDriverImplTest, AcceptDataListSuggestion) { } TEST_F(AutofillDriverImplTest, AcceptPasswordAutofillSuggestion) { - base::string16 input_value(ASCIIToUTF16("barbaz")); + base::string16 input_value(base::ASCIIToUTF16("barbaz")); base::string16 output_value; driver_->RendererShouldAcceptPasswordAutofillSuggestion(input_value); EXPECT_TRUE(GetString16FromMessageWithID( @@ -282,7 +282,7 @@ TEST_F(AutofillDriverImplTest, ClearPreviewedFormSentToRenderer) { } TEST_F(AutofillDriverImplTest, SetNodeText) { - base::string16 input_value(ASCIIToUTF16("barqux")); + base::string16 input_value(base::ASCIIToUTF16("barqux")); base::string16 output_value; driver_->RendererShouldSetNodeText(input_value); EXPECT_TRUE(GetString16FromMessageWithID(AutofillMsg_SetNodeText::ID, diff --git a/components/autofill/content/browser/risk/fingerprint.cc b/components/autofill/content/browser/risk/fingerprint.cc index f5d1fad..b7aca6a 100644 --- a/components/autofill/content/browser/risk/fingerprint.cc +++ b/components/autofill/content/browser/risk/fingerprint.cc @@ -100,14 +100,14 @@ void AddPluginsToFingerprint(const std::vector<content::WebPluginInfo>& plugins, it != plugins.end(); ++it) { Fingerprint::MachineCharacteristics::Plugin* plugin = machine->add_plugin(); - plugin->set_name(UTF16ToUTF8(it->name)); - plugin->set_description(UTF16ToUTF8(it->desc)); + plugin->set_name(base::UTF16ToUTF8(it->name)); + plugin->set_description(base::UTF16ToUTF8(it->desc)); for (std::vector<content::WebPluginMimeType>::const_iterator mime_type = it->mime_types.begin(); mime_type != it->mime_types.end(); ++mime_type) { plugin->add_mime_type(mime_type->mime_type); } - plugin->set_version(UTF16ToUTF8(it->version)); + plugin->set_version(base::UTF16ToUTF8(it->version)); } } diff --git a/components/autofill/content/browser/wallet/full_wallet.cc b/components/autofill/content/browser/wallet/full_wallet.cc index 4a13b4f..d4b390a 100644 --- a/components/autofill/content/browser/wallet/full_wallet.cc +++ b/components/autofill/content/browser/wallet/full_wallet.cc @@ -157,13 +157,13 @@ scoped_ptr<FullWallet> base::string16 FullWallet::GetInfo(const AutofillType& type) { switch (type.GetStorableType()) { case CREDIT_CARD_NUMBER: - return UTF8ToUTF16(GetPan()); + return base::UTF8ToUTF16(GetPan()); case CREDIT_CARD_NAME: return billing_address()->recipient_name(); case CREDIT_CARD_VERIFICATION_CODE: - return UTF8ToUTF16(GetCvn()); + return base::UTF8ToUTF16(GetCvn()); case CREDIT_CARD_EXP_MONTH: if (expiration_month() == 0) @@ -183,18 +183,18 @@ base::string16 FullWallet::GetInfo(const AutofillType& type) { case CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR: if (expiration_month() == 0 || expiration_year() == 0) return base::string16(); - return base::IntToString16(expiration_month()) + ASCIIToUTF16("/") + + return base::IntToString16(expiration_month()) + base::ASCIIToUTF16("/") + base::IntToString16(expiration_year() % 100); case CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR: if (expiration_month() == 0 || expiration_year() == 0) return base::string16(); - return base::IntToString16(expiration_month()) + ASCIIToUTF16("/") + + return base::IntToString16(expiration_month()) + base::ASCIIToUTF16("/") + base::IntToString16(expiration_year()); case CREDIT_CARD_TYPE: { std::string internal_type = - CreditCard::GetCreditCardType(UTF8ToUTF16(GetPan())); + CreditCard::GetCreditCardType(base::UTF8ToUTF16(GetPan())); if (internal_type == kGenericCard) return base::string16(); return CreditCard::TypeForDisplay(internal_type); diff --git a/components/autofill/content/browser/wallet/full_wallet_unittest.cc b/components/autofill/content/browser/wallet/full_wallet_unittest.cc index 59e6dd9..3d156a8 100644 --- a/components/autofill/content/browser/wallet/full_wallet_unittest.cc +++ b/components/autofill/content/browser/wallet/full_wallet_unittest.cc @@ -15,6 +15,8 @@ #include "components/autofill/core/browser/field_types.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace { const char kFullWalletValidResponse[] = diff --git a/components/autofill/content/browser/wallet/instrument_unittest.cc b/components/autofill/content/browser/wallet/instrument_unittest.cc index b5f273f..7fe3b8e 100644 --- a/components/autofill/content/browser/wallet/instrument_unittest.cc +++ b/components/autofill/content/browser/wallet/instrument_unittest.cc @@ -9,6 +9,8 @@ #include "components/autofill/content/browser/wallet/wallet_test_util.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace { const char kPrimaryAccountNumber[] = "4444444444444448"; diff --git a/components/autofill/content/browser/wallet/wallet_address.cc b/components/autofill/content/browser/wallet/wallet_address.cc index 6d41222..000b616 100644 --- a/components/autofill/content/browser/wallet/wallet_address.cc +++ b/components/autofill/content/browser/wallet/wallet_address.cc @@ -253,7 +253,7 @@ base::string16 Address::DisplayName() const { return recipient_name(); #else // TODO(estade): improve this stub implementation + l10n. - return recipient_name() + ASCIIToUTF16(", ") + address_line_1(); + return recipient_name() + base::ASCIIToUTF16(", ") + address_line_1(); #endif } @@ -279,11 +279,11 @@ base::string16 Address::GetInfo(const AutofillType& type, const std::string& app_locale) const { if (type.html_type() == HTML_TYPE_COUNTRY_CODE) { DCHECK(IsStringASCII(country_name_code())); - return ASCIIToUTF16(country_name_code()); + return base::ASCIIToUTF16(country_name_code()); } else if (type.html_type() == HTML_TYPE_STREET_ADDRESS) { base::string16 address = address_line_1(); if (!address_line_2().empty()) - address += ASCIIToUTF16(", ") + address_line_2(); + address += base::ASCIIToUTF16(", ") + address_line_2(); return address; } diff --git a/components/autofill/content/browser/wallet/wallet_address_unittest.cc b/components/autofill/content/browser/wallet/wallet_address_unittest.cc index 3fc1882..11f6125 100644 --- a/components/autofill/content/browser/wallet/wallet_address_unittest.cc +++ b/components/autofill/content/browser/wallet/wallet_address_unittest.cc @@ -12,6 +12,8 @@ #include "components/autofill/core/browser/autofill_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace { const char kAddressMissingObjectId[] = diff --git a/components/autofill/content/browser/wallet/wallet_client.cc b/components/autofill/content/browser/wallet/wallet_client.cc index c5475cd..59ff353 100644 --- a/components/autofill/content/browser/wallet/wallet_client.cc +++ b/components/autofill/content/browser/wallet/wallet_client.cc @@ -371,9 +371,9 @@ void WalletClient::SaveToWallet( std::string card_verification_number; if (instrument) { primary_account_number = net::EscapeUrlEncodedData( - UTF16ToUTF8(instrument->primary_account_number()), true); + base::UTF16ToUTF8(instrument->primary_account_number()), true); card_verification_number = net::EscapeUrlEncodedData( - UTF16ToUTF8(instrument->card_verification_number()), true); + base::UTF16ToUTF8(instrument->card_verification_number()), true); if (!reference_instrument) { request_dict.Set(kInstrumentKey, instrument->ToDictionary().release()); diff --git a/components/autofill/content/browser/wallet/wallet_items.cc b/components/autofill/content/browser/wallet/wallet_items.cc index f655882..27b7ed4 100644 --- a/components/autofill/content/browser/wallet/wallet_items.cc +++ b/components/autofill/content/browser/wallet/wallet_items.cc @@ -309,7 +309,7 @@ base::string16 WalletItems::MaskedInstrument::DisplayNameDetail() const { base::string16 WalletItems::MaskedInstrument::TypeAndLastFourDigits() const { // TODO(dbeam): i18n. - return DisplayStringFromType(type_) + ASCIIToUTF16(" - ") + + return DisplayStringFromType(type_) + base::ASCIIToUTF16(" - ") + last_four_digits(); } diff --git a/components/autofill/content/browser/wallet/wallet_items_unittest.cc b/components/autofill/content/browser/wallet/wallet_items_unittest.cc index f0f299b..6cf23dc 100644 --- a/components/autofill/content/browser/wallet/wallet_items_unittest.cc +++ b/components/autofill/content/browser/wallet/wallet_items_unittest.cc @@ -13,6 +13,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" +using base::ASCIIToUTF16; + namespace { const char kMaskedInstrument[] = diff --git a/components/autofill/content/browser/wallet/wallet_test_util.cc b/components/autofill/content/browser/wallet/wallet_test_util.cc index 939e217..5bec623 100644 --- a/components/autofill/content/browser/wallet/wallet_test_util.cc +++ b/components/autofill/content/browser/wallet/wallet_test_util.cc @@ -17,6 +17,8 @@ #include "components/autofill/content/browser/wallet/required_action.h" #include "components/autofill/content/browser/wallet/wallet_address.h" +using base::ASCIIToUTF16; + namespace autofill { namespace wallet { diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc index df682a2..42b340e 100644 --- a/components/autofill/content/renderer/form_autofill_util.cc +++ b/components/autofill/content/renderer/form_autofill_util.cc @@ -125,7 +125,7 @@ const base::string16 CombineAndCollapseWhitespace( if (prefix_trailing_whitespace || suffix_leading_whitespace || force_whitespace) { - return prefix_trimmed + ASCIIToUTF16(" ") + suffix_trimmed; + return prefix_trimmed + base::ASCIIToUTF16(" ") + suffix_trimmed; } else { return prefix_trimmed + suffix_trimmed; } @@ -753,9 +753,9 @@ void WebFormControlElementToFormField(const WebFormControlElement& element, // labels for all form control elements are scraped from the DOM and set in // WebFormElementToFormData. field->name = element.nameForAutofill(); - field->form_control_type = UTF16ToUTF8(element.formControlType()); + field->form_control_type = base::UTF16ToUTF8(element.formControlType()); field->autocomplete_attribute = - UTF16ToUTF8(element.getAttribute(kAutocomplete)); + base::UTF16ToUTF8(element.getAttribute(kAutocomplete)); if (field->autocomplete_attribute.size() > kMaxDataLength) { // Discard overly long attribute values to avoid DOS-ing the browser // process. However, send over a default string to indicate that the @@ -929,7 +929,7 @@ bool WebFormElementToFormData( // Concatenate labels because some sites might have multiple label // candidates. if (!iter->second->label.empty() && !label_text.empty()) - iter->second->label += ASCIIToUTF16(" "); + iter->second->label += base::ASCIIToUTF16(" "); iter->second->label += label_text; } } diff --git a/components/autofill/content/renderer/form_cache.cc b/components/autofill/content/renderer/form_cache.cc index 516303c..431979e 100644 --- a/components/autofill/content/renderer/form_cache.cc +++ b/components/autofill/content/renderer/form_cache.cc @@ -290,13 +290,15 @@ bool FormCache::ShowPredictions(const FormDataPredictions& form) { std::string placeholder = form.fields[i].overall_type; base::string16 title = l10n_util::GetStringFUTF16( IDS_AUTOFILL_SHOW_PREDICTIONS_TITLE, - UTF8ToUTF16(form.fields[i].heuristic_type), - UTF8ToUTF16(form.fields[i].server_type), - UTF8ToUTF16(form.fields[i].signature), - UTF8ToUTF16(form.signature), - UTF8ToUTF16(form.experiment_id)); - if (!element->hasAttribute("placeholder")) - element->setAttribute("placeholder", WebString(UTF8ToUTF16(placeholder))); + base::UTF8ToUTF16(form.fields[i].heuristic_type), + base::UTF8ToUTF16(form.fields[i].server_type), + base::UTF8ToUTF16(form.fields[i].signature), + base::UTF8ToUTF16(form.signature), + base::UTF8ToUTF16(form.experiment_id)); + if (!element->hasAttribute("placeholder")) { + element->setAttribute("placeholder", + WebString(base::UTF8ToUTF16(placeholder))); + } element->setAttribute("title", WebString(title)); } diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index 0a5c23e..2e747a3 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc @@ -569,7 +569,7 @@ void PasswordAutofillAgent::GetSuggestions( std::vector<base::string16>* realms) { if (StartsWith(fill_data.basic_data.fields[0].value, input, false)) { suggestions->push_back(fill_data.basic_data.fields[0].value); - realms->push_back(UTF8ToUTF16(fill_data.preferred_realm)); + realms->push_back(base::UTF8ToUTF16(fill_data.preferred_realm)); } for (PasswordFormFillData::LoginCollection::const_iterator iter = @@ -577,7 +577,7 @@ void PasswordAutofillAgent::GetSuggestions( iter != fill_data.additional_logins.end(); ++iter) { if (StartsWith(iter->first, input, false)) { suggestions->push_back(iter->first); - realms->push_back(UTF8ToUTF16(iter->second.realm)); + realms->push_back(base::UTF8ToUTF16(iter->second.realm)); } } @@ -588,7 +588,7 @@ void PasswordAutofillAgent::GetSuggestions( if (StartsWith(iter->second[i], input, false)) { usernames_usage_ = OTHER_POSSIBLE_USERNAME_SHOWN; suggestions->push_back(iter->second[i]); - realms->push_back(UTF8ToUTF16(iter->first.realm)); + realms->push_back(base::UTF8ToUTF16(iter->first.realm)); } } } diff --git a/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc b/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc index 34955d1..ad5695b 100644 --- a/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc +++ b/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc @@ -55,10 +55,10 @@ TEST_F(PasswordFormConversionUtilsTest, ValidWebFormElementToPasswordForm) { EXPECT_EQ("data:", password_form->signon_realm); EXPECT_EQ(GURL("http://cnn.com"), password_form->action); - EXPECT_EQ(UTF8ToUTF16("username"), password_form->username_element); - EXPECT_EQ(UTF8ToUTF16("johnsmith"), password_form->username_value); - EXPECT_EQ(UTF8ToUTF16("password"), password_form->password_element); - EXPECT_EQ(UTF8ToUTF16("secret"), password_form->password_value); + EXPECT_EQ(base::UTF8ToUTF16("username"), password_form->username_element); + EXPECT_EQ(base::UTF8ToUTF16("johnsmith"), password_form->username_value); + EXPECT_EQ(base::UTF8ToUTF16("password"), password_form->password_element); + EXPECT_EQ(base::UTF8ToUTF16("secret"), password_form->password_value); EXPECT_EQ(PasswordForm::SCHEME_HTML, password_form->scheme); EXPECT_FALSE(password_form->ssl_valid); EXPECT_FALSE(password_form->preferred); diff --git a/components/autofill/core/browser/address.cc b/components/autofill/core/browser/address.cc index 2ba71ac..242fa24 100644 --- a/components/autofill/core/browser/address.cc +++ b/components/autofill/core/browser/address.cc @@ -65,7 +65,7 @@ base::string16 Address::GetRawInfo(ServerFieldType type) const { return sorting_code_; case ADDRESS_HOME_COUNTRY: - return ASCIIToUTF16(country_code_); + return base::ASCIIToUTF16(country_code_); case ADDRESS_HOME_STREET_ADDRESS: return JoinString(street_address_, '\n'); @@ -131,7 +131,7 @@ void Address::SetRawInfo(ServerFieldType type, const base::string16& value) { base::string16 Address::GetInfo(const AutofillType& type, const std::string& app_locale) const { if (type.html_type() == HTML_TYPE_COUNTRY_CODE) - return ASCIIToUTF16(country_code_); + return base::ASCIIToUTF16(country_code_); ServerFieldType storable_type = type.GetStorableType(); if (storable_type == ADDRESS_HOME_COUNTRY && !country_code_.empty()) diff --git a/components/autofill/core/browser/address_field.cc b/components/autofill/core/browser/address_field.cc index 46b1f5e..2e272b9 100644 --- a/components/autofill/core/browser/address_field.cc +++ b/components/autofill/core/browser/address_field.cc @@ -17,6 +17,8 @@ #include "components/autofill/core/browser/field_types.h" #include "ui/base/l10n/l10n_util.h" +using base::UTF8ToUTF16; + namespace autofill { FormField* AddressField::Parse(AutofillScanner* scanner) { diff --git a/components/autofill/core/browser/address_field_unittest.cc b/components/autofill/core/browser/address_field_unittest.cc index 4755293..79f9065 100644 --- a/components/autofill/core/browser/address_field_unittest.cc +++ b/components/autofill/core/browser/address_field_unittest.cc @@ -12,6 +12,8 @@ #include "components/autofill/core/common/form_field_data.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { class AddressFieldTest : public testing::Test { diff --git a/components/autofill/core/browser/address_unittest.cc b/components/autofill/core/browser/address_unittest.cc index 51795c7..a9a25cf 100644 --- a/components/autofill/core/browser/address_unittest.cc +++ b/components/autofill/core/browser/address_unittest.cc @@ -10,6 +10,8 @@ #include "components/autofill/core/browser/autofill_type.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { // Test that country data can be properly returned as either a country code or a diff --git a/components/autofill/core/browser/android/auxiliary_profile_unittest_android.cc b/components/autofill/core/browser/android/auxiliary_profile_unittest_android.cc index b8f8dce..daee564 100644 --- a/components/autofill/core/browser/android/auxiliary_profile_unittest_android.cc +++ b/components/autofill/core/browser/android/auxiliary_profile_unittest_android.cc @@ -11,6 +11,8 @@ #include "components/autofill/core/browser/autofill_profile.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { class AuxiliaryProfileAndroidTest : public testing::Test { diff --git a/components/autofill/core/browser/android/auxiliary_profiles_android.cc b/components/autofill/core/browser/android/auxiliary_profiles_android.cc index 6d0b65b..e215d98 100644 --- a/components/autofill/core/browser/android/auxiliary_profiles_android.cc +++ b/components/autofill/core/browser/android/auxiliary_profiles_android.cc @@ -45,7 +45,7 @@ base::string16 CollapseAddress(const base::string16& post_office_box, if (!neighborhood.empty()) accumulator.push_back(neighborhood); - return JoinString(accumulator, ASCIIToUTF16(", ")); + return JoinString(accumulator, base::ASCIIToUTF16(", ")); } } // namespace diff --git a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc index 2e7ce5f..7ec5494 100644 --- a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc +++ b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc @@ -29,6 +29,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/rect.h" +using base::ASCIIToUTF16; using testing::_; namespace autofill { diff --git a/components/autofill/core/browser/autofill_country.cc b/components/autofill/core/browser/autofill_country.cc index 45c89c7..d31ac6c 100644 --- a/components/autofill/core/browser/autofill_country.cc +++ b/components/autofill/core/browser/autofill_country.cc @@ -928,7 +928,7 @@ CountryNames::~CountryNames() { const std::string CountryNames::GetCountryCode(const base::string16& country, const std::string& locale) { // First, check common country names, including 2- and 3-letter country codes. - std::string country_utf8 = UTF16ToUTF8(StringToUpperASCII(country)); + std::string country_utf8 = base::UTF16ToUTF8(StringToUpperASCII(country)); std::map<std::string, std::string>::const_iterator result = common_names_.find(country_utf8); if (result != common_names_.end()) diff --git a/components/autofill/core/browser/autofill_country_unittest.cc b/components/autofill/core/browser/autofill_country_unittest.cc index dc43a52..09959c0 100644 --- a/components/autofill/core/browser/autofill_country_unittest.cc +++ b/components/autofill/core/browser/autofill_country_unittest.cc @@ -9,6 +9,8 @@ #include "components/autofill/core/browser/autofill_country.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { // Test the constructor and accessors diff --git a/components/autofill/core/browser/autofill_download_unittest.cc b/components/autofill/core/browser/autofill_download_unittest.cc index d99c8ca..c68f67b 100644 --- a/components/autofill/core/browser/autofill_download_unittest.cc +++ b/components/autofill/core/browser/autofill_download_unittest.cc @@ -23,6 +23,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/web/WebInputElement.h" +using base::ASCIIToUTF16; using blink::WebInputElement; namespace autofill { diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc index 3b8acbe..ad86d83 100644 --- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc +++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc @@ -21,8 +21,9 @@ #include "third_party/WebKit/public/web/WebAutofillClient.h" #include "ui/gfx/rect.h" -using testing::_; +using base::ASCIIToUTF16; using blink::WebAutofillClient; +using testing::_; namespace autofill { diff --git a/components/autofill/core/browser/autofill_field.cc b/components/autofill/core/browser/autofill_field.cc index 4323e8f..1a1ba6a 100644 --- a/components/autofill/core/browser/autofill_field.cc +++ b/components/autofill/core/browser/autofill_field.cc @@ -17,6 +17,7 @@ #include "grit/component_strings.h" #include "ui/base/l10n/l10n_util.h" +using base::ASCIIToUTF16; using base::StringToInt; namespace autofill { @@ -378,7 +379,7 @@ bool AutofillField::IsEmpty() const { } std::string AutofillField::FieldSignature() const { - std::string field_name = UTF16ToUTF8(name); + std::string field_name = base::UTF16ToUTF8(name); std::string field_string = field_name + "&" + form_control_type; return Hash32Bit(field_string); } diff --git a/components/autofill/core/browser/autofill_field_unittest.cc b/components/autofill/core/browser/autofill_field_unittest.cc index 7b7ede5..a09e7d3 100644 --- a/components/autofill/core/browser/autofill_field_unittest.cc +++ b/components/autofill/core/browser/autofill_field_unittest.cc @@ -11,6 +11,8 @@ #include "components/autofill/core/browser/field_types.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { namespace { diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index a33eeff..c0cafff 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc @@ -52,9 +52,11 @@ #include "ui/gfx/rect.h" #include "url/gurl.h" +using base::ASCIIToUTF16; +using base::UTF8ToUTF16; using content::WebContents; -using testing::_; using blink::WebFormElement; +using testing::_; namespace autofill { @@ -441,7 +443,7 @@ class TestAutofillManager : public AutofillManager { SCOPED_TRACE( base::StringPrintf( "Field %d with value %s", static_cast<int>(i), - UTF16ToUTF8(submitted_form->field(i)->value).c_str())); + base::UTF16ToUTF8(submitted_form->field(i)->value).c_str())); const ServerFieldTypeSet& possible_types = submitted_form->field(i)->possible_types(); EXPECT_EQ(expected_submitted_field_types_[i].size(), diff --git a/components/autofill/core/browser/autofill_merge_unittest.cc b/components/autofill/core/browser/autofill_merge_unittest.cc index 99ab99a..7672a05 100644 --- a/components/autofill/core/browser/autofill_merge_unittest.cc +++ b/components/autofill/core/browser/autofill_merge_unittest.cc @@ -70,7 +70,7 @@ std::string SerializeProfiles(const std::vector<AutofillProfile*>& profiles) { for (size_t k = 0; k < values.size(); ++k) { result += AutofillType(type).ToString(); result += kFieldSeparator; - result += UTF16ToUTF8(values[k]); + result += base::UTF16ToUTF8(values[k]); result += "\n"; } } @@ -185,8 +185,8 @@ void AutofillMergeTest::MergeProfiles(const std::string& profiles, // Create a test form. FormData form; - form.name = ASCIIToUTF16("MyTestForm"); - form.method = ASCIIToUTF16("POST"); + form.name = base::ASCIIToUTF16("MyTestForm"); + form.method = base::ASCIIToUTF16("POST"); form.origin = GURL("https://www.example.com/origin.html"); form.action = GURL("https://www.example.com/action.html"); form.user_submitted = true; @@ -201,9 +201,10 @@ void AutofillMergeTest::MergeProfiles(const std::string& profiles, // Add a field to the current profile. size_t separator_pos = line.find(kFieldSeparator); ASSERT_NE(std::string::npos, separator_pos); - base::string16 field_type = UTF8ToUTF16(line.substr(0, separator_pos)); + base::string16 field_type = + base::UTF8ToUTF16(line.substr(0, separator_pos)); base::string16 value = - UTF8ToUTF16(line.substr(separator_pos + kFieldOffset)); + base::UTF8ToUTF16(line.substr(separator_pos + kFieldOffset)); FormFieldData field; field.label = field_type; @@ -223,7 +224,8 @@ void AutofillMergeTest::MergeProfiles(const std::string& profiles, // into the field's name. AutofillField* field = const_cast<AutofillField*>(form_structure.field(i)); - ServerFieldType type = StringToFieldType(UTF16ToUTF8(field->name)); + ServerFieldType type = + StringToFieldType(base::UTF16ToUTF8(field->name)); field->set_heuristic_type(type); } diff --git a/components/autofill/core/browser/autofill_metrics_unittest.cc b/components/autofill/core/browser/autofill_metrics_unittest.cc index 0febf13..33d5e66 100644 --- a/components/autofill/core/browser/autofill_metrics_unittest.cc +++ b/components/autofill/core/browser/autofill_metrics_unittest.cc @@ -33,6 +33,7 @@ #include "ui/gfx/rect.h" #include "url/gurl.h" +using base::ASCIIToUTF16; using base::TimeDelta; using base::TimeTicks; using testing::_; diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc index 520eff9..a772832 100644 --- a/components/autofill/core/browser/autofill_profile.cc +++ b/components/autofill/core/browser/autofill_profile.cc @@ -27,6 +27,9 @@ #include "grit/component_strings.h" #include "ui/base/l10n/l10n_util.h" +using base::ASCIIToUTF16; +using base::UTF16ToUTF8; + namespace autofill { namespace { diff --git a/components/autofill/core/browser/autofill_profile_unittest.cc b/components/autofill/core/browser/autofill_profile_unittest.cc index 194dc3a..1da7d58 100644 --- a/components/autofill/core/browser/autofill_profile_unittest.cc +++ b/components/autofill/core/browser/autofill_profile_unittest.cc @@ -16,6 +16,8 @@ #include "grit/component_strings.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { namespace { diff --git a/components/autofill/core/browser/autofill_regexes_unittest.cc b/components/autofill/core/browser/autofill_regexes_unittest.cc index 4539415..fc95c44 100644 --- a/components/autofill/core/browser/autofill_regexes_unittest.cc +++ b/components/autofill/core/browser/autofill_regexes_unittest.cc @@ -9,6 +9,8 @@ #include "components/autofill/core/browser/autofill_regex_constants.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { TEST(AutofillRegexesTest, AutofillRegexes) { diff --git a/components/autofill/core/browser/autofill_test_utils.cc b/components/autofill/core/browser/autofill_test_utils.cc index 6577c30..0addc87 100644 --- a/components/autofill/core/browser/autofill_test_utils.cc +++ b/components/autofill/core/browser/autofill_test_utils.cc @@ -21,6 +21,8 @@ #include "components/webdata/encryptor/encryptor.h" #include "content/public/browser/browser_context.h" +using base::ASCIIToUTF16; + namespace autofill { namespace test { @@ -85,7 +87,7 @@ void CreateTestAddressFormData(FormData* form) { inline void check_and_set( FormGroup* profile, ServerFieldType type, const char* value) { if (value) - profile->SetRawInfo(type, UTF8ToUTF16(value)); + profile->SetRawInfo(type, base::UTF8ToUTF16(value)); } AutofillProfile GetFullProfile() { diff --git a/components/autofill/core/browser/contact_info.cc b/components/autofill/core/browser/contact_info.cc index 9bd91c3..0793bb5 100644 --- a/components/autofill/core/browser/contact_info.cc +++ b/components/autofill/core/browser/contact_info.cc @@ -121,7 +121,7 @@ void NameInfo::SetFullName(const base::string16& full) { last_ = base::string16(); std::vector<base::string16> full_name_tokens; - Tokenize(full, ASCIIToUTF16(" "), &full_name_tokens); + Tokenize(full, base::ASCIIToUTF16(" "), &full_name_tokens); // There are four possibilities: empty; first name; first and last names; // first, middle (possibly multiple strings) and then the last name. diff --git a/components/autofill/core/browser/contact_info_unittest.cc b/components/autofill/core/browser/contact_info_unittest.cc index 87e96ad..4c2be9d 100644 --- a/components/autofill/core/browser/contact_info_unittest.cc +++ b/components/autofill/core/browser/contact_info_unittest.cc @@ -11,6 +11,8 @@ #include "components/autofill/core/browser/field_types.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { TEST(NameInfoTest, SetFullName) { diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc index 2d62c5e..6964aa4 100644 --- a/components/autofill/core/browser/credit_card.cc +++ b/components/autofill/core/browser/credit_card.cc @@ -307,7 +307,7 @@ base::string16 CreditCard::GetRawInfo(ServerFieldType type) const { base::string16 month = ExpirationMonthAsString(); base::string16 year = Expiration2DigitYearAsString(); if (!month.empty() && !year.empty()) - return month + ASCIIToUTF16("/") + year; + return month + base::ASCIIToUTF16("/") + year; return base::string16(); } @@ -315,7 +315,7 @@ base::string16 CreditCard::GetRawInfo(ServerFieldType type) const { base::string16 month = ExpirationMonthAsString(); base::string16 year = Expiration4DigitYearAsString(); if (!month.empty() && !year.empty()) - return month + ASCIIToUTF16("/") + year; + return month + base::ASCIIToUTF16("/") + year; return base::string16(); } @@ -435,7 +435,7 @@ const base::string16 CreditCard::Label() const { // TODO(georgey): Internationalize date. base::string16 formatted_date(ExpirationMonthAsString()); - formatted_date.append(ASCIIToUTF16("/")); + formatted_date.append(base::ASCIIToUTF16("/")); formatted_date.append(Expiration4DigitYearAsString()); label = l10n_util::GetStringFUTF16(IDS_CREDIT_CARD_NUMBER_PREVIEW_FORMAT, @@ -446,8 +446,10 @@ const base::string16 CreditCard::Label() const { void CreditCard::SetInfoForMonthInputType(const base::string16& value) { // Check if |text| is "yyyy-mm" format first, and check normal month format. - if (!autofill::MatchesPattern(value, UTF8ToUTF16("^[0-9]{4}-[0-9]{1,2}$"))) + if (!autofill::MatchesPattern(value, + base::UTF8ToUTF16("^[0-9]{4}-[0-9]{1,2}$"))) { return; + } std::vector<base::string16> year_month; base::SplitString(value, L'-', &year_month); @@ -499,7 +501,7 @@ base::string16 CreditCard::TypeAndLastFourDigits() const { return type; // TODO(estade): i18n. - return type + ASCIIToUTF16(" - ") + digits; + return type + base::ASCIIToUTF16(" - ") + digits; } void CreditCard::operator=(const CreditCard& credit_card) { @@ -612,7 +614,7 @@ base::string16 CreditCard::ExpirationMonthAsString() const { if (expiration_month_ >= 10) return month; - base::string16 zero = ASCIIToUTF16("0"); + base::string16 zero = base::ASCIIToUTF16("0"); zero.append(month); return zero; } @@ -672,21 +674,22 @@ void CreditCard::SetExpirationYear(int expiration_year) { // So we can compare CreditCards with EXPECT_EQ(). std::ostream& operator<<(std::ostream& os, const CreditCard& credit_card) { return os - << UTF16ToUTF8(credit_card.Label()) + << base::UTF16ToUTF8(credit_card.Label()) << " " << credit_card.guid() << " " << credit_card.origin() << " " - << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_NAME)) + << base::UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_NAME)) << " " - << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_TYPE)) + << base::UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_TYPE)) << " " - << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_NUMBER)) + << base::UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_NUMBER)) << " " - << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_EXP_MONTH)) + << base::UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_EXP_MONTH)) << " " - << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR)); + << base::UTF16ToUTF8( + credit_card.GetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR)); } // These values must match the values in WebKitPlatformSupportImpl in diff --git a/components/autofill/core/browser/credit_card_field.cc b/components/autofill/core/browser/credit_card_field.cc index f9012ca..09dab1e 100644 --- a/components/autofill/core/browser/credit_card_field.cc +++ b/components/autofill/core/browser/credit_card_field.cc @@ -32,7 +32,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { // bottom of the loop. for (int fields = 0; !scanner->IsEnd(); ++fields) { // Ignore gift card fields. - if (ParseField(scanner, UTF8ToUTF16(autofill::kGiftCardRe), NULL)) + if (ParseField(scanner, base::UTF8ToUTF16(autofill::kGiftCardRe), NULL)) break; // Sometimes the cardholder field is just labeled "name". Unfortunately this @@ -45,9 +45,9 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { base::string16 name_pattern; if (fields == 0 || credit_card_field->expiration_month_) { // at beginning or end - name_pattern = UTF8ToUTF16(autofill::kNameOnCardRe); + name_pattern = base::UTF8ToUTF16(autofill::kNameOnCardRe); } else { - name_pattern = UTF8ToUTF16(autofill::kNameOnCardContextualRe); + name_pattern = base::UTF8ToUTF16(autofill::kNameOnCardContextualRe); } if (ParseField(scanner, name_pattern, &credit_card_field->cardholder_)) @@ -59,8 +59,8 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { // and "clnm". scanner->SaveCursor(); const AutofillField* first; - if (ParseField(scanner, ASCIIToUTF16("^cfnm"), &first) && - ParseField(scanner, ASCIIToUTF16("^clnm"), + if (ParseField(scanner, base::ASCIIToUTF16("^cfnm"), &first) && + ParseField(scanner, base::ASCIIToUTF16("^clnm"), &credit_card_field->cardholder_last_)) { credit_card_field->cardholder_ = first; continue; @@ -69,7 +69,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { } // Check for a credit card type (Visa, MasterCard, etc.) field. - base::string16 type_pattern = UTF8ToUTF16(autofill::kCardTypeRe); + base::string16 type_pattern = base::UTF8ToUTF16(autofill::kCardTypeRe); if (!credit_card_field->type_ && ParseFieldSpecifics(scanner, type_pattern, MATCH_DEFAULT | MATCH_SELECT, @@ -82,13 +82,13 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { // has a plethora of names; we've seen "verification #", // "verification number", "card identification number" and others listed // in the |pattern| below. - base::string16 pattern = UTF8ToUTF16(autofill::kCardCvcRe); + base::string16 pattern = base::UTF8ToUTF16(autofill::kCardCvcRe); if (!credit_card_field->verification_ && ParseField(scanner, pattern, &credit_card_field->verification_)) { continue; } - pattern = UTF8ToUTF16(autofill::kCardNumberRe); + pattern = base::UTF8ToUTF16(autofill::kCardNumberRe); if (!credit_card_field->number_ && ParseField(scanner, pattern, &credit_card_field->number_)) { continue; @@ -100,11 +100,11 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { } else { // First try to parse split month/year expiration fields. scanner->SaveCursor(); - pattern = UTF8ToUTF16(autofill::kExpirationMonthRe); + pattern = base::UTF8ToUTF16(autofill::kExpirationMonthRe); if (!credit_card_field->expiration_month_ && ParseFieldSpecifics(scanner, pattern, MATCH_DEFAULT | MATCH_SELECT, &credit_card_field->expiration_month_)) { - pattern = UTF8ToUTF16(autofill::kExpirationYearRe); + pattern = base::UTF8ToUTF16(autofill::kExpirationYearRe); if (ParseFieldSpecifics(scanner, pattern, MATCH_DEFAULT | MATCH_SELECT, &credit_card_field->expiration_year_)) { continue; @@ -115,7 +115,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { if (!credit_card_field->expiration_date_) { // Look for a 2-digit year first. scanner->Rewind(); - pattern = UTF8ToUTF16(autofill::kExpirationDate2DigitYearRe); + pattern = base::UTF8ToUTF16(autofill::kExpirationDate2DigitYearRe); // We allow <select> fields, because they're used e.g. on qvc.com. if (ParseFieldSpecifics(scanner, pattern, MATCH_LABEL | MATCH_VALUE | MATCH_TEXT | @@ -125,7 +125,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { continue; } - pattern = UTF8ToUTF16(autofill::kExpirationDateRe); + pattern = base::UTF8ToUTF16(autofill::kExpirationDateRe); if (ParseFieldSpecifics(scanner, pattern, MATCH_LABEL | MATCH_VALUE | MATCH_TEXT | MATCH_SELECT, @@ -148,7 +148,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { // We also ignore any other fields within a credit card block that // start with "card", under the assumption that they are related to // the credit card section being processed but are uninteresting to us. - if (ParseField(scanner, UTF8ToUTF16(autofill::kCardIgnoredRe), NULL)) + if (ParseField(scanner, base::UTF8ToUTF16(autofill::kCardIgnoredRe), NULL)) continue; break; diff --git a/components/autofill/core/browser/credit_card_field_unittest.cc b/components/autofill/core/browser/credit_card_field_unittest.cc index 073e5d7..037a302 100644 --- a/components/autofill/core/browser/credit_card_field_unittest.cc +++ b/components/autofill/core/browser/credit_card_field_unittest.cc @@ -11,6 +11,8 @@ #include "components/autofill/core/common/form_field_data.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { class CreditCardFieldTest : public testing::Test { diff --git a/components/autofill/core/browser/credit_card_unittest.cc b/components/autofill/core/browser/credit_card_unittest.cc index 1e8e27e..20ee242 100644 --- a/components/autofill/core/browser/credit_card_unittest.cc +++ b/components/autofill/core/browser/credit_card_unittest.cc @@ -13,6 +13,8 @@ #include "grit/webkit_resources.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { namespace { diff --git a/components/autofill/core/browser/email_field.cc b/components/autofill/core/browser/email_field.cc index 053ecec..33a10e9 100644 --- a/components/autofill/core/browser/email_field.cc +++ b/components/autofill/core/browser/email_field.cc @@ -14,7 +14,7 @@ namespace autofill { // static FormField* EmailField::Parse(AutofillScanner* scanner) { const AutofillField* field; - if (ParseFieldSpecifics(scanner, UTF8ToUTF16(autofill::kEmailRe), + if (ParseFieldSpecifics(scanner, base::UTF8ToUTF16(autofill::kEmailRe), MATCH_DEFAULT | MATCH_EMAIL, &field)) { return new EmailField(field); } diff --git a/components/autofill/core/browser/form_field.cc b/components/autofill/core/browser/form_field.cc index a817ff6..9f21376 100644 --- a/components/autofill/core/browser/form_field.cc +++ b/components/autofill/core/browser/form_field.cc @@ -91,7 +91,7 @@ bool FormField::ParseFieldSpecifics(AutofillScanner* scanner, bool FormField::ParseEmptyLabel(AutofillScanner* scanner, const AutofillField** match) { return ParseFieldSpecifics(scanner, - ASCIIToUTF16("^$"), + base::ASCIIToUTF16("^$"), MATCH_LABEL | MATCH_ALL_INPUTS, match); } diff --git a/components/autofill/core/browser/form_field_unittest.cc b/components/autofill/core/browser/form_field_unittest.cc index 5014b71..2fb1a72 100644 --- a/components/autofill/core/browser/form_field_unittest.cc +++ b/components/autofill/core/browser/form_field_unittest.cc @@ -9,6 +9,8 @@ #include "components/autofill/core/browser/form_field.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { TEST(FormFieldTest, Match) { diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc index 007bc50..a953798 100644 --- a/components/autofill/core/browser/form_structure.cc +++ b/components/autofill/core/browser/form_structure.cc @@ -146,7 +146,7 @@ void EncodeFieldForFieldAssignments(const AutofillField& field, field_element->SetAttr(buzz::QName(kAttributeFieldType), base::IntToString(*field_type)); field_element->SetAttr(buzz::QName(kAttributeName), - UTF16ToUTF8(field.name)); + base::UTF16ToUTF8(field.name)); parent->AddElement(field_element); } } @@ -308,12 +308,12 @@ std::string StripDigitsIfRequired(const base::string16& input) { std::string return_string; status = U_ZERO_ERROR; - UTF16ToUTF8(replaced_string.getBuffer(), - static_cast<size_t>(replaced_string.length()), - &return_string); + base::UTF16ToUTF8(replaced_string.getBuffer(), + static_cast<size_t>(replaced_string.length()), + &return_string); if (status != U_ZERO_ERROR) { - DVLOG(1) << "Couldn't strip digits in " << UTF16ToUTF8(input); - return UTF16ToUTF8(input); + DVLOG(1) << "Couldn't strip digits in " << base::UTF16ToUTF8(input); + return base::UTF16ToUTF8(input); } return return_string; @@ -351,12 +351,12 @@ FormStructure::FormStructure(const FormData& form) unique_names[field->name] = 1; else ++unique_names[field->name]; - base::string16 unique_name = field->name + ASCIIToUTF16("_") + + base::string16 unique_name = field->name + base::ASCIIToUTF16("_") + base::IntToString16(unique_names[field->name]); fields_.push_back(new AutofillField(*field, unique_name)); } - std::string method = UTF16ToUTF8(form.method); + std::string method = base::UTF16ToUTF8(form.method); if (StringToLowerASCII(method) == kFormMethodPost) { method_ = POST; } else { @@ -614,7 +614,7 @@ void FormStructure::GetFieldTypePredictions( FormDataPredictions form; form.data.name = form_structure->form_name_; form.data.method = - ASCIIToUTF16((form_structure->method_ == POST) ? "POST" : "GET"); + base::ASCIIToUTF16((form_structure->method_ == POST) ? "POST" : "GET"); form.data.origin = form_structure->source_url_; form.data.action = form_structure->target_url_; form.signature = form_structure->FormSignature(); @@ -651,7 +651,7 @@ std::string FormStructure::FormSignature() const { } std::string form_string = scheme + "://" + host + "&" + - UTF16ToUTF8(form_name_) + + base::UTF16ToUTF8(form_name_) + form_signature_field_names_; return Hash64Bit(form_string); @@ -962,7 +962,7 @@ FormData FormStructure::ToFormData() const { data.name = form_name_; data.origin = source_url_; data.action = target_url_; - data.method = ASCIIToUTF16(method_ == POST ? "POST" : "GET"); + data.method = base::ASCIIToUTF16(method_ == POST ? "POST" : "GET"); for (size_t i = 0; i < fields_.size(); ++i) { data.fields.push_back(FormFieldData(*fields_[i])); @@ -1195,7 +1195,7 @@ void FormStructure::IdentifySections(bool has_author_specified_sections) { } seen_types.insert(current_type); - (*field)->set_section(UTF16ToUTF8(current_section)); + (*field)->set_section(base::UTF16ToUTF8(current_section)); } } diff --git a/components/autofill/core/browser/form_structure_unittest.cc b/components/autofill/core/browser/form_structure_unittest.cc index db1d431..2992156 100644 --- a/components/autofill/core/browser/form_structure_unittest.cc +++ b/components/autofill/core/browser/form_structure_unittest.cc @@ -14,6 +14,7 @@ #include "third_party/WebKit/public/web/WebInputElement.h" #include "url/gurl.h" +using base::ASCIIToUTF16; using blink::WebInputElement; namespace autofill { @@ -34,9 +35,9 @@ class TestAutofillMetrics : public AutofillMetrics { namespace content { std::ostream& operator<<(std::ostream& os, const FormData& form) { - os << UTF16ToUTF8(form.name) + os << base::UTF16ToUTF8(form.name) << " " - << UTF16ToUTF8(form.method) + << base::UTF16ToUTF8(form.method) << " " << form.origin.spec() << " " diff --git a/components/autofill/core/browser/name_field.cc b/components/autofill/core/browser/name_field.cc index de74ba1..87b77dd 100644 --- a/components/autofill/core/browser/name_field.cc +++ b/components/autofill/core/browser/name_field.cc @@ -13,6 +13,8 @@ #include "components/autofill/core/browser/autofill_type.h" #include "ui/base/l10n/l10n_util.h" +using base::UTF8ToUTF16; + namespace autofill { namespace { diff --git a/components/autofill/core/browser/name_field_unittest.cc b/components/autofill/core/browser/name_field_unittest.cc index df6a29b..972e7ae 100644 --- a/components/autofill/core/browser/name_field_unittest.cc +++ b/components/autofill/core/browser/name_field_unittest.cc @@ -11,6 +11,8 @@ #include "components/autofill/core/common/form_field_data.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { class NameFieldTest : public testing::Test { diff --git a/components/autofill/core/browser/password_autofill_manager_unittest.cc b/components/autofill/core/browser/password_autofill_manager_unittest.cc index 5a4767a..73241a5 100644 --- a/components/autofill/core/browser/password_autofill_manager_unittest.cc +++ b/components/autofill/core/browser/password_autofill_manager_unittest.cc @@ -38,15 +38,15 @@ class PasswordAutofillManagerTest : public testing::Test { virtual void SetUp() OVERRIDE { // Add a preferred login and an additional login to the FillData. - base::string16 username1 = ASCIIToUTF16(kAliceUsername); - base::string16 password1 = ASCIIToUTF16(kAlicePassword); + base::string16 username1 = base::ASCIIToUTF16(kAliceUsername); + base::string16 password1 = base::ASCIIToUTF16(kAlicePassword); - username_field_.name = ASCIIToUTF16(kUsernameName); + username_field_.name = base::ASCIIToUTF16(kUsernameName); username_field_.value = username1; fill_data_.basic_data.fields.push_back(username_field_); FormFieldData password_field; - password_field.name = ASCIIToUTF16(kPasswordName); + password_field.name = base::ASCIIToUTF16(kPasswordName); password_field.value = password1; fill_data_.basic_data.fields.push_back(password_field); @@ -78,25 +78,25 @@ class PasswordAutofillManagerTest : public testing::Test { TEST_F(PasswordAutofillManagerTest, DidAcceptAutofillSuggestion) { EXPECT_CALL(*autofill_driver(), RendererShouldAcceptPasswordAutofillSuggestion( - ASCIIToUTF16(kAliceUsername))); + base::ASCIIToUTF16(kAliceUsername))); EXPECT_TRUE(password_autofill_manager()->DidAcceptAutofillSuggestion( - username_field(), ASCIIToUTF16(kAliceUsername))); + username_field(), base::ASCIIToUTF16(kAliceUsername))); EXPECT_CALL(*autofill_driver(), RendererShouldAcceptPasswordAutofillSuggestion( - ASCIIToUTF16(kInvalidUsername))).Times(0); + base::ASCIIToUTF16(kInvalidUsername))).Times(0); EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion( - username_field(), ASCIIToUTF16(kInvalidUsername))); + username_field(), base::ASCIIToUTF16(kInvalidUsername))); FormFieldData invalid_username_field; - invalid_username_field.name = ASCIIToUTF16(kInvalidUsername); + invalid_username_field.name = base::ASCIIToUTF16(kInvalidUsername); EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion( - invalid_username_field, ASCIIToUTF16(kAliceUsername))); + invalid_username_field, base::ASCIIToUTF16(kAliceUsername))); password_autofill_manager()->Reset(); EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion( - username_field(), ASCIIToUTF16(kAliceUsername))); + username_field(), base::ASCIIToUTF16(kAliceUsername))); } } // namespace autofill diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc index 48438a8..6ad59d1 100644 --- a/components/autofill/core/browser/personal_data_manager.cc +++ b/components/autofill/core/browser/personal_data_manager.cc @@ -672,7 +672,7 @@ void PersonalDataManager::GetCreditCardSuggestions( values->push_back(creditcard_field_value); labels->push_back(label); - icons->push_back(UTF8ToUTF16(credit_card->type())); + icons->push_back(base::UTF8ToUTF16(credit_card->type())); guid_pairs->push_back(GUIDPair(credit_card->guid(), 0)); } } diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc index 4223b60c..6264cc2 100644 --- a/components/autofill/core/browser/personal_data_manager_unittest.cc +++ b/components/autofill/core/browser/personal_data_manager_unittest.cc @@ -27,6 +27,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + using content::BrowserThread; namespace autofill { diff --git a/components/autofill/core/browser/phone_field.cc b/components/autofill/core/browser/phone_field.cc index 6d156e9..34f4c58 100644 --- a/components/autofill/core/browser/phone_field.cc +++ b/components/autofill/core/browser/phone_field.cc @@ -19,9 +19,9 @@ namespace { // This string includes all area code separators, including NoText. base::string16 GetAreaRegex() { - base::string16 area_code = UTF8ToUTF16(autofill::kAreaCodeRe); - area_code.append(ASCIIToUTF16("|")); // Regexp separator. - area_code.append(UTF8ToUTF16(autofill::kAreaCodeNotextRe)); + base::string16 area_code = base::UTF8ToUTF16(autofill::kAreaCodeRe); + area_code.append(base::ASCIIToUTF16("|")); // Regexp separator. + area_code.append(base::UTF8ToUTF16(autofill::kAreaCodeNotextRe)); return area_code; } @@ -182,15 +182,15 @@ FormField* PhoneField::Parse(AutofillScanner* scanner) { // Look for a third text box. if (!phone_field->parsed_phone_fields_[FIELD_SUFFIX]) { - if (!ParseField(scanner, UTF8ToUTF16(autofill::kPhoneSuffixRe), + if (!ParseField(scanner, base::UTF8ToUTF16(autofill::kPhoneSuffixRe), &phone_field->parsed_phone_fields_[FIELD_SUFFIX])) { - ParseField(scanner, UTF8ToUTF16(autofill::kPhoneSuffixSeparatorRe), + ParseField(scanner, base::UTF8ToUTF16(autofill::kPhoneSuffixSeparatorRe), &phone_field->parsed_phone_fields_[FIELD_SUFFIX]); } } // Now look for an extension. - ParseField(scanner, UTF8ToUTF16(autofill::kPhoneExtensionRe), + ParseField(scanner, base::UTF8ToUTF16(autofill::kPhoneExtensionRe), &phone_field->parsed_phone_fields_[FIELD_EXTENSION]); return phone_field.release(); @@ -249,23 +249,23 @@ PhoneField::PhoneField() { base::string16 PhoneField::GetRegExp(RegexType regex_id) { switch (regex_id) { case REGEX_COUNTRY: - return UTF8ToUTF16(autofill::kCountryCodeRe); + return base::UTF8ToUTF16(autofill::kCountryCodeRe); case REGEX_AREA: return GetAreaRegex(); case REGEX_AREA_NOTEXT: - return UTF8ToUTF16(autofill::kAreaCodeNotextRe); + return base::UTF8ToUTF16(autofill::kAreaCodeNotextRe); case REGEX_PHONE: - return UTF8ToUTF16(autofill::kPhoneRe); + return base::UTF8ToUTF16(autofill::kPhoneRe); case REGEX_PREFIX_SEPARATOR: - return UTF8ToUTF16(autofill::kPhonePrefixSeparatorRe); + return base::UTF8ToUTF16(autofill::kPhonePrefixSeparatorRe); case REGEX_PREFIX: - return UTF8ToUTF16(autofill::kPhonePrefixRe); + return base::UTF8ToUTF16(autofill::kPhonePrefixRe); case REGEX_SUFFIX_SEPARATOR: - return UTF8ToUTF16(autofill::kPhoneSuffixSeparatorRe); + return base::UTF8ToUTF16(autofill::kPhoneSuffixSeparatorRe); case REGEX_SUFFIX: - return UTF8ToUTF16(autofill::kPhoneSuffixRe); + return base::UTF8ToUTF16(autofill::kPhoneSuffixRe); case REGEX_EXTENSION: - return UTF8ToUTF16(autofill::kPhoneExtensionRe); + return base::UTF8ToUTF16(autofill::kPhoneExtensionRe); default: NOTREACHED(); break; diff --git a/components/autofill/core/browser/phone_field_unittest.cc b/components/autofill/core/browser/phone_field_unittest.cc index fa04f5d..30f1ea5 100644 --- a/components/autofill/core/browser/phone_field_unittest.cc +++ b/components/autofill/core/browser/phone_field_unittest.cc @@ -11,6 +11,8 @@ #include "components/autofill/core/common/form_field_data.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { class PhoneFieldTest : public testing::Test { diff --git a/components/autofill/core/browser/phone_number_i18n.cc b/components/autofill/core/browser/phone_number_i18n.cc index 718d42d..e200298 100644 --- a/components/autofill/core/browser/phone_number_i18n.cc +++ b/components/autofill/core/browser/phone_number_i18n.cc @@ -66,11 +66,11 @@ void FormatValidatedNumber(const PhoneNumber& number, phone_util->Format(number, format, &processed_number); if (formatted_number) - *formatted_number = UTF8ToUTF16(processed_number); + *formatted_number = base::UTF8ToUTF16(processed_number); if (normalized_number) { phone_util->NormalizeDigitsOnly(&processed_number); - *normalized_number = UTF8ToUTF16(processed_number); + *normalized_number = base::UTF8ToUTF16(processed_number); } } @@ -92,7 +92,7 @@ bool ParsePhoneNumber(const base::string16& value, number->clear(); *i18n_number = PhoneNumber(); - std::string number_text(UTF16ToUTF8(value)); + std::string number_text(base::UTF16ToUTF8(value)); // Parse phone number based on the region. PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance(); @@ -128,17 +128,17 @@ bool ParsePhoneNumber(const base::string16& value, } else { subscriber_number = national_significant_number; } - *number = UTF8ToUTF16(subscriber_number); - *city_code = UTF8ToUTF16(area_code); + *number = base::UTF8ToUTF16(subscriber_number); + *city_code = base::UTF8ToUTF16(area_code); *country_code = base::string16(); phone_util->NormalizeDigitsOnly(&number_text); - base::string16 normalized_number(UTF8ToUTF16(number_text)); + base::string16 normalized_number(base::UTF8ToUTF16(number_text)); // Check if parsed number has a country code that was not inferred from the // region. if (i18n_number->has_country_code()) { - *country_code = UTF8ToUTF16( + *country_code = base::UTF8ToUTF16( base::StringPrintf("%d", i18n_number->country_code())); if (normalized_number.length() <= national_significant_number.length() && !StartsWith(normalized_number, *country_code, @@ -200,14 +200,16 @@ bool PhoneNumbersMatch(const base::string16& number_a, // Parse phone numbers based on the region PhoneNumber i18n_number1; - if (phone_util->Parse(UTF16ToUTF8(number_a), region.c_str(), &i18n_number1) != - PhoneNumberUtil::NO_PARSING_ERROR) { + if (phone_util->Parse( + base::UTF16ToUTF8(number_a), region.c_str(), &i18n_number1) != + PhoneNumberUtil::NO_PARSING_ERROR) { return false; } PhoneNumber i18n_number2; - if (phone_util->Parse(UTF16ToUTF8(number_b), region.c_str(), &i18n_number2) != - PhoneNumberUtil::NO_PARSING_ERROR) { + if (phone_util->Parse( + base::UTF16ToUTF8(number_b), region.c_str(), &i18n_number2) != + PhoneNumberUtil::NO_PARSING_ERROR) { return false; } diff --git a/components/autofill/core/browser/phone_number_i18n_unittest.cc b/components/autofill/core/browser/phone_number_i18n_unittest.cc index b10345b..2e72f0e 100644 --- a/components/autofill/core/browser/phone_number_i18n_unittest.cc +++ b/components/autofill/core/browser/phone_number_i18n_unittest.cc @@ -10,6 +10,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/libphonenumber/src/phonenumber_api.h" +using base::ASCIIToUTF16; +using base::UTF8ToUTF16; using content::BrowserThread; namespace autofill { diff --git a/components/autofill/core/browser/phone_number_unittest.cc b/components/autofill/core/browser/phone_number_unittest.cc index fd654d0..29b1694 100644 --- a/components/autofill/core/browser/phone_number_unittest.cc +++ b/components/autofill/core/browser/phone_number_unittest.cc @@ -11,6 +11,8 @@ #include "components/autofill/core/browser/phone_number_i18n.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { TEST(PhoneNumberTest, Matcher) { diff --git a/components/autofill/core/browser/state_names.cc b/components/autofill/core/browser/state_names.cc index 0ad3525..d4975b4 100644 --- a/components/autofill/core/browser/state_names.cc +++ b/components/autofill/core/browser/state_names.cc @@ -81,7 +81,7 @@ base::string16 GetAbbreviationForName(const base::string16& name) { for (size_t i = 0; i < arraysize(kStateData); ++i) { const StateData& state = kStateData[i]; if (LowerCaseEqualsASCII(name, state.name)) - return ASCIIToUTF16(state.abbreviation); + return base::ASCIIToUTF16(state.abbreviation); } return base::string16(); } @@ -90,7 +90,7 @@ base::string16 GetNameForAbbreviation(const base::string16& abbreviation) { for (size_t i = 0; i < arraysize(kStateData); ++i) { const StateData& state = kStateData[i]; if (LowerCaseEqualsASCII(abbreviation, state.abbreviation)) - return ASCIIToUTF16(state.name); + return base::ASCIIToUTF16(state.name); } return base::string16(); } diff --git a/components/autofill/core/browser/validation.cc b/components/autofill/core/browser/validation.cc index b4b3a5e..4638c70 100644 --- a/components/autofill/core/browser/validation.cc +++ b/components/autofill/core/browser/validation.cc @@ -139,7 +139,7 @@ bool IsValidCreditCardSecurityCode(const base::string16& code, bool IsValidEmailAddress(const base::string16& text) { // E-Mail pattern as defined by the WhatWG. (4.10.7.1.5 E-Mail state) - const base::string16 kEmailPattern = ASCIIToUTF16( + const base::string16 kEmailPattern = base::ASCIIToUTF16( "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@" "[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$"); return MatchesPattern(text, kEmailPattern); @@ -151,7 +151,7 @@ bool IsValidState(const base::string16& text) { } bool IsValidZip(const base::string16& text) { - const base::string16 kZipPattern = ASCIIToUTF16("^\\d{5}(-\\d{4})?$"); + const base::string16 kZipPattern = base::ASCIIToUTF16("^\\d{5}(-\\d{4})?$"); return MatchesPattern(text, kZipPattern); } diff --git a/components/autofill/core/browser/validation_unittest.cc b/components/autofill/core/browser/validation_unittest.cc index 171dc5f..82ca746 100644 --- a/components/autofill/core/browser/validation_unittest.cc +++ b/components/autofill/core/browser/validation_unittest.cc @@ -7,6 +7,8 @@ #include "components/autofill/core/browser/validation.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { namespace { diff --git a/components/autofill/core/browser/webdata/autofill_entry.cc b/components/autofill/core/browser/webdata/autofill_entry.cc index 5cdc237..66ee6ca 100644 --- a/components/autofill/core/browser/webdata/autofill_entry.cc +++ b/components/autofill/core/browser/webdata/autofill_entry.cc @@ -27,8 +27,8 @@ AutofillKey::AutofillKey(const base::string16& name, } AutofillKey::AutofillKey(const char* name, const char* value) - : name_(UTF8ToUTF16(name)), - value_(UTF8ToUTF16(value)) { + : name_(base::UTF8ToUTF16(name)), + value_(base::UTF8ToUTF16(value)) { } AutofillKey::AutofillKey(const AutofillKey& key) diff --git a/components/autofill/core/browser/webdata/autofill_entry_unittest.cc b/components/autofill/core/browser/webdata/autofill_entry_unittest.cc index bef7d57..9679ccf 100644 --- a/components/autofill/core/browser/webdata/autofill_entry_unittest.cc +++ b/components/autofill/core/browser/webdata/autofill_entry_unittest.cc @@ -56,7 +56,8 @@ TEST(AutofillEntryTest, CullByTime) { // Within the time limit. timestamps.push_back(cutoff_time + one_hour); - AutofillKey key(UTF8ToUTF16("test_key"), UTF8ToUTF16("test_value")); + AutofillKey key(base::UTF8ToUTF16("test_key"), + base::UTF8ToUTF16("test_value")); AutofillEntry entry_within_the_limits(key, timestamps); EXPECT_FALSE(entry_within_the_limits.IsExpired()); diff --git a/components/autofill/core/browser/webdata/autofill_table.cc b/components/autofill/core/browser/webdata/autofill_table.cc index a57ac0d..000521a 100644 --- a/components/autofill/core/browser/webdata/autofill_table.cc +++ b/components/autofill/core/browser/webdata/autofill_table.cc @@ -2236,7 +2236,7 @@ bool AutofillTable::MigrateToVersion54AddI18nFieldsAndRemoveDeprecatedFields() { base::string16 line2 = s.ColumnString16(2); base::string16 street_address = line1; if (!line2.empty()) - street_address += ASCIIToUTF16("\n") + line2; + street_address += base::ASCIIToUTF16("\n") + line2; sql::Statement s_update(db_->GetUniqueStatement( "UPDATE autofill_profiles_temp SET street_address=? WHERE guid=?")); diff --git a/components/autofill/core/browser/webdata/web_data_service_unittest.cc b/components/autofill/core/browser/webdata/web_data_service_unittest.cc index d0e09b5..c29fe77 100644 --- a/components/autofill/core/browser/webdata/web_data_service_unittest.cc +++ b/components/autofill/core/browser/webdata/web_data_service_unittest.cc @@ -34,6 +34,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; using base::Time; using base::TimeDelta; using base::WaitableEvent; diff --git a/components/autofill/core/common/form_data.cc b/components/autofill/core/common/form_data.cc index 050e2e5..2297e1a 100644 --- a/components/autofill/core/common/form_data.cc +++ b/components/autofill/core/common/form_data.cc @@ -80,8 +80,8 @@ bool FormData::operator!=(const FormData& form) const { } std::ostream& operator<<(std::ostream& os, const FormData& form) { - os << UTF16ToUTF8(form.name) << " " - << UTF16ToUTF8(form.method) << " " + os << base::UTF16ToUTF8(form.name) << " " + << base::UTF16ToUTF8(form.method) << " " << form.origin << " " << form.action << " " << form.user_submitted << " " diff --git a/components/autofill/core/common/form_data_unittest.cc b/components/autofill/core/common/form_data_unittest.cc index 2d4b7aa..3e04412 100644 --- a/components/autofill/core/common/form_data_unittest.cc +++ b/components/autofill/core/common/form_data_unittest.cc @@ -12,16 +12,16 @@ namespace autofill { TEST(FormDataTest, SerializeAndDeserialize) { FormData data; - data.name = ASCIIToUTF16("name"); - data.method = ASCIIToUTF16("POST"); + data.name = base::ASCIIToUTF16("name"); + data.method = base::ASCIIToUTF16("POST"); data.origin = GURL("origin"); data.action = GURL("action"); data.user_submitted = true; FormFieldData field_data; - field_data.label = ASCIIToUTF16("label"); - field_data.name = ASCIIToUTF16("name"); - field_data.value = ASCIIToUTF16("value"); + field_data.label = base::ASCIIToUTF16("label"); + field_data.name = base::ASCIIToUTF16("name"); + field_data.value = base::ASCIIToUTF16("value"); field_data.form_control_type = "password"; field_data.autocomplete_attribute = "off"; field_data.max_length = 200; @@ -31,17 +31,17 @@ TEST(FormDataTest, SerializeAndDeserialize) { field_data.is_focusable = true; field_data.should_autocomplete = false; field_data.text_direction = base::i18n::RIGHT_TO_LEFT; - field_data.option_values.push_back(ASCIIToUTF16("First")); - field_data.option_values.push_back(ASCIIToUTF16("Second")); - field_data.option_contents.push_back(ASCIIToUTF16("First")); - field_data.option_contents.push_back(ASCIIToUTF16("Second")); + field_data.option_values.push_back(base::ASCIIToUTF16("First")); + field_data.option_values.push_back(base::ASCIIToUTF16("Second")); + field_data.option_contents.push_back(base::ASCIIToUTF16("First")); + field_data.option_contents.push_back(base::ASCIIToUTF16("Second")); data.fields.push_back(field_data); // Change a few fields. field_data.max_length = 150; - field_data.option_values.push_back(ASCIIToUTF16("Third")); - field_data.option_contents.push_back(ASCIIToUTF16("Third")); + field_data.option_values.push_back(base::ASCIIToUTF16("Third")); + field_data.option_contents.push_back(base::ASCIIToUTF16("Third")); data.fields.push_back(field_data); Pickle pickle; diff --git a/components/autofill/core/common/form_field_data.cc b/components/autofill/core/common/form_field_data.cc index d89e66e..6c2d5ec 100644 --- a/components/autofill/core/common/form_field_data.cc +++ b/components/autofill/core/common/form_field_data.cc @@ -151,11 +151,11 @@ bool DeserializeFormFieldData(PickleIterator* iter, std::ostream& operator<<(std::ostream& os, const FormFieldData& field) { return os - << UTF16ToUTF8(field.label) + << base::UTF16ToUTF8(field.label) << " " - << UTF16ToUTF8(field.name) + << base::UTF16ToUTF8(field.name) << " " - << UTF16ToUTF8(field.value) + << base::UTF16ToUTF8(field.value) << " " << field.form_control_type << " " diff --git a/components/autofill/core/common/form_field_data_unittest.cc b/components/autofill/core/common/form_field_data_unittest.cc index 7f4ef09..1f3d720 100644 --- a/components/autofill/core/common/form_field_data_unittest.cc +++ b/components/autofill/core/common/form_field_data_unittest.cc @@ -13,9 +13,9 @@ namespace autofill { TEST(FormFieldDataTest, SerializeAndDeserialize) { FormFieldData data; - data.label = ASCIIToUTF16("label"); - data.name = ASCIIToUTF16("name"); - data.value = ASCIIToUTF16("value"); + data.label = base::ASCIIToUTF16("label"); + data.name = base::ASCIIToUTF16("name"); + data.value = base::ASCIIToUTF16("value"); data.form_control_type = "password"; data.autocomplete_attribute = "off"; data.max_length = 200; @@ -25,10 +25,10 @@ TEST(FormFieldDataTest, SerializeAndDeserialize) { data.is_focusable = true; data.should_autocomplete = false; data.text_direction = base::i18n::RIGHT_TO_LEFT; - data.option_values.push_back(ASCIIToUTF16("First")); - data.option_values.push_back(ASCIIToUTF16("Second")); - data.option_contents.push_back(ASCIIToUTF16("First")); - data.option_contents.push_back(ASCIIToUTF16("Second")); + data.option_values.push_back(base::ASCIIToUTF16("First")); + data.option_values.push_back(base::ASCIIToUTF16("Second")); + data.option_contents.push_back(base::ASCIIToUTF16("First")); + data.option_contents.push_back(base::ASCIIToUTF16("Second")); Pickle pickle; SerializeFormFieldData(data, &pickle); diff --git a/components/autofill/core/common/password_form.cc b/components/autofill/core/common/password_form.cc index dcbc874..d6fe535 100644 --- a/components/autofill/core/common/password_form.cc +++ b/components/autofill/core/common/password_form.cc @@ -58,14 +58,15 @@ std::ostream& operator<<(std::ostream& os, const PasswordForm& form) { << " signon_realm: " << form.signon_realm << " origin: " << form.origin << " action: " << form.action - << " submit_element: " << UTF16ToUTF8(form.submit_element) - << " username_elem: " << UTF16ToUTF8(form.username_element) - << " username_value: " << UTF16ToUTF8(form.username_value) - << " password_elem: " << UTF16ToUTF8(form.password_element) - << " password_value: " << UTF16ToUTF8(form.password_value) + << " submit_element: " << base::UTF16ToUTF8(form.submit_element) + << " username_elem: " << base::UTF16ToUTF8(form.username_element) + << " username_value: " << base::UTF16ToUTF8(form.username_value) + << " password_elem: " << base::UTF16ToUTF8(form.password_element) + << " password_value: " << base::UTF16ToUTF8(form.password_value) << " old_password_element: " - << UTF16ToUTF8(form.old_password_element) - << " old_password_value: " << UTF16ToUTF8(form.old_password_value) + << base::UTF16ToUTF8(form.old_password_element) + << " old_password_value: " + << base::UTF16ToUTF8(form.old_password_value) << " autocomplete_set:" << form.password_autocomplete_set << " blacklisted: " << form.blacklisted_by_user << " preferred: " << form.preferred diff --git a/components/autofill/core/common/password_form_fill_data_unittest.cc b/components/autofill/core/common/password_form_fill_data_unittest.cc index 7c30f81..528a7ad 100644 --- a/components/autofill/core/common/password_form_fill_data_unittest.cc +++ b/components/autofill/core/common/password_form_fill_data_unittest.cc @@ -9,6 +9,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace autofill { // Tests that the when there is a single preferred match, and no extra diff --git a/components/breakpad/app/breakpad_win.cc b/components/breakpad/app/breakpad_win.cc index 02daab6..f683ce4 100644 --- a/components/breakpad/app/breakpad_win.cc +++ b/components/breakpad/app/breakpad_win.cc @@ -266,9 +266,11 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& exe_path, // Common g_custom_entries. g_custom_entries->push_back( - google_breakpad::CustomInfoEntry(L"ver", UTF16ToWide(version).c_str())); + google_breakpad::CustomInfoEntry(L"ver", + base::UTF16ToWide(version).c_str())); g_custom_entries->push_back( - google_breakpad::CustomInfoEntry(L"prod", UTF16ToWide(product).c_str())); + google_breakpad::CustomInfoEntry(L"prod", + base::UTF16ToWide(product).c_str())); g_custom_entries->push_back( google_breakpad::CustomInfoEntry(L"plat", L"Win32")); g_custom_entries->push_back( @@ -286,7 +288,7 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& exe_path, if (!special_build.empty()) g_custom_entries->push_back(google_breakpad::CustomInfoEntry( - L"special", UTF16ToWide(special_build).c_str())); + L"special", base::UTF16ToWide(special_build).c_str())); if (type == L"plugin" || type == L"ppapi") { std::wstring plugin_path = @@ -666,7 +668,7 @@ void InitCrashReporter(const std::string& process_type_switch) { // Disable the message box for assertions. _CrtSetReportMode(_CRT_ASSERT, 0); - std::wstring process_type = ASCIIToWide(process_type_switch); + std::wstring process_type = base::ASCIIToWide(process_type_switch); if (process_type.empty()) process_type = L"browser"; @@ -708,7 +710,7 @@ void InitCrashReporter(const std::string& process_type_switch) { InitDefaultCrashCallback(default_filter); return; } - std::wstring pipe_name = ASCIIToWide(pipe_name_ascii); + std::wstring pipe_name = base::ASCIIToWide(pipe_name_ascii); #ifdef _WIN64 // The protocol for connecting to the out-of-process Breakpad crash diff --git a/components/dom_distiller/content/distiller_page_web_contents.cc b/components/dom_distiller/content/distiller_page_web_contents.cc index e81976e..c0c7ff5 100644 --- a/components/dom_distiller/content/distiller_page_web_contents.cc +++ b/components/dom_distiller/content/distiller_page_web_contents.cc @@ -53,7 +53,7 @@ void DistillerPageWebContents::ExecuteJavaScriptImpl( DCHECK(host); host->ExecuteJavascriptInWebFrameCallbackResult( base::string16(), // frame_xpath - UTF8ToUTF16(script), + base::UTF8ToUTF16(script), base::Bind(&DistillerPage::OnExecuteJavaScriptDone, base::Unretained(this))); } diff --git a/components/plugins/renderer/plugin_placeholder.cc b/components/plugins/renderer/plugin_placeholder.cc index df85dd5..405ac86 100644 --- a/components/plugins/renderer/plugin_placeholder.cc +++ b/components/plugins/renderer/plugin_placeholder.cc @@ -164,7 +164,7 @@ void PluginPlaceholder::UpdateMessage() { std::string script = "window.setMessage(" + base::GetQuotedJSONString(message_) + ")"; plugin_->web_view()->mainFrame()->executeScript( - WebScriptSource(ASCIIToUTF16(script))); + WebScriptSource(base::ASCIIToUTF16(script))); } void PluginPlaceholder::ShowContextMenu(const WebMouseEvent& event) { diff --git a/components/policy/core/browser/configuration_policy_pref_store.cc b/components/policy/core/browser/configuration_policy_pref_store.cc index 60670fb..0c720ff 100644 --- a/components/policy/core/browser/configuration_policy_pref_store.cc +++ b/components/policy/core/browser/configuration_policy_pref_store.cc @@ -26,7 +26,7 @@ namespace { void LogErrors(PolicyErrorMap* errors) { PolicyErrorMap::const_iterator iter; for (iter = errors->begin(); iter != errors->end(); ++iter) { - base::string16 policy = ASCIIToUTF16(iter->first); + base::string16 policy = base::ASCIIToUTF16(iter->first); DLOG(WARNING) << "Policy " << policy << ": " << iter->second; } } diff --git a/components/policy/core/browser/policy_error_map.cc b/components/policy/core/browser/policy_error_map.cc index 95708ac..611260d 100644 --- a/components/policy/core/browser/policy_error_map.cc +++ b/components/policy/core/browser/policy_error_map.cc @@ -138,14 +138,15 @@ void PolicyErrorMap::Convert(const PendingError& error) { base::string16 submessage; if (error.has_replacement) { submessage = l10n_util::GetStringFUTF16(error.message_id, - ASCIIToUTF16(error.replacement)); + base::ASCIIToUTF16( + error.replacement)); } else { submessage = l10n_util::GetStringUTF16(error.message_id); } base::string16 message; if (!error.subkey.empty()) { message = l10n_util::GetStringFUTF16(IDS_POLICY_SUBKEY_ERROR, - ASCIIToUTF16(error.subkey), + base::ASCIIToUTF16(error.subkey), submessage); } else if (error.index >= 0) { message = l10n_util::GetStringFUTF16(IDS_POLICY_LIST_ENTRY_ERROR, diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc index 46f6133..9503277 100644 --- a/components/policy/core/common/policy_loader_win_unittest.cc +++ b/components/policy/core/common/policy_loader_win_unittest.cc @@ -37,6 +37,7 @@ #include "components/policy/core/common/schema_map.h" #include "testing/gtest/include/gtest/gtest.h" +using base::UTF8ToUTF16; using base::win::RegKey; namespace policy { @@ -293,7 +294,7 @@ ScopedGroupPolicyRegistrySandbox::ScopedGroupPolicyRegistrySandbox() { // Generate a unique registry key for the override for each test. This // makes sure that tests executing in parallel won't delete each other's // key, at DeleteKeys(). - key_name_ = ASCIIToWide(base::StringPrintf( + key_name_ = base::ASCIIToWide(base::StringPrintf( "SOFTWARE\\chromium unittest %d", base::Process::Current().pid())); std::wstring hklm_key_name = key_name_ + L"\\HKLM"; @@ -382,7 +383,7 @@ void RegistryTestHarness::InstallStringListPolicy( const std::string& policy_name, const base::ListValue* policy_value) { RegKey key(hive_, - (base::string16(kTestPolicyKey) + ASCIIToUTF16("\\") + + (base::string16(kTestPolicyKey) + base::ASCIIToUTF16("\\") + UTF8ToUTF16(policy_name)).c_str(), KEY_ALL_ACCESS); ASSERT_TRUE(key.Valid()); @@ -820,7 +821,7 @@ TEST_F(PolicyLoaderWinTest, Merge3rdPartyPolicies) { "}")); const base::string16 kPathSuffix = - kTestPolicyKey + ASCIIToUTF16("\\3rdparty\\extensions\\merge"); + kTestPolicyKey + base::ASCIIToUTF16("\\3rdparty\\extensions\\merge"); const char kUserMandatory[] = "user-mandatory"; const char kUserRecommended[] = "user-recommended"; @@ -909,7 +910,7 @@ TEST_F(PolicyLoaderWinTest, LoadStringEncodedValues) { encoded_policy.SetString("dict", encoded_dict); const base::string16 kPathSuffix = - kTestPolicyKey + ASCIIToUTF16("\\3rdparty\\extensions\\string"); + kTestPolicyKey + base::ASCIIToUTF16("\\3rdparty\\extensions\\string"); EXPECT_TRUE( InstallValue(encoded_policy, HKEY_CURRENT_USER, kPathSuffix, kMandatory)); @@ -937,7 +938,7 @@ TEST_F(PolicyLoaderWinTest, LoadIntegerEncodedValues) { encoded_policy.SetInteger("double", 456); const base::string16 kPathSuffix = - kTestPolicyKey + ASCIIToUTF16("\\3rdparty\\extensions\\int"); + kTestPolicyKey + base::ASCIIToUTF16("\\3rdparty\\extensions\\int"); EXPECT_TRUE( InstallValue(encoded_policy, HKEY_CURRENT_USER, kPathSuffix, kMandatory)); @@ -984,7 +985,7 @@ TEST_F(PolicyLoaderWinTest, DefaultPropertySchemaType) { all_policies.Set("policy", policy.DeepCopy()); const base::string16 kPathSuffix = - kTestPolicyKey + ASCIIToUTF16("\\3rdparty\\extensions\\test"); + kTestPolicyKey + base::ASCIIToUTF16("\\3rdparty\\extensions\\test"); EXPECT_TRUE( InstallValue(all_policies, HKEY_CURRENT_USER, kPathSuffix, kMandatory)); @@ -1161,7 +1162,7 @@ TEST_F(PolicyLoaderWinTest, LBSSupport) { "}"; const base::string16 kPathSuffix = - kTestPolicyKey + ASCIIToUTF16("\\3rdparty\\extensions"); + kTestPolicyKey + base::ASCIIToUTF16("\\3rdparty\\extensions"); base::ListValue list; list.AppendString("youtube.com"); @@ -1169,10 +1170,10 @@ TEST_F(PolicyLoaderWinTest, LBSSupport) { policy.Set("url_list", list.DeepCopy()); policy.SetString("alternative_browser_path", "c:\\legacy\\browser.exe"); base::DictionaryValue root; - root.Set(UTF16ToUTF8(kMandatory), policy.DeepCopy()); + root.Set(base::UTF16ToUTF8(kMandatory), policy.DeepCopy()); root.SetString(kSchema, kIncompleteSchema); EXPECT_TRUE(InstallValue(root, HKEY_LOCAL_MACHINE, - kPathSuffix, ASCIIToUTF16(ns.component_id))); + kPathSuffix, base::ASCIIToUTF16(ns.component_id))); PolicyBundle expected; PolicyMap& expected_policy = expected.Get(ns); diff --git a/components/policy/core/common/preg_parser_win.cc b/components/policy/core/common/preg_parser_win.cc index de3e22d..ee3fd2d 100644 --- a/components/policy/core/common/preg_parser_win.cc +++ b/components/policy/core/common/preg_parser_win.cc @@ -107,7 +107,7 @@ std::string DecodePRegStringValue(const std::vector<uint8>& data) { base::string16 result; std::transform(chars, chars + len - 1, std::back_inserter(result), std::ptr_fun(base::ByteSwapToLE16)); - return UTF16ToUTF8(result); + return base::UTF16ToUTF8(result); } // Decodes a value from a PReg file given as a uint8 vector. @@ -162,7 +162,7 @@ void HandleRecord(const base::string16& key_name, entry != path.end(); ++entry) { if (entry->empty()) continue; - const std::string name = UTF16ToUTF8(*entry); + const std::string name = base::UTF16ToUTF8(*entry); RegistryDict* subdict = dict->GetKey(name); if (!subdict) { subdict = new RegistryDict(); @@ -174,7 +174,7 @@ void HandleRecord(const base::string16& key_name, if (value.empty()) return; - std::string value_name(UTF16ToUTF8(value)); + std::string value_name(base::UTF16ToUTF8(value)); if (!StartsWithASCII(value_name, kActionTriggerPrefix, true)) { scoped_ptr<base::Value> value; if (DecodePRegValue(type, data, &value)) diff --git a/components/policy/core/common/registry_dict_win.cc b/components/policy/core/common/registry_dict_win.cc index a843d89..4774652 100644 --- a/components/policy/core/common/registry_dict_win.cc +++ b/components/policy/core/common/registry_dict_win.cc @@ -243,13 +243,14 @@ void RegistryDict::ReadRegistry(HKEY hive, const base::string16& root) { // First, read all the values of the key. for (RegistryValueIterator it(hive, root.c_str()); it.Valid(); ++it) { - const std::string name = UTF16ToUTF8(it.Name()); + const std::string name = base::UTF16ToUTF8(it.Name()); switch (it.Type()) { case REG_SZ: case REG_EXPAND_SZ: SetValue( name, - make_scoped_ptr(new base::StringValue(UTF16ToUTF8(it.Value())))); + make_scoped_ptr( + new base::StringValue(base::UTF16ToUTF8(it.Value())))); continue; case REG_DWORD_LITTLE_ENDIAN: case REG_DWORD_BIG_ENDIAN: @@ -282,7 +283,7 @@ void RegistryDict::ReadRegistry(HKEY hive, const base::string16& root) { // Recurse for all subkeys. for (RegistryKeyIterator it(hive, root.c_str()); it.Valid(); ++it) { - std::string name(UTF16ToUTF8(it.Name())); + std::string name(base::UTF16ToUTF8(it.Name())); scoped_ptr<RegistryDict> subdict(new RegistryDict()); subdict->ReadRegistry(hive, root + L"\\" + it.Name()); SetKey(name, subdict.Pass()); diff --git a/components/sessions/serialized_navigation_entry.cc b/components/sessions/serialized_navigation_entry.cc index 5506220..061c422 100644 --- a/components/sessions/serialized_navigation_entry.cc +++ b/components/sessions/serialized_navigation_entry.cc @@ -69,7 +69,7 @@ SerializedNavigationEntry SerializedNavigationEntry::FromSyncData( content::Referrer(GURL(sync_data.referrer()), blink::WebReferrerPolicyDefault); navigation.virtual_url_ = GURL(sync_data.virtual_url()); - navigation.title_ = UTF8ToUTF16(sync_data.title()); + navigation.title_ = base::UTF8ToUTF16(sync_data.title()); navigation.page_state_ = content::PageState::CreateFromEncodedData(sync_data.state()); @@ -141,7 +141,7 @@ SerializedNavigationEntry SerializedNavigationEntry::FromSyncData( static_cast<content::PageTransition>(transition); navigation.timestamp_ = base::Time(); - navigation.search_terms_ = UTF8ToUTF16(sync_data.search_terms()); + navigation.search_terms_ = base::UTF8ToUTF16(sync_data.search_terms()); if (sync_data.has_favicon_url()) navigation.favicon_url_ = GURL(sync_data.favicon_url()); @@ -368,7 +368,7 @@ sync_pb::TabNavigation SerializedNavigationEntry::ToSyncData() const { sync_data.set_virtual_url(virtual_url_.spec()); // FIXME(zea): Support referrer policy? sync_data.set_referrer(referrer_.url.spec()); - sync_data.set_title(UTF16ToUTF8(title_)); + sync_data.set_title(base::UTF16ToUTF8(title_)); // Page transition core. COMPILE_ASSERT(content::PAGE_TRANSITION_LAST_CORE == @@ -449,7 +449,7 @@ sync_pb::TabNavigation SerializedNavigationEntry::ToSyncData() const { // The full-resolution timestamp works as a global ID. sync_data.set_global_id(timestamp_.ToInternalValue()); - sync_data.set_search_terms(UTF16ToUTF8(search_terms_)); + sync_data.set_search_terms(base::UTF16ToUTF8(search_terms_)); sync_data.set_http_status_code(http_status_code_); diff --git a/components/sessions/serialized_navigation_entry_test_helper.cc b/components/sessions/serialized_navigation_entry_test_helper.cc index 66b156c..313fb77 100644 --- a/components/sessions/serialized_navigation_entry_test_helper.cc +++ b/components/sessions/serialized_navigation_entry_test_helper.cc @@ -39,7 +39,7 @@ SerializedNavigationEntry SerializedNavigationEntryTestHelper::CreateNavigation( content::Referrer(GURL("http://www.referrer.com"), blink::WebReferrerPolicyDefault); navigation.virtual_url_ = GURL(virtual_url); - navigation.title_ = UTF8ToUTF16(title); + navigation.title_ = base::UTF8ToUTF16(title); navigation.page_state_ = content::PageState::CreateFromEncodedData("fake_state"); navigation.timestamp_ = base::Time::Now(); diff --git a/components/sessions/serialized_navigation_entry_unittest.cc b/components/sessions/serialized_navigation_entry_unittest.cc index f029b5b..2f535cb 100644 --- a/components/sessions/serialized_navigation_entry_unittest.cc +++ b/components/sessions/serialized_navigation_entry_unittest.cc @@ -33,7 +33,7 @@ const content::Referrer kReferrer = content::Referrer(GURL("http://www.referrer.com"), blink::WebReferrerPolicyAlways); const GURL kVirtualURL("http://www.virtual-url.com"); -const base::string16 kTitle = ASCIIToUTF16("title"); +const base::string16 kTitle = base::ASCIIToUTF16("title"); const content::PageState kPageState = content::PageState::CreateFromEncodedData("page state"); const content::PageTransition kTransitionType = @@ -46,7 +46,7 @@ const int64 kPostID = 100; const GURL kOriginalRequestURL("http://www.original-request.com"); const bool kIsOverridingUserAgent = true; const base::Time kTimestamp = syncer::ProtoTimeToTime(100); -const base::string16 kSearchTerms = ASCIIToUTF16("my search terms"); +const base::string16 kSearchTerms = base::ASCIIToUTF16("my search terms"); const GURL kFaviconURL("http://virtual-url.com/favicon.ico"); const int kHttpStatusCode = 404; @@ -78,7 +78,7 @@ sync_pb::TabNavigation MakeSyncDataForTest() { sync_pb::TabNavigation sync_data; sync_data.set_virtual_url(kVirtualURL.spec()); sync_data.set_referrer(kReferrer.url.spec()); - sync_data.set_title(UTF16ToUTF8(kTitle)); + sync_data.set_title(base::UTF16ToUTF8(kTitle)); sync_data.set_state(kPageState.ToEncodedData()); sync_data.set_page_transition( sync_pb::SyncEnums_PageTransition_AUTO_SUBFRAME); @@ -86,7 +86,7 @@ sync_pb::TabNavigation MakeSyncDataForTest() { sync_data.set_timestamp_msec(syncer::TimeToProtoTime(kTimestamp)); sync_data.set_redirect_type(sync_pb::SyncEnums::CLIENT_REDIRECT); sync_data.set_navigation_home_page(true); - sync_data.set_search_terms(UTF16ToUTF8(kSearchTerms)); + sync_data.set_search_terms(base::UTF16ToUTF8(kSearchTerms)); sync_data.set_favicon_url(kFaviconURL.spec()); sync_data.set_http_status_code(kHttpStatusCode); return sync_data; @@ -250,7 +250,7 @@ TEST(SerializedNavigationEntryTest, ToSyncData) { EXPECT_EQ(kVirtualURL.spec(), sync_data.virtual_url()); EXPECT_EQ(kReferrer.url.spec(), sync_data.referrer()); - EXPECT_EQ(kTitle, ASCIIToUTF16(sync_data.title())); + EXPECT_EQ(kTitle, base::ASCIIToUTF16(sync_data.title())); EXPECT_TRUE(sync_data.state().empty()); EXPECT_EQ(sync_pb::SyncEnums_PageTransition_AUTO_SUBFRAME, sync_data.page_transition()); diff --git a/components/translate/language_detection/language_detection_util.cc b/components/translate/language_detection/language_detection_util.cc index a6f0308..6a3b160 100644 --- a/components/translate/language_detection/language_detection_util.cc +++ b/components/translate/language_detection/language_detection_util.cc @@ -110,7 +110,7 @@ std::string DetermineTextLanguage(const base::string16& text, #endif #if !defined(CLD_VERSION) || CLD_VERSION==2 case 2: { - std::string utf8_text(UTF16ToUTF8(text)); + std::string utf8_text(base::UTF16ToUTF8(text)); CLD2::Language language3[3]; int percent3[3]; CLD2::DetectLanguageSummary( diff --git a/components/translate/language_detection/language_detection_util_unittest.cc b/components/translate/language_detection/language_detection_util_unittest.cc index c3bf6c1..b66c57b 100644 --- a/components/translate/language_detection/language_detection_util_unittest.cc +++ b/components/translate/language_detection/language_detection_util_unittest.cc @@ -94,7 +94,7 @@ TEST_F(LanguageDetectionUtilTest, WellKnownWrongConfiguration) { // Tests that the language meta tag providing wrong information is ignored by // LanguageDetectionUtil due to disagreement between meta tag and CLD. TEST_F(LanguageDetectionUtilTest, CLDDisagreeWithWrongLanguageCode) { - base::string16 contents = ASCIIToUTF16( + base::string16 contents = base::ASCIIToUTF16( "<html><head><meta http-equiv='Content-Language' content='ja'></head>" "<body>This is a page apparently written in English. Even though " "content-language is provided, the value will be ignored if the value " @@ -114,7 +114,7 @@ TEST_F(LanguageDetectionUtilTest, CLDDisagreeWithWrongLanguageCode) { // Tests that the language meta tag providing "en-US" style information is // agreed by CLD. TEST_F(LanguageDetectionUtilTest, CLDAgreeWithLanguageCodeHavingCountryCode) { - base::string16 contents = ASCIIToUTF16( + base::string16 contents = base::ASCIIToUTF16( "<html><head><meta http-equiv='Content-Language' content='en-US'></head>" "<body>This is a page apparently written in English. Even though " "content-language is provided, the value will be ignored if the value " @@ -135,7 +135,7 @@ TEST_F(LanguageDetectionUtilTest, CLDAgreeWithLanguageCodeHavingCountryCode) { // CLD's language will be adopted by LanguageDetectionUtil due to an invalid // meta tag. TEST_F(LanguageDetectionUtilTest, InvalidLanguageMetaTagProviding) { - base::string16 contents = ASCIIToUTF16( + base::string16 contents = base::ASCIIToUTF16( "<html><head><meta http-equiv='Content-Language' content='utf-8'></head>" "<body>This is a page apparently written in English. Even though " "content-language is provided, the value will be ignored and CLD's" @@ -155,7 +155,7 @@ TEST_F(LanguageDetectionUtilTest, InvalidLanguageMetaTagProviding) { // Tests that the language meta tag providing wrong information is ignored // because of valid html lang attribute. TEST_F(LanguageDetectionUtilTest, AdoptHtmlLang) { - base::string16 contents = ASCIIToUTF16( + base::string16 contents = base::ASCIIToUTF16( "<html lang='en'><head><meta http-equiv='Content-Language' content='ja'>" "</head><body>This is a page apparently written in English. Even though " "content-language is provided, the value will be ignored if the value " diff --git a/components/webdata/common/web_database_migration_unittest.cc b/components/webdata/common/web_database_migration_unittest.cc index 9b12fac..b8964a6 100644 --- a/components/webdata/common/web_database_migration_unittest.cc +++ b/components/webdata/common/web_database_migration_unittest.cc @@ -34,6 +34,7 @@ using autofill::AutofillProfile; using autofill::AutofillTable; using autofill::CreditCard; +using base::ASCIIToUTF16; using base::Time; namespace { diff --git a/components/webdata/encryptor/encryptor_mac.mm b/components/webdata/encryptor/encryptor_mac.mm index 089bf6c..de384db 100644 --- a/components/webdata/encryptor/encryptor_mac.mm +++ b/components/webdata/encryptor/encryptor_mac.mm @@ -71,7 +71,7 @@ crypto::SymmetricKey* GetEncryptionKey() { bool Encryptor::EncryptString16(const base::string16& plaintext, std::string* ciphertext) { - return EncryptString(UTF16ToUTF8(plaintext), ciphertext); + return EncryptString(base::UTF16ToUTF8(plaintext), ciphertext); } bool Encryptor::DecryptString16(const std::string& ciphertext, @@ -80,7 +80,7 @@ bool Encryptor::DecryptString16(const std::string& ciphertext, if (!DecryptString(ciphertext, &utf8)) return false; - *plaintext = UTF8ToUTF16(utf8); + *plaintext = base::UTF8ToUTF16(utf8); return true; } diff --git a/components/webdata/encryptor/encryptor_posix.cc b/components/webdata/encryptor/encryptor_posix.cc index ae16af5..a59abc5 100644 --- a/components/webdata/encryptor/encryptor_posix.cc +++ b/components/webdata/encryptor/encryptor_posix.cc @@ -56,7 +56,7 @@ crypto::SymmetricKey* GetEncryptionKey() { bool Encryptor::EncryptString16(const base::string16& plaintext, std::string* ciphertext) { - return EncryptString(UTF16ToUTF8(plaintext), ciphertext); + return EncryptString(base::UTF16ToUTF8(plaintext), ciphertext); } bool Encryptor::DecryptString16(const std::string& ciphertext, @@ -65,7 +65,7 @@ bool Encryptor::DecryptString16(const std::string& ciphertext, if (!DecryptString(ciphertext, &utf8)) return false; - *plaintext = UTF8ToUTF16(utf8); + *plaintext = base::UTF8ToUTF16(utf8); return true; } diff --git a/components/webdata/encryptor/encryptor_unittest.cc b/components/webdata/encryptor/encryptor_unittest.cc index 95158f1..b48792a 100644 --- a/components/webdata/encryptor/encryptor_unittest.cc +++ b/components/webdata/encryptor/encryptor_unittest.cc @@ -39,14 +39,14 @@ TEST_F(EncryptorTest, String16EncryptionDecryption) { EXPECT_EQ(plaintext, result); // Test a simple string. - plaintext = ASCIIToUTF16("hello"); + plaintext = base::ASCIIToUTF16("hello"); EXPECT_TRUE(Encryptor::EncryptString16(plaintext, &ciphertext)); EXPECT_TRUE(Encryptor::DecryptString16(ciphertext, &result)); EXPECT_EQ(plaintext, result); // Test a 16-byte aligned string. This previously hit a boundary error in // base::Encryptor::Crypt() on Mac. - plaintext = ASCIIToUTF16("1234567890123456"); + plaintext = base::ASCIIToUTF16("1234567890123456"); EXPECT_TRUE(Encryptor::EncryptString16(plaintext, &ciphertext)); EXPECT_TRUE(Encryptor::DecryptString16(ciphertext, &result)); EXPECT_EQ(plaintext, result); @@ -59,19 +59,19 @@ TEST_F(EncryptorTest, String16EncryptionDecryption) { 0x65e5, 0x661f, 0x671f, 0x4e94, 0xd8b1, 0xdce1, 0x7052, 0x5095, 0x7c0b, 0xe586, 0}; plaintext = wchars; - utf8_plaintext = UTF16ToUTF8(plaintext); - EXPECT_EQ(plaintext, UTF8ToUTF16(utf8_plaintext)); + utf8_plaintext = base::UTF16ToUTF8(plaintext); + EXPECT_EQ(plaintext, base::UTF8ToUTF16(utf8_plaintext)); EXPECT_TRUE(Encryptor::EncryptString16(plaintext, &ciphertext)); EXPECT_TRUE(Encryptor::DecryptString16(ciphertext, &result)); EXPECT_EQ(plaintext, result); EXPECT_TRUE(Encryptor::DecryptString(ciphertext, &utf8_result)); - EXPECT_EQ(utf8_plaintext, UTF16ToUTF8(result)); + EXPECT_EQ(utf8_plaintext, base::UTF16ToUTF8(result)); EXPECT_TRUE(Encryptor::EncryptString(utf8_plaintext, &ciphertext)); EXPECT_TRUE(Encryptor::DecryptString16(ciphertext, &result)); EXPECT_EQ(plaintext, result); EXPECT_TRUE(Encryptor::DecryptString(ciphertext, &utf8_result)); - EXPECT_EQ(utf8_plaintext, UTF16ToUTF8(result)); + EXPECT_EQ(utf8_plaintext, base::UTF16ToUTF8(result)); } TEST_F(EncryptorTest, EncryptionDecryption) { diff --git a/components/webdata/encryptor/encryptor_win.cc b/components/webdata/encryptor/encryptor_win.cc index adf792f..f7afa5d 100644 --- a/components/webdata/encryptor/encryptor_win.cc +++ b/components/webdata/encryptor/encryptor_win.cc @@ -12,7 +12,7 @@ bool Encryptor::EncryptString16(const base::string16& plaintext, std::string* ciphertext) { - return EncryptString(UTF16ToUTF8(plaintext), ciphertext); + return EncryptString(base::UTF16ToUTF8(plaintext), ciphertext); } bool Encryptor::DecryptString16(const std::string& ciphertext, @@ -21,7 +21,7 @@ bool Encryptor::DecryptString16(const std::string& ciphertext, if (!DecryptString(ciphertext, &utf8)) return false; - *plaintext = UTF8ToUTF16(utf8); + *plaintext = base::UTF8ToUTF16(utf8); return true; } diff --git a/components/wifi/wifi_service_win.cc b/components/wifi/wifi_service_win.cc index ac4d011..71342a2 100644 --- a/components/wifi/wifi_service_win.cc +++ b/components/wifi/wifi_service_win.cc @@ -530,7 +530,7 @@ void WiFiServiceImpl::CreateNetwork( return; } - base::string16 profile_xml16(UTF8ToUTF16(profile_xml)); + base::string16 profile_xml16(base::UTF8ToUTF16(profile_xml)); DWORD reason_code = 0u; error_code = WlanSetProfile_function_(client_, |