diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 20:09:36 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 20:09:36 +0000 |
commit | dd2cc808be553ce11d1ac3a1b7e8382ffca65293 (patch) | |
tree | 097cc69a05043c74ad3793f9f26e263df0b7a6f9 | |
parent | b6775d788c0bcc4bc879731478a2eadc522dc767 (diff) | |
download | chromium_src-dd2cc808be553ce11d1ac3a1b7e8382ffca65293.zip chromium_src-dd2cc808be553ce11d1ac3a1b7e8382ffca65293.tar.gz chromium_src-dd2cc808be553ce11d1ac3a1b7e8382ffca65293.tar.bz2 |
Update uses of UTF conversions in ui/ to use the base:: namespace.
BUG=330556
TEST=no change
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/106383004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242504 0039d316-1c4b-4281-b951-d872f2087c98
129 files changed, 353 insertions, 235 deletions
diff --git a/ui/app_list/cocoa/app_list_window_controller_unittest.mm b/ui/app_list/cocoa/app_list_window_controller_unittest.mm index 0f76691..672363b 100644 --- a/ui/app_list/cocoa/app_list_window_controller_unittest.mm +++ b/ui/app_list/cocoa/app_list_window_controller_unittest.mm @@ -81,7 +81,7 @@ TEST_F(AppListWindowControllerTest, CloseClearsSearch) { EXPECT_FALSE([view_controller showingSearchResults]); - const base::string16 search_text(ASCIIToUTF16("test")); + const base::string16 search_text(base::ASCIIToUTF16("test")); model->SetText(search_text); EXPECT_TRUE([view_controller showingSearchResults]); diff --git a/ui/app_list/cocoa/apps_grid_controller_unittest.mm b/ui/app_list/cocoa/apps_grid_controller_unittest.mm index 5969b20..da0b37d 100644 --- a/ui/app_list/cocoa/apps_grid_controller_unittest.mm +++ b/ui/app_list/cocoa/apps_grid_controller_unittest.mm @@ -138,7 +138,7 @@ class AppListItemWithMenu : public AppListItemModel { menu_model_(NULL), menu_ready_(true) { SetTitleAndFullName(title, title); - menu_model_.AddItem(0, UTF8ToUTF16("Menu For: " + title)); + menu_model_.AddItem(0, base::UTF8ToUTF16("Menu For: " + title)); } void SetMenuReadyForTesting(bool ready) { diff --git a/ui/app_list/cocoa/apps_search_box_controller_unittest.mm b/ui/app_list/cocoa/apps_search_box_controller_unittest.mm index bbe7ce6..82d4358 100644 --- a/ui/app_list/cocoa/apps_search_box_controller_unittest.mm +++ b/ui/app_list/cocoa/apps_search_box_controller_unittest.mm @@ -16,6 +16,8 @@ #import "ui/base/cocoa/menu_controller.h" #import "ui/base/test/ui_cocoa_test_helper.h" +using base::ASCIIToUTF16; + @interface TestAppsSearchBoxDelegate : NSObject<AppsSearchBoxDelegate> { @private app_list::SearchBoxModel searchBoxModel_; diff --git a/ui/app_list/cocoa/apps_search_results_controller_unittest.mm b/ui/app_list/cocoa/apps_search_results_controller_unittest.mm index 27e04e9..dec1b1f 100644 --- a/ui/app_list/cocoa/apps_search_results_controller_unittest.mm +++ b/ui/app_list/cocoa/apps_search_results_controller_unittest.mm @@ -65,9 +65,9 @@ class SearchResultWithMenu : public SearchResult { SearchResultWithMenu(const std::string& title, const std::string& details) : menu_model_(NULL), menu_ready_(true) { - set_title(ASCIIToUTF16(title)); - set_details(ASCIIToUTF16(details)); - menu_model_.AddItem(0, UTF8ToUTF16("Menu For: " + title)); + set_title(base::ASCIIToUTF16(title)); + set_details(base::ASCIIToUTF16(details)); + menu_model_.AddItem(0, base::UTF8ToUTF16("Menu For: " + title)); } void SetMenuReadyForTesting(bool ready) { @@ -146,7 +146,7 @@ void AppsSearchResultsControllerTest::ExpectConsistent() { SearchResult* result = ModelResultAt(i); base::string16 string_in_model = result->title(); if (!result->details().empty()) - string_in_model += ASCIIToUTF16("\n") + result->details(); + string_in_model += base::ASCIIToUTF16("\n") + result->details(); EXPECT_NSEQ(base::SysUTF16ToNSString(string_in_model), [[ViewResultAt(i) attributedStringValue] string]); } diff --git a/ui/app_list/cocoa/signin_view_controller_unittest.mm b/ui/app_list/cocoa/signin_view_controller_unittest.mm index 70845df..f230ceb 100644 --- a/ui/app_list/cocoa/signin_view_controller_unittest.mm +++ b/ui/app_list/cocoa/signin_view_controller_unittest.mm @@ -37,7 +37,7 @@ class SigninViewControllerTest : public ui::CocoaTest, public SigninDelegate { public: SigninViewControllerTest() - : test_text_(ASCIIToUTF16("Sign in")), + : test_text_(base::ASCIIToUTF16("Sign in")), needs_signin_(true), show_signin_count_(0), open_learn_more_count_(0), diff --git a/ui/app_list/views/app_list_item_view.cc b/ui/app_list/views/app_list_item_view.cc index ba9a294..1e70e42 100644 --- a/ui/app_list/views/app_list_item_view.cc +++ b/ui/app_list/views/app_list_item_view.cc @@ -134,7 +134,7 @@ void AppListItemView::UpdateIcon() { void AppListItemView::UpdateTooltip() { title_->SetTooltipText(model_->title() == model_->full_name() ? - base::string16() : UTF8ToUTF16(model_->full_name())); + base::string16() : base::UTF8ToUTF16(model_->full_name())); } void AppListItemView::SetUIState(UIState state) { @@ -226,7 +226,7 @@ void AppListItemView::ItemIconChanged() { } void AppListItemView::ItemTitleChanged() { - title_->SetText(UTF8ToUTF16(model_->title())); + title_->SetText(base::UTF8ToUTF16(model_->title())); title_->Invalidate(); UpdateTooltip(); Layout(); @@ -317,7 +317,7 @@ void AppListItemView::OnPaint(gfx::Canvas* canvas) { void AppListItemView::GetAccessibleState(ui::AccessibleViewState* state) { state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; - state->name = UTF8ToUTF16(model_->title()); + state->name = base::UTF8ToUTF16(model_->title()); } void AppListItemView::ShowContextMenuForView(views::View* source, diff --git a/ui/app_list/views/apps_grid_view_unittest.cc b/ui/app_list/views/apps_grid_view_unittest.cc index f2e9450..47cdb89 100644 --- a/ui/app_list/views/apps_grid_view_unittest.cc +++ b/ui/app_list/views/apps_grid_view_unittest.cc @@ -441,8 +441,8 @@ TEST_F(AppsGridViewTest, ItemLabelShortNameOverride) { const views::Label* title_label = item_view->title(); EXPECT_TRUE(title_label->GetTooltipText( title_label->bounds().CenterPoint(), &actual_tooltip)); - EXPECT_EQ(expected_tooltip, UTF16ToUTF8(actual_tooltip)); - EXPECT_EQ(expected_text, UTF16ToUTF8(title_label->text())); + EXPECT_EQ(expected_tooltip, base::UTF16ToUTF8(actual_tooltip)); + EXPECT_EQ(expected_text, base::UTF16ToUTF8(title_label->text())); } TEST_F(AppsGridViewTest, ItemLabelNoShortName) { @@ -457,7 +457,7 @@ TEST_F(AppsGridViewTest, ItemLabelNoShortName) { const views::Label* title_label = item_view->title(); EXPECT_FALSE(title_label->GetTooltipText( title_label->bounds().CenterPoint(), &actual_tooltip)); - EXPECT_EQ(title, UTF16ToUTF8(title_label->text())); + EXPECT_EQ(title, base::UTF16ToUTF8(title_label->text())); } } // namespace test diff --git a/ui/app_list/views/folder_header_view.cc b/ui/app_list/views/folder_header_view.cc index 9699e8f..302514d 100644 --- a/ui/app_list/views/folder_header_view.cc +++ b/ui/app_list/views/folder_header_view.cc @@ -99,7 +99,7 @@ void FolderHeaderView::Update() { if (!folder_item_) return; - folder_name_view_->SetText(UTF8ToUTF16(folder_item_->title())); + folder_name_view_->SetText(base::UTF8ToUTF16(folder_item_->title())); } gfx::Size FolderHeaderView::GetPreferredSize() { @@ -146,7 +146,7 @@ void FolderHeaderView::ContentsChanged(views::Textfield* sender, return; folder_item_->RemoveObserver(this); - std::string name = UTF16ToUTF8(folder_name_view_->text()); + std::string name = base::UTF16ToUTF8(folder_name_view_->text()); folder_item_->SetTitleAndFullName(name, name); folder_item_->AddObserver(this); } diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc index 4439af5..de3cbf2 100644 --- a/ui/base/accelerators/accelerator.cc +++ b/ui/base/accelerators/accelerator.cc @@ -206,7 +206,7 @@ base::string16 Accelerator::GetShortcutText() const { shortcut += static_cast<base::string16::value_type>(g_ascii_toupper(name[0])); else - shortcut += UTF8ToUTF16(name); + shortcut += base::UTF8ToUTF16(name); } #endif } else { @@ -262,7 +262,7 @@ base::string16 Accelerator::GetShortcutText() const { if (adjust_shortcut_for_rtl) { int key_length = static_cast<int>(shortcut_rtl.length()); DCHECK_GT(key_length, 0); - shortcut_rtl.append(ASCIIToUTF16("+")); + shortcut_rtl.append(base::ASCIIToUTF16("+")); // Subtracting the size of the shortcut key and 1 for the '+' sign. shortcut_rtl.append(shortcut, 0, shortcut.length() - key_length - 1); diff --git a/ui/base/clipboard/clipboard_android.cc b/ui/base/clipboard/clipboard_android.cc index 3e56ecd..e5e2a96 100644 --- a/ui/base/clipboard/clipboard_android.cc +++ b/ui/base/clipboard/clipboard_android.cc @@ -264,7 +264,7 @@ void Clipboard::ReadText(ClipboardType type, base::string16* result) const { DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); std::string utf8; ReadAsciiText(type, &utf8); - *result = UTF8ToUTF16(utf8); + *result = base::UTF8ToUTF16(utf8); } void Clipboard::ReadAsciiText(ClipboardType type, std::string* result) const { @@ -285,7 +285,7 @@ void Clipboard::ReadHTML(ClipboardType type, src_url->clear(); std::string input = g_map.Get().Get(kHTMLFormat); - *markup = UTF8ToUTF16(input); + *markup = base::UTF8ToUTF16(input); *fragment_start = 0; *fragment_end = static_cast<uint32>(markup->length()); diff --git a/ui/base/clipboard/clipboard_aura.cc b/ui/base/clipboard/clipboard_aura.cc index 6fe2ff36..ab4cf3e 100644 --- a/ui/base/clipboard/clipboard_aura.cc +++ b/ui/base/clipboard/clipboard_aura.cc @@ -189,7 +189,7 @@ class AuraClipboard { void ReadText(base::string16* result) const { std::string utf8_result; ReadAsciiText(&utf8_result); - *result = UTF8ToUTF16(utf8_result); + *result = base::UTF8ToUTF16(utf8_result); } // Reads ascii text from the data at the top of clipboard stack. @@ -221,7 +221,7 @@ class AuraClipboard { return; const ClipboardData* data = GetData(); - *markup = UTF8ToUTF16(data->markup_data()); + *markup = base::UTF8ToUTF16(data->markup_data()); *src_url = data->url(); *fragment_start = 0; @@ -272,7 +272,7 @@ class AuraClipboard { return; const ClipboardData* data = GetData(); - *title = UTF8ToUTF16(data->bookmark_title()); + *title = base::UTF8ToUTF16(data->bookmark_title()); *url = data->bookmark_url(); } @@ -493,13 +493,13 @@ void Clipboard::ReadAvailableTypes(ClipboardType type, types->clear(); *contains_filenames = false; if (IsFormatAvailable(GetPlainTextFormatType(), type)) - types->push_back(UTF8ToUTF16(GetPlainTextFormatType().ToString())); + types->push_back(base::UTF8ToUTF16(GetPlainTextFormatType().ToString())); if (IsFormatAvailable(GetHtmlFormatType(), type)) - types->push_back(UTF8ToUTF16(GetHtmlFormatType().ToString())); + types->push_back(base::UTF8ToUTF16(GetHtmlFormatType().ToString())); if (IsFormatAvailable(GetRtfFormatType(), type)) - types->push_back(UTF8ToUTF16(GetRtfFormatType().ToString())); + types->push_back(base::UTF8ToUTF16(GetRtfFormatType().ToString())); if (IsFormatAvailable(GetBitmapFormatType(), type)) - types->push_back(UTF8ToUTF16(kMimeTypePNG)); + types->push_back(base::UTF8ToUTF16(kMimeTypePNG)); AuraClipboard* clipboard = GetClipboard(); if (clipboard->IsFormatAvailable(CUSTOM) && clipboard->GetData()) { diff --git a/ui/base/clipboard/clipboard_aurax11.cc b/ui/base/clipboard/clipboard_aurax11.cc index 3c75154..3be15de 100644 --- a/ui/base/clipboard/clipboard_aurax11.cc +++ b/ui/base/clipboard/clipboard_aurax11.cc @@ -581,13 +581,13 @@ void Clipboard::ReadAvailableTypes(ClipboardType type, types->clear(); if (target_list.ContainsText()) - types->push_back(UTF8ToUTF16(kMimeTypeText)); + types->push_back(base::UTF8ToUTF16(kMimeTypeText)); if (target_list.ContainsFormat(GetHtmlFormatType())) - types->push_back(UTF8ToUTF16(kMimeTypeHTML)); + types->push_back(base::UTF8ToUTF16(kMimeTypeHTML)); if (target_list.ContainsFormat(GetRtfFormatType())) - types->push_back(UTF8ToUTF16(kMimeTypeRTF)); + types->push_back(base::UTF8ToUTF16(kMimeTypeRTF)); if (target_list.ContainsFormat(GetBitmapFormatType())) - types->push_back(UTF8ToUTF16(kMimeTypePNG)); + types->push_back(base::UTF8ToUTF16(kMimeTypePNG)); *contains_filenames = false; SelectionData data(aurax11_details_->RequestAndWaitForTypes( @@ -603,7 +603,7 @@ void Clipboard::ReadText(ClipboardType type, base::string16* result) const { type, aurax11_details_->GetTextAtoms())); if (data.IsValid()) { std::string text = data.GetText(); - *result = UTF8ToUTF16(text); + *result = base::UTF8ToUTF16(text); } } @@ -736,8 +736,8 @@ void Clipboard::WriteBookmark(const char* title_data, const char* url_data, size_t url_len) { // Write as a mozilla url (UTF16: URL, newline, title). - base::string16 url = UTF8ToUTF16(std::string(url_data, url_len) + "\n"); - base::string16 title = UTF8ToUTF16(std::string(title_data, title_len)); + base::string16 url = base::UTF8ToUTF16(std::string(url_data, url_len) + "\n"); + base::string16 title = base::UTF8ToUTF16(std::string(title_data, title_len)); std::vector<unsigned char> data; ui::AddString16ToVector(url, &data); diff --git a/ui/base/clipboard/clipboard_gtk.cc b/ui/base/clipboard/clipboard_gtk.cc index eebcc5e..8f81911 100644 --- a/ui/base/clipboard/clipboard_gtk.cc +++ b/ui/base/clipboard/clipboard_gtk.cc @@ -317,8 +317,8 @@ void Clipboard::WriteBitmap(const SkBitmap& bitmap) { void Clipboard::WriteBookmark(const char* title_data, size_t title_len, const char* url_data, size_t url_len) { // Write as a mozilla url (UTF16: URL, newline, title). - base::string16 url = UTF8ToUTF16(std::string(url_data, url_len) + "\n"); - base::string16 title = UTF8ToUTF16(std::string(title_data, title_len)); + base::string16 url = base::UTF8ToUTF16(std::string(url_data, url_len) + "\n"); + base::string16 title = base::UTF8ToUTF16(std::string(title_data, title_len)); if (title.length() >= std::numeric_limits<size_t>::max() / 4 || url.length() >= std::numeric_limits<size_t>::max() / 4) return; @@ -417,13 +417,13 @@ void Clipboard::ReadAvailableTypes(ClipboardType type, types->clear(); if (IsFormatAvailable(GetPlainTextFormatType(), type)) - types->push_back(UTF8ToUTF16(kMimeTypeText)); + types->push_back(base::UTF8ToUTF16(kMimeTypeText)); if (IsFormatAvailable(GetHtmlFormatType(), type)) - types->push_back(UTF8ToUTF16(kMimeTypeHTML)); + types->push_back(base::UTF8ToUTF16(kMimeTypeHTML)); if (IsFormatAvailable(GetRtfFormatType(), type)) - types->push_back(UTF8ToUTF16(kMimeTypeRTF)); + types->push_back(base::UTF8ToUTF16(kMimeTypeRTF)); if (IsFormatAvailable(GetBitmapFormatType(), type)) - types->push_back(UTF8ToUTF16(kMimeTypePNG)); + types->push_back(base::UTF8ToUTF16(kMimeTypePNG)); *contains_filenames = false; GtkClipboard* clipboard = LookupBackingClipboard(type); @@ -454,7 +454,7 @@ void Clipboard::ReadText(ClipboardType type, base::string16* result) const { return; // TODO(estade): do we want to handle the possible error here? - UTF8ToUTF16(text, strlen(text), result); + base::UTF8ToUTF16(text, strlen(text), result); g_free(text); } @@ -508,7 +508,8 @@ void Clipboard::ReadHTML(ClipboardType type, markup->assign(reinterpret_cast<const uint16_t*>(raw_data) + 1, (data_length / 2) - 1); } else { - UTF8ToUTF16(reinterpret_cast<const char*>(raw_data), data_length, markup); + base::UTF8ToUTF16( + reinterpret_cast<const char*>(raw_data), data_length, markup); } // If there is a terminating NULL, drop it. diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm index a774db0..0d0b2fa 100644 --- a/ui/base/clipboard/clipboard_mac.mm +++ b/ui/base/clipboard/clipboard_mac.mm @@ -228,13 +228,13 @@ void Clipboard::ReadAvailableTypes(ClipboardType type, DCHECK(CalledOnValidThread()); types->clear(); if (IsFormatAvailable(Clipboard::GetPlainTextFormatType(), type)) - types->push_back(UTF8ToUTF16(kMimeTypeText)); + types->push_back(base::UTF8ToUTF16(kMimeTypeText)); if (IsFormatAvailable(Clipboard::GetHtmlFormatType(), type)) - types->push_back(UTF8ToUTF16(kMimeTypeHTML)); + types->push_back(base::UTF8ToUTF16(kMimeTypeHTML)); if (IsFormatAvailable(Clipboard::GetRtfFormatType(), type)) - types->push_back(UTF8ToUTF16(kMimeTypeRTF)); + types->push_back(base::UTF8ToUTF16(kMimeTypeRTF)); if ([NSImage canInitWithPasteboard:GetPasteboard()]) - types->push_back(UTF8ToUTF16(kMimeTypePNG)); + types->push_back(base::UTF8ToUTF16(kMimeTypePNG)); *contains_filenames = false; NSPasteboard* pb = GetPasteboard(); @@ -251,9 +251,7 @@ void Clipboard::ReadText(ClipboardType type, base::string16* result) const { NSPasteboard* pb = GetPasteboard(); NSString* contents = [pb stringForType:NSStringPboardType]; - UTF8ToUTF16([contents UTF8String], - [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], - result); + *result = base::SysNSStringToUTF16(contents); } void Clipboard::ReadAsciiText(ClipboardType type, std::string* result) const { @@ -291,9 +289,7 @@ void Clipboard::ReadHTML(ClipboardType type, NSString* contents = [pb stringForType:bestType]; if ([bestType isEqualToString:NSRTFPboardType]) contents = [pb htmlFromRtf]; - UTF8ToUTF16([contents UTF8String], - [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], - markup); + *markup = base::SysNSStringToUTF16(contents); } *fragment_start = 0; @@ -346,9 +342,7 @@ void Clipboard::ReadBookmark(base::string16* title, std::string* url) const { if (title) { NSString* contents = [pb stringForType:kUTTypeURLName]; - UTF8ToUTF16([contents UTF8String], - [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], - title); + *title = base::SysNSStringToUTF16(contents); } if (url) { diff --git a/ui/base/clipboard/clipboard_unittest.cc b/ui/base/clipboard/clipboard_unittest.cc index 0325b75..5ddec42 100644 --- a/ui/base/clipboard/clipboard_unittest.cc +++ b/ui/base/clipboard/clipboard_unittest.cc @@ -31,6 +31,10 @@ #include "base/android/jni_string.h" #endif +using base::ASCIIToUTF16; +using base::UTF8ToUTF16; +using base::UTF16ToUTF8; + namespace ui { class ClipboardTest : public PlatformTest { diff --git a/ui/base/clipboard/clipboard_util_win.cc b/ui/base/clipboard/clipboard_util_win.cc index 0321a96..cc5a0ee 100644 --- a/ui/base/clipboard/clipboard_util_win.cc +++ b/ui/base/clipboard/clipboard_util_win.cc @@ -119,7 +119,7 @@ bool GetFileUrl(IDataObject* data_object, base::string16* url, DWORD file_url_len = arraysize(file_url); if (SUCCEEDED(::UrlCreateFromPathA(data.get(), file_url, &file_url_len, 0))) { - url->assign(UTF8ToWide(file_url)); + url->assign(base::UTF8ToWide(file_url)); title->assign(*url); success = true; } @@ -191,7 +191,7 @@ bool ClipboardUtil::GetUrl(IDataObject* data_object, { // URL using ascii base::win::ScopedHGlobal<char> data(store.hGlobal); - SplitUrlAndTitle(UTF8ToWide(data.get()), url, title); + SplitUrlAndTitle(base::UTF8ToWide(data.get()), url, title); } ReleaseStgMedium(&store); return true; @@ -255,7 +255,7 @@ bool ClipboardUtil::GetPlainText(IDataObject* data_object, { // ascii text base::win::ScopedHGlobal<char> data(store.hGlobal); - plain_text->assign(UTF8ToWide(data.get())); + plain_text->assign(base::UTF8ToWide(data.get())); } ReleaseStgMedium(&store); return true; @@ -280,7 +280,7 @@ bool ClipboardUtil::GetHtml(IDataObject* data_object, std::string html_utf8; CFHtmlToHtml(std::string(data.get(), data.Size()), &html_utf8, base_url); - html->assign(UTF8ToWide(html_utf8)); + html->assign(base::UTF8ToWide(html_utf8)); } ReleaseStgMedium(&store); return true; diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc index b2f6e0c..fff7502 100644 --- a/ui/base/clipboard/clipboard_win.cc +++ b/ui/base/clipboard/clipboard_win.cc @@ -228,7 +228,7 @@ void Clipboard::WriteObjects(ClipboardType type, const ObjectMap& objects) { void Clipboard::WriteText(const char* text_data, size_t text_len) { base::string16 text; - UTF8ToUTF16(text_data, text_len, &text); + base::UTF8ToUTF16(text_data, text_len, &text); HGLOBAL glob = CreateGlobalData(text); WriteToClipboard(CF_UNICODETEXT, glob); @@ -262,7 +262,7 @@ void Clipboard::WriteBookmark(const char* title_data, bookmark.append(1, L'\n'); bookmark.append(url_data, url_len); - base::string16 wide_bookmark = UTF8ToWide(bookmark); + base::string16 wide_bookmark = base::UTF8ToWide(bookmark); HGLOBAL glob = CreateGlobalData(wide_bookmark); WriteToClipboard(GetUrlWFormatType().ToUINT(), glob); @@ -404,13 +404,13 @@ void Clipboard::ReadAvailableTypes(ClipboardType type, types->clear(); if (::IsClipboardFormatAvailable(GetPlainTextFormatType().ToUINT())) - types->push_back(UTF8ToUTF16(kMimeTypeText)); + types->push_back(base::UTF8ToUTF16(kMimeTypeText)); if (::IsClipboardFormatAvailable(GetHtmlFormatType().ToUINT())) - types->push_back(UTF8ToUTF16(kMimeTypeHTML)); + types->push_back(base::UTF8ToUTF16(kMimeTypeHTML)); if (::IsClipboardFormatAvailable(GetRtfFormatType().ToUINT())) - types->push_back(UTF8ToUTF16(kMimeTypeRTF)); + types->push_back(base::UTF8ToUTF16(kMimeTypeRTF)); if (::IsClipboardFormatAvailable(CF_DIB)) - types->push_back(UTF8ToUTF16(kMimeTypePNG)); + types->push_back(base::UTF8ToUTF16(kMimeTypePNG)); *contains_filenames = false; // Acquire the clipboard. @@ -661,7 +661,7 @@ void Clipboard::ReadData(const FormatType& format, std::string* result) const { void Clipboard::ParseBookmarkClipboardFormat(const base::string16& bookmark, base::string16* title, std::string* url) { - const base::string16 kDelim = ASCIIToUTF16("\r\n"); + const base::string16 kDelim = base::ASCIIToUTF16("\r\n"); const size_t title_end = bookmark.find_first_of(kDelim); if (title) @@ -669,8 +669,10 @@ void Clipboard::ParseBookmarkClipboardFormat(const base::string16& bookmark, if (url) { const size_t url_start = bookmark.find_first_not_of(kDelim, title_end); - if (url_start != base::string16::npos) - *url = UTF16ToUTF8(bookmark.substr(url_start, base::string16::npos)); + if (url_start != base::string16::npos) { + *url = base::UTF16ToUTF8( + bookmark.substr(url_start, base::string16::npos)); + } } } @@ -678,7 +680,7 @@ void Clipboard::ParseBookmarkClipboardFormat(const base::string16& bookmark, Clipboard::FormatType Clipboard::GetFormatType( const std::string& format_string) { return FormatType( - ::RegisterClipboardFormat(ASCIIToWide(format_string).c_str())); + ::RegisterClipboardFormat(base::ASCIIToWide(format_string).c_str())); } // static diff --git a/ui/base/clipboard/custom_data_helper_unittest.cc b/ui/base/clipboard/custom_data_helper_unittest.cc index c770445..bc79d90 100644 --- a/ui/base/clipboard/custom_data_helper_unittest.cc +++ b/ui/base/clipboard/custom_data_helper_unittest.cc @@ -10,6 +10,8 @@ #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace ui { namespace { diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc index 120832f..380b8d2 100644 --- a/ui/base/clipboard/scoped_clipboard_writer.cc +++ b/ui/base/clipboard/scoped_clipboard_writer.cc @@ -36,7 +36,7 @@ void ScopedClipboardWriter::WriteURL(const base::string16& text) { void ScopedClipboardWriter::WriteHTML(const base::string16& markup, const std::string& source_url) { - std::string utf8_markup = UTF16ToUTF8(markup); + std::string utf8_markup = base::UTF16ToUTF8(markup); Clipboard::ObjectMapParams parameters; parameters.push_back( @@ -62,7 +62,7 @@ void ScopedClipboardWriter::WriteBookmark(const base::string16& bookmark_title, if (bookmark_title.empty() || url.empty()) return; - std::string utf8_markup = UTF16ToUTF8(bookmark_title); + std::string utf8_markup = base::UTF16ToUTF8(bookmark_title); Clipboard::ObjectMapParams parameters; parameters.push_back(Clipboard::ObjectMapParam(utf8_markup.begin(), @@ -80,9 +80,9 @@ void ScopedClipboardWriter::WriteHyperlink(const base::string16& anchor_text, std::string html("<a href=\""); html.append(net::EscapeForHTML(url)); html.append("\">"); - html.append(net::EscapeForHTML(UTF16ToUTF8(anchor_text))); + html.append(net::EscapeForHTML(base::UTF16ToUTF8(anchor_text))); html.append("</a>"); - WriteHTML(UTF8ToUTF16(html), std::string()); + WriteHTML(base::UTF8ToUTF16(html), std::string()); } void ScopedClipboardWriter::WriteWebSmartPaste() { @@ -113,7 +113,7 @@ void ScopedClipboardWriter::Reset() { void ScopedClipboardWriter::WriteTextOrURL(const base::string16& text, bool is_url) { - std::string utf8_text = UTF16ToUTF8(text); + std::string utf8_text = base::UTF16ToUTF8(text); Clipboard::ObjectMapParams parameters; parameters.push_back(Clipboard::ObjectMapParam(utf8_text.begin(), diff --git a/ui/base/cocoa/menu_controller_unittest.mm b/ui/base/cocoa/menu_controller_unittest.mm index d3fa777..9e54ee8 100644 --- a/ui/base/cocoa/menu_controller_unittest.mm +++ b/ui/base/cocoa/menu_controller_unittest.mm @@ -16,6 +16,8 @@ #import "ui/base/test/ui_cocoa_test_helper.h" #include "ui/gfx/image/image.h" +using base::ASCIIToUTF16; + namespace ui { namespace { diff --git a/ui/base/dragdrop/gtk_dnd_util.cc b/ui/base/dragdrop/gtk_dnd_util.cc index 899758b..163dce4 100644 --- a/ui/base/dragdrop/gtk_dnd_util.cc +++ b/ui/base/dragdrop/gtk_dnd_util.cc @@ -159,7 +159,7 @@ void WriteURLWithName(GtkSelectionData* selection_data, if (title.empty()) { // We prefer to not have empty titles. Set it to the filename extracted // from the URL. - title = UTF8ToUTF16(url.ExtractFileName()); + title = base::UTF8ToUTF16(url.ExtractFileName()); } switch (type) { @@ -178,7 +178,7 @@ void WriteURLWithName(GtkSelectionData* selection_data, } case CHROME_NAMED_URL: { Pickle pickle; - pickle.WriteString(UTF16ToUTF8(title)); + pickle.WriteString(base::UTF16ToUTF8(title)); pickle.WriteString(url.spec()); gtk_selection_data_set( selection_data, @@ -190,7 +190,7 @@ void WriteURLWithName(GtkSelectionData* selection_data, } case NETSCAPE_URL: { // _NETSCAPE_URL format is URL + \n + title. - std::string utf8_text = url.spec() + "\n" + UTF16ToUTF8(title); + std::string utf8_text = url.spec() + "\n" + base::UTF16ToUTF8(title); gtk_selection_data_set(selection_data, gtk_selection_data_get_target(selection_data), kBitsPerByte, @@ -228,7 +228,7 @@ bool ExtractNamedURL(GtkSelectionData* selection_data, return false; *url = gurl; - *title = UTF8ToUTF16(title_utf8); + *title = base::UTF8ToUTF16(title_utf8); return true; } @@ -268,7 +268,7 @@ bool ExtractNetscapeURL(GtkSelectionData* selection_data, return false; *url = gurl; - *title = UTF8ToUTF16(data.substr(newline + 1)); + *title = base::UTF8ToUTF16(data.substr(newline + 1)); return true; } diff --git a/ui/base/dragdrop/gtk_dnd_util_unittest.cc b/ui/base/dragdrop/gtk_dnd_util_unittest.cc index 04f81ae..977b67b 100644 --- a/ui/base/dragdrop/gtk_dnd_util_unittest.cc +++ b/ui/base/dragdrop/gtk_dnd_util_unittest.cc @@ -29,7 +29,7 @@ TEST(GtkDndUtilTest, ExtractNamedURLValid) { GURL url; base::string16 title; ASSERT_EQ(true, ui::ExtractNamedURL(&data, &url, &title)); - EXPECT_EQ(UTF8ToUTF16(kTitle), title); + EXPECT_EQ(base::UTF8ToUTF16(kTitle), title); EXPECT_EQ(GURL(kUrl), url); } diff --git a/ui/base/dragdrop/os_exchange_data_provider_aura.cc b/ui/base/dragdrop/os_exchange_data_provider_aura.cc index c335120..bd1545d 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aura.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_aura.cc @@ -44,7 +44,7 @@ void OSExchangeDataProviderAura::SetURL(const GURL& url, title_ = title; formats_ |= OSExchangeData::URL; - SetString(UTF8ToUTF16(url.spec())); + SetString(base::UTF8ToUTF16(url.spec())); } void OSExchangeDataProviderAura::SetFilename(const base::FilePath& path) { diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc index 551ef3b..d0eeb6a 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc @@ -109,7 +109,7 @@ OSExchangeData::Provider* OSExchangeDataProviderAuraX11::Clone() const { } void OSExchangeDataProviderAuraX11::SetString(const base::string16& text_data) { - std::string utf8 = UTF16ToUTF8(text_data); + std::string utf8 = base::UTF16ToUTF8(text_data); scoped_refptr<base::RefCountedMemory> mem( base::RefCountedString::TakeString(&utf8)); @@ -123,11 +123,11 @@ void OSExchangeDataProviderAuraX11::SetURL(const GURL& url, const base::string16& title) { // Mozilla's URL format: (UTF16: URL, newline, title) if (url.is_valid()) { - base::string16 spec = UTF8ToUTF16(url.spec()); + base::string16 spec = base::UTF8ToUTF16(url.spec()); std::vector<unsigned char> data; ui::AddString16ToVector(spec, &data); - ui::AddString16ToVector(ASCIIToUTF16("\n"), &data); + ui::AddString16ToVector(base::ASCIIToUTF16("\n"), &data); ui::AddString16ToVector(title, &data); scoped_refptr<base::RefCountedMemory> mem( base::RefCountedBytes::TakeVector(&data)); @@ -169,7 +169,7 @@ bool OSExchangeDataProviderAuraX11::GetString(base::string16* result) const { ui::SelectionData data(format_map_.GetFirstOf(requested_types)); if (data.IsValid()) { std::string text = data.GetText(); - *result = UTF8ToUTF16(text); + *result = base::UTF8ToUTF16(text); return true; } @@ -195,7 +195,7 @@ bool OSExchangeDataProviderAuraX11::GetURLAndTitle( data.AssignTo(&unparsed); std::vector<base::string16> tokens; - size_t num_tokens = Tokenize(unparsed, ASCIIToUTF16("\n"), &tokens); + size_t num_tokens = Tokenize(unparsed, base::ASCIIToUTF16("\n"), &tokens); if (num_tokens > 0) { if (num_tokens > 1) *title = tokens[1]; diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc index 0cc8f2f0..a09198d 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc @@ -22,12 +22,12 @@ TEST(OSExchangeDataProviderAuraX11Test, MozillaURL) { ui::OSExchangeDataProviderAuraX11 provider; // Check that we can get titled entries. - provider.SetURL(GURL(kGoogleURL), ASCIIToUTF16(kGoogleTitle)); + provider.SetURL(GURL(kGoogleURL), base::ASCIIToUTF16(kGoogleTitle)); { GURL out_gurl; base::string16 out_str; EXPECT_TRUE(provider.GetURLAndTitle(&out_gurl, &out_str)); - EXPECT_EQ(ASCIIToUTF16(kGoogleTitle), out_str); + EXPECT_EQ(base::ASCIIToUTF16(kGoogleTitle), out_str); EXPECT_EQ(kGoogleURL, out_gurl.spec()); } diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.cc b/ui/base/dragdrop/os_exchange_data_provider_win.cc index 69203f0..9b16b02 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_win.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_win.cc @@ -275,7 +275,7 @@ void OSExchangeDataProviderWin::SetString(const base::string16& data) { Clipboard::GetPlainTextWFormatType().ToFormatEtc(), storage)); // Also add the UTF8-encoded version. - storage = GetStorageForString(UTF16ToUTF8(data)); + storage = GetStorageForString(base::UTF16ToUTF8(data)); data_->contents_.push_back(new DataObjectImpl::StoredDataInfo( Clipboard::GetPlainTextFormatType().ToFormatEtc(), storage)); } @@ -289,7 +289,7 @@ void OSExchangeDataProviderWin::SetURL(const GURL& url, // will fail! It assumes an insertion order. // Add text/x-moz-url for drags from Firefox - base::string16 x_moz_url_str = UTF8ToUTF16(url.spec()); + base::string16 x_moz_url_str = base::UTF8ToUTF16(url.spec()); x_moz_url_str += '\n'; x_moz_url_str += title; STGMEDIUM* storage = GetStorageForString(x_moz_url_str); @@ -304,7 +304,7 @@ void OSExchangeDataProviderWin::SetURL(const GURL& url, SetFileContents(base::FilePath(valid_file_name), shortcut_url_file_contents); // Add a UniformResourceLocator link for apps like IE and Word. - storage = GetStorageForString(UTF8ToUTF16(url.spec())); + storage = GetStorageForString(base::UTF8ToUTF16(url.spec())); data_->contents_.push_back(new DataObjectImpl::StoredDataInfo( Clipboard::GetUrlWFormatType().ToFormatEtc(), storage)); storage = GetStorageForString(url.spec()); @@ -316,7 +316,7 @@ void OSExchangeDataProviderWin::SetURL(const GURL& url, // Also add text representations (these should be last since they're the // least preferable). - SetString(UTF8ToUTF16(url.spec())); + SetString(base::UTF8ToUTF16(url.spec())); } void OSExchangeDataProviderWin::SetFilename(const base::FilePath& path) { @@ -368,7 +368,7 @@ void OSExchangeDataProviderWin::SetFileContents( void OSExchangeDataProviderWin::SetHtml(const base::string16& html, const GURL& base_url) { // Add both MS CF_HTML and text/html format. CF_HTML should be in utf-8. - std::string utf8_html = UTF16ToUTF8(html); + std::string utf8_html = base::UTF16ToUTF8(html); std::string url = base_url.is_valid() ? base_url.spec() : std::string(); std::string cf_html = ClipboardUtil::HtmlToCFHtml(utf8_html, url); diff --git a/ui/base/dragdrop/os_exchange_data_unittest.cc b/ui/base/dragdrop/os_exchange_data_unittest.cc index 81f33c8..54ac7cd 100644 --- a/ui/base/dragdrop/os_exchange_data_unittest.cc +++ b/ui/base/dragdrop/os_exchange_data_unittest.cc @@ -19,7 +19,7 @@ class OSExchangeDataTest : public PlatformTest { TEST_F(OSExchangeDataTest, StringDataGetAndSet) { OSExchangeData data; - base::string16 input = ASCIIToUTF16("I can has cheezburger?"); + base::string16 input = base::ASCIIToUTF16("I can has cheezburger?"); data.SetString(input); OSExchangeData data2(data.provider().Clone()); @@ -38,7 +38,7 @@ TEST_F(OSExchangeDataTest, TestURLExchangeFormats) { OSExchangeData data; std::string url_spec = "http://www.google.com/"; GURL url(url_spec); - base::string16 url_title = ASCIIToUTF16("www.google.com"); + base::string16 url_title = base::ASCIIToUTF16("www.google.com"); data.SetURL(url, url_title); base::string16 output; @@ -54,7 +54,7 @@ TEST_F(OSExchangeDataTest, TestURLExchangeFormats) { // URL should be the raw text response EXPECT_TRUE(data2.GetString(&output_string)); - EXPECT_EQ(url_spec, UTF16ToUTF8(output_string)); + EXPECT_EQ(url_spec, base::UTF16ToUTF8(output_string)); } TEST_F(OSExchangeDataTest, TestPickledData) { @@ -83,7 +83,7 @@ TEST_F(OSExchangeDataTest, TestPickledData) { TEST_F(OSExchangeDataTest, TestHTML) { OSExchangeData data; GURL url("http://www.google.com/"); - base::string16 html = ASCIIToUTF16( + base::string16 html = base::ASCIIToUTF16( "<HTML>\n<BODY>\n" "<b>bold.</b> <i><b>This is bold italic.</b></i>\n" "</BODY>\n</HTML>"); diff --git a/ui/base/dragdrop/os_exchange_data_win_unittest.cc b/ui/base/dragdrop/os_exchange_data_win_unittest.cc index 4202543..e73db84 100644 --- a/ui/base/dragdrop/os_exchange_data_win_unittest.cc +++ b/ui/base/dragdrop/os_exchange_data_win_unittest.cc @@ -136,7 +136,7 @@ TEST(OSExchangeDataWinTest, URLDataAccessViaCOM) { EXPECT_EQ(S_OK, com_data->GetData(&format_etc, &medium)); std::wstring output = base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get(); - EXPECT_EQ(url.spec(), WideToUTF8(output)); + EXPECT_EQ(url.spec(), base::WideToUTF8(output)); ReleaseStgMedium(&medium); } @@ -163,7 +163,7 @@ TEST(OSExchangeDataWinTest, MultipleFormatsViaCOM) { EXPECT_EQ(S_OK, com_data->GetData(&url_format_etc, &medium)); std::wstring output_url = base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get(); - EXPECT_EQ(url.spec(), WideToUTF8(output_url)); + EXPECT_EQ(url.spec(), base::WideToUTF8(output_url)); ReleaseStgMedium(&medium); // The text is supposed to be the raw text of the URL, _NOT_ the value of @@ -171,7 +171,7 @@ TEST(OSExchangeDataWinTest, MultipleFormatsViaCOM) { EXPECT_EQ(S_OK, com_data->GetData(&text_format_etc, &medium)); std::wstring output_text = base::win::ScopedHGlobal<wchar_t>(medium.hGlobal).get(); - EXPECT_EQ(url_spec, WideToUTF8(output_text)); + EXPECT_EQ(url_spec, base::WideToUTF8(output_text)); ReleaseStgMedium(&medium); } @@ -321,7 +321,7 @@ TEST(OSExchangeDataWinTest, CFHtml) { "StartFragment:0000000175\r\nEndFragment:0000000252\r\n" "SourceURL:http://www.google.com/\r\n<html>\r\n<body>\r\n" "<!--StartFragment-->"); - expected_cf_html += WideToUTF8(html); + expected_cf_html += base::WideToUTF8(html); expected_cf_html.append("<!--EndFragment-->\r\n</body>\r\n</html>"); FORMATETC format = Clipboard::GetHtmlFormatType().ToFormatEtc(); diff --git a/ui/base/ime/chromeos/character_composer.cc b/ui/base/ime/chromeos/character_composer.cc index ed1df4c..9155b73 100644 --- a/ui/base/ime/chromeos/character_composer.cc +++ b/ui/base/ime/chromeos/character_composer.cc @@ -561,7 +561,7 @@ void CharacterComposer::UpdatePreeditStringHexMode() { DCHECK(0 <= digit && digit < 16); preedit_string_ascii += digit <= 9 ? ('0' + digit) : ('a' + (digit - 10)); } - preedit_string_ = ASCIIToUTF16(preedit_string_ascii); + preedit_string_ = base::ASCIIToUTF16(preedit_string_ascii); } } // namespace ui diff --git a/ui/base/ime/chromeos/character_composer_unittest.cc b/ui/base/ime/chromeos/character_composer_unittest.cc index eb3a726..6853a1d 100644 --- a/ui/base/ime/chromeos/character_composer_unittest.cc +++ b/ui/base/ime/chromeos/character_composer_unittest.cc @@ -10,6 +10,8 @@ #include "ui/base/glib/glib_integers.h" #include "ui/events/event_constants.h" +using base::ASCIIToUTF16; + namespace ui { class CharacterComposerTest : public testing::Test { diff --git a/ui/base/ime/composition_text_util_pango.cc b/ui/base/ime/composition_text_util_pango.cc index 737380b..98dadb6 100644 --- a/ui/base/ime/composition_text_util_pango.cc +++ b/ui/base/ime/composition_text_util_pango.cc @@ -19,7 +19,7 @@ void ExtractCompositionTextFromGtkPreedit(const gchar* utf8_text, int cursor_position, CompositionText* composition) { composition->Clear(); - composition->text = UTF8ToUTF16(utf8_text); + composition->text = base::UTF8ToUTF16(utf8_text); if (composition->text.empty()) return; diff --git a/ui/base/ime/input_method_ibus.cc b/ui/base/ime/input_method_ibus.cc index 0639641..3c55501 100644 --- a/ui/base/ime/input_method_ibus.cc +++ b/ui/base/ime/input_method_ibus.cc @@ -205,7 +205,7 @@ void InputMethodIBus::OnCaretBoundsChanged(const TextInputClient* client) { // |surrounding_text| coordinates. if (!GetEngine()) return; - GetEngine()->SetSurroundingText(UTF16ToUTF8(surrounding_text), + GetEngine()->SetSurroundingText(base::UTF16ToUTF8(surrounding_text), selection_range.start() - text_range.start(), selection_range.end() - text_range.start()); } @@ -464,7 +464,7 @@ void InputMethodIBus::CommitText(const std::string& text) { if (!GetTextInputClient()) return; - const base::string16 utf16_text = UTF8ToUTF16(text); + const base::string16 utf16_text = base::UTF8ToUTF16(text); if (utf16_text.empty()) return; @@ -552,11 +552,11 @@ bool InputMethodIBus::ExecuteCharacterComposer(const ui::KeyEvent& event) { chromeos::IBusText preedit; preedit.set_text( - UTF16ToUTF8(character_composer_.preedit_string())); + base::UTF16ToUTF8(character_composer_.preedit_string())); UpdatePreeditText(preedit, preedit.text().size(), !preedit.text().empty()); std::string commit_text = - UTF16ToUTF8(character_composer_.composed_character()); + base::UTF16ToUTF8(character_composer_.composed_character()); if (!commit_text.empty()) { CommitText(commit_text); } @@ -568,7 +568,7 @@ void InputMethodIBus::ExtractCompositionText( uint32 cursor_position, CompositionText* out_composition) const { out_composition->Clear(); - out_composition->text = UTF8ToUTF16(text.text()); + out_composition->text = base::UTF8ToUTF16(text.text()); if (out_composition->text.empty()) return; diff --git a/ui/base/ime/input_method_ibus_unittest.cc b/ui/base/ime/input_method_ibus_unittest.cc index 49e5a40..2c204f9 100644 --- a/ui/base/ime/input_method_ibus_unittest.cc +++ b/ui/base/ime/input_method_ibus_unittest.cc @@ -26,6 +26,9 @@ #include "ui/events/test/events_test_utils_x11.h" #include "ui/gfx/rect.h" +using base::UTF8ToUTF16; +using base::UTF16ToUTF8; + namespace ui { namespace { typedef chromeos::IBusEngineHandlerInterface::KeyEventDoneCallback diff --git a/ui/base/ime/remote_input_method_win.cc b/ui/base/ime/remote_input_method_win.cc index f11d735..fd86059 100644 --- a/ui/base/ime/remote_input_method_win.cc +++ b/ui/base/ime/remote_input_method_win.cc @@ -61,7 +61,7 @@ std::string GetLocaleString(LCID Locale_id, LCTYPE locale_type) { if (chars_written <= 1 || arraysize(buffer) < chars_written) return std::string(); std::string result; - WideToUTF8(buffer, chars_written - 1, &result); + base::WideToUTF8(buffer, chars_written - 1, &result); return result; } diff --git a/ui/base/ime/win/imm32_manager.cc b/ui/base/ime/win/imm32_manager.cc index 01eb18c..6cb0a32 100644 --- a/ui/base/ime/win/imm32_manager.cc +++ b/ui/base/ime/win/imm32_manager.cc @@ -487,7 +487,7 @@ std::string IMM32Manager::GetInputLanguageName() const { return std::string(); std::string language; - WideToUTF8(buffer, length - 1, &language); + base::WideToUTF8(buffer, length - 1, &language); if (SUBLANGID(input_language_id_) == SUBLANG_NEUTRAL) return language; @@ -498,7 +498,7 @@ std::string IMM32Manager::GetInputLanguageName() const { return language; std::string region; - WideToUTF8(buffer, length - 1, ®ion); + base::WideToUTF8(buffer, length - 1, ®ion); return language.append(1, '-').append(region); } diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc index b610e96..d3fb160 100644 --- a/ui/base/l10n/l10n_util.cc +++ b/ui/base/l10n/l10n_util.cc @@ -225,7 +225,7 @@ bool IsLocalePartiallyPopulated(const std::string& locale_name) { bool IsLocaleAvailable(const std::string& locale) { // If locale has any illegal characters in it, we don't want to try to // load it because it may be pointing outside the locale data file directory. - if (!file_util::IsFilenameLegal(ASCIIToUTF16(locale))) + if (!file_util::IsFilenameLegal(base::ASCIIToUTF16(locale))) return false; // IsLocalePartiallyPopulated() can be called here for an early return w/o @@ -661,7 +661,7 @@ bool IsValidLocaleSyntax(const std::string& locale) { } std::string GetStringUTF8(int message_id) { - return UTF16ToUTF8(GetStringUTF16(message_id)); + return base::UTF16ToUTF8(GetStringUTF16(message_id)); } base::string16 GetStringUTF16(int message_id) { @@ -688,7 +688,7 @@ base::string16 GetStringFUTF16(int message_id, // check as the code may simply want to find the placeholders rather than // actually replacing them. if (!offsets) { - std::string utf8_string = UTF16ToUTF8(format_string); + std::string utf8_string = base::UTF16ToUTF8(format_string); // $9 is the highest allowed placeholder. for (size_t i = 0; i < 9; ++i) { @@ -719,20 +719,20 @@ base::string16 GetStringFUTF16(int message_id, std::string GetStringFUTF8(int message_id, const base::string16& a) { - return UTF16ToUTF8(GetStringFUTF16(message_id, a)); + return base::UTF16ToUTF8(GetStringFUTF16(message_id, a)); } std::string GetStringFUTF8(int message_id, const base::string16& a, const base::string16& b) { - return UTF16ToUTF8(GetStringFUTF16(message_id, a, b)); + return base::UTF16ToUTF8(GetStringFUTF16(message_id, a, b)); } std::string GetStringFUTF8(int message_id, const base::string16& a, const base::string16& b, const base::string16& c) { - return UTF16ToUTF8(GetStringFUTF16(message_id, a, b, c)); + return base::UTF16ToUTF8(GetStringFUTF16(message_id, a, b, c)); } std::string GetStringFUTF8(int message_id, @@ -740,7 +740,7 @@ std::string GetStringFUTF8(int message_id, const base::string16& b, const base::string16& c, const base::string16& d) { - return UTF16ToUTF8(GetStringFUTF16(message_id, a, b, c, d)); + return base::UTF16ToUTF8(GetStringFUTF16(message_id, a, b, c, d)); } base::string16 GetStringFUTF16(int message_id, @@ -819,11 +819,11 @@ base::string16 GetStringFUTF16(int message_id, } base::string16 GetStringFUTF16Int(int message_id, int a) { - return GetStringFUTF16(message_id, UTF8ToUTF16(base::IntToString(a))); + return GetStringFUTF16(message_id, base::UTF8ToUTF16(base::IntToString(a))); } base::string16 GetStringFUTF16Int(int message_id, int64 a) { - return GetStringFUTF16(message_id, UTF8ToUTF16(base::Int64ToString(a))); + return GetStringFUTF16(message_id, base::UTF8ToUTF16(base::Int64ToString(a))); } // Specialization of operator() method for base::string16 version. diff --git a/ui/base/l10n/l10n_util_unittest.cc b/ui/base/l10n/l10n_util_unittest.cc index ef530fa..a19563b 100644 --- a/ui/base/l10n/l10n_util_unittest.cc +++ b/ui/base/l10n/l10n_util_unittest.cc @@ -33,6 +33,9 @@ #include "ui/base/test/data/resource.h" #endif +using base::ASCIIToUTF16; +using base::UTF8ToUTF16; + namespace { class StringWrapper { diff --git a/ui/base/l10n/time_format_unittest.cc b/ui/base/l10n/time_format_unittest.cc index 483538f..6f6acc4 100644 --- a/ui/base/l10n/time_format_unittest.cc +++ b/ui/base/l10n/time_format_unittest.cc @@ -10,6 +10,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/resource/resource_bundle.h" +using base::ASCIIToUTF16; + namespace ui { namespace { diff --git a/ui/base/models/tree_node_model_unittest.cc b/ui/base/models/tree_node_model_unittest.cc index 48f71b9..d9d387c 100644 --- a/ui/base/models/tree_node_model_unittest.cc +++ b/ui/base/models/tree_node_model_unittest.cc @@ -12,6 +12,8 @@ #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace ui { class TreeNodeModelTest : public testing::Test, public TreeModelObserver { diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc index b5f8f61..22f191c 100644 --- a/ui/base/resource/resource_bundle.cc +++ b/ui/base/resource/resource_bundle.cc @@ -481,7 +481,7 @@ base::string16 ResourceBundle::GetLocalizedString(int message_id) { msg = base::string16(reinterpret_cast<const base::char16*>(data.data()), data.length() / 2); } else if (encoding == ResourceHandle::UTF8) { - msg = UTF8ToUTF16(data); + msg = base::UTF8ToUTF16(data); } return msg; } diff --git a/ui/base/resource/resource_bundle_unittest.cc b/ui/base/resource/resource_bundle_unittest.cc index 28c5b02..4213507 100644 --- a/ui/base/resource/resource_bundle_unittest.cc +++ b/ui/base/resource/resource_bundle_unittest.cc @@ -298,7 +298,7 @@ TEST_F(ResourceBundleTest, DelegateGetLocalizedString) { MockResourceBundleDelegate delegate; ResourceBundle* resource_bundle = CreateResourceBundle(&delegate); - base::string16 data = ASCIIToUTF16("My test data"); + base::string16 data = base::ASCIIToUTF16("My test data"); int resource_id = 5; EXPECT_CALL(delegate, GetLocalizedStringMock(resource_id)) diff --git a/ui/base/resource/resource_bundle_win.cc b/ui/base/resource/resource_bundle_win.cc index cb99e20..df058e6 100644 --- a/ui/base/resource/resource_bundle_win.cc +++ b/ui/base/resource/resource_bundle_win.cc @@ -30,7 +30,7 @@ base::FilePath GetResourcesPakFilePath(const std::string& pak_name) { return path.AppendASCII(pak_name.c_str()); // Return just the name of the pack file. - return base::FilePath(ASCIIToUTF16(pak_name)); + return base::FilePath(base::ASCIIToUTF16(pak_name)); } } // namespace diff --git a/ui/base/text/bytes_formatting_unittest.cc b/ui/base/text/bytes_formatting_unittest.cc index 357abc7..b2a03f9 100644 --- a/ui/base/text/bytes_formatting_unittest.cc +++ b/ui/base/text/bytes_formatting_unittest.cc @@ -69,9 +69,9 @@ TEST(BytesFormattingTest, FormatBytes) { }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { - EXPECT_EQ(ASCIIToUTF16(cases[i].expected), + EXPECT_EQ(base::ASCIIToUTF16(cases[i].expected), FormatBytesWithUnits(cases[i].bytes, cases[i].units, false)); - EXPECT_EQ(ASCIIToUTF16(cases[i].expected_with_units), + EXPECT_EQ(base::ASCIIToUTF16(cases[i].expected_with_units), FormatBytesWithUnits(cases[i].bytes, cases[i].units, true)); } } diff --git a/ui/base/x/selection_utils.cc b/ui/base/x/selection_utils.cc index 138745b..5b501ec 100644 --- a/ui/base/x/selection_utils.cc +++ b/ui/base/x/selection_utils.cc @@ -205,7 +205,7 @@ base::string16 SelectionData::GetHtml() const { markup.assign(reinterpret_cast<const uint16_t*>(data) + 1, (size / 2) - 1); } else { - UTF8ToUTF16(reinterpret_cast<const char*>(data), size, &markup); + base::UTF8ToUTF16(reinterpret_cast<const char*>(data), size, &markup); } // If there is a terminating NULL, drop it. diff --git a/ui/compositor/debug_utils.cc b/ui/compositor/debug_utils.cc index e1f62f9..a809e18 100644 --- a/ui/compositor/debug_utils.cc +++ b/ui/compositor/debug_utils.cc @@ -19,6 +19,8 @@ #include "ui/gfx/point_conversions.h" #include "ui/gfx/transform.h" +using base::UTF8ToWide; + namespace ui { namespace { diff --git a/ui/events/keycodes/keyboard_code_conversion_x.cc b/ui/events/keycodes/keyboard_code_conversion_x.cc index 821f8c4..89f7ac8 100644 --- a/ui/events/keycodes/keyboard_code_conversion_x.cc +++ b/ui/events/keycodes/keyboard_code_conversion_x.cc @@ -451,7 +451,7 @@ uint16 GetCharacterFromXEvent(XEvent* xev) { DCHECK_LE(bytes_written, 6); base::string16 result; - return (bytes_written > 0 && UTF8ToUTF16(buf, bytes_written, &result) && + return (bytes_written > 0 && base::UTF8ToUTF16(buf, bytes_written, &result) && result.length() == 1) ? result[0] : 0; } diff --git a/ui/gfx/canvas_unittest.cc b/ui/gfx/canvas_unittest.cc index 21b9f51..baac0ab5 100644 --- a/ui/gfx/canvas_unittest.cc +++ b/ui/gfx/canvas_unittest.cc @@ -14,11 +14,11 @@ namespace gfx { class CanvasTest : public testing::Test { protected: int GetStringWidth(const char *text) { - return Canvas::GetStringWidth(UTF8ToUTF16(text), font_); + return Canvas::GetStringWidth(base::UTF8ToUTF16(text), font_); } gfx::Size SizeStringInt(const char *text, int width, int line_height) { - base::string16 text16 = UTF8ToUTF16(text); + base::string16 text16 = base::UTF8ToUTF16(text); int height = 0; int flags = (text16.find('\n') != base::string16::npos) ? Canvas::MULTI_LINE : 0; diff --git a/ui/gfx/font_fallback_win.cc b/ui/gfx/font_fallback_win.cc index 40666ee..ab363e4 100644 --- a/ui/gfx/font_fallback_win.cc +++ b/ui/gfx/font_fallback_win.cc @@ -24,8 +24,9 @@ void QueryFontsFromRegistry(std::map<std::string, std::string>* map) { base::win::RegistryValueIterator it(HKEY_LOCAL_MACHINE, kFonts); for (; it.Valid(); ++it) { - const std::string filename = StringToLowerASCII(WideToUTF8(it.Value())); - (*map)[filename] = WideToUTF8(it.Name()); + const std::string filename = + StringToLowerASCII(base::WideToUTF8(it.Value())); + (*map)[filename] = base::WideToUTF8(it.Name()); } } @@ -69,7 +70,7 @@ void QueryLinkedFontsFromRegistry(const Font& font, if (FAILED(key.Open(HKEY_LOCAL_MACHINE, kSystemLink, KEY_READ))) return; - const std::wstring original_font_name = UTF8ToWide(font.GetFontName()); + const std::wstring original_font_name = base::UTF8ToWide(font.GetFontName()); std::vector<std::wstring> values; if (FAILED(key.ReadValues(original_font_name.c_str(), &values))) { key.Close(); @@ -79,7 +80,8 @@ void QueryLinkedFontsFromRegistry(const Font& font, std::string filename; std::string font_name; for (size_t i = 0; i < values.size(); ++i) { - internal::ParseFontLinkEntry(WideToUTF8(values[i]), &filename, &font_name); + internal::ParseFontLinkEntry( + base::WideToUTF8(values[i]), &filename, &font_name); // If the font name is present, add that directly, otherwise add the // font names corresponding to the filename. if (!font_name.empty()) { diff --git a/ui/gfx/font_unittest.cc b/ui/gfx/font_unittest.cc index 720340b..32216d6 100644 --- a/ui/gfx/font_unittest.cc +++ b/ui/gfx/font_unittest.cc @@ -15,6 +15,8 @@ #include "ui/gfx/platform_font_win.h" #endif +using base::ASCIIToUTF16; + namespace gfx { namespace { diff --git a/ui/gfx/pango_util.cc b/ui/gfx/pango_util.cc index 1f8ac26..3716cf1 100644 --- a/ui/gfx/pango_util.cc +++ b/ui/gfx/pango_util.cc @@ -211,7 +211,7 @@ static void SetupPangoLayoutWithoutFont( // Set text and accelerator character if needed. if (flags & Canvas::SHOW_PREFIX) { // Escape the text string to be used as markup. - std::string utf8 = UTF16ToUTF8(text); + std::string utf8 = base::UTF16ToUTF8(text); gchar* escaped_text = g_markup_escape_text(utf8.c_str(), utf8.size()); pango_layout_set_markup_with_accel(layout, escaped_text, @@ -229,9 +229,9 @@ static void SetupPangoLayoutWithoutFont( RemoveAcceleratorChar(text, static_cast<base::char16>(kAcceleratorChar), NULL, NULL); - utf8 = UTF16ToUTF8(accelerator_removed); + utf8 = base::UTF16ToUTF8(accelerator_removed); } else { - utf8 = UTF16ToUTF8(text); + utf8 = base::UTF16ToUTF8(text); } pango_layout_set_text(layout, utf8.data(), utf8.size()); diff --git a/ui/gfx/platform_font_pango.cc b/ui/gfx/platform_font_pango.cc index bae1a4b..a4c6f89 100644 --- a/ui/gfx/platform_font_pango.cc +++ b/ui/gfx/platform_font_pango.cc @@ -392,8 +392,8 @@ void PlatformFontPango::InitPangoMetrics() { // Yes, this is how Microsoft recommends calculating the dialog unit // conversions. - const int text_width_pixels = GetStringWidth( - ASCIIToUTF16("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); + const int text_width_pixels = GetStringWidth(base::ASCIIToUTF16( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); const double dialog_units_pixels = (text_width_pixels / 26 + 1) / 2; average_width_pixels_ = std::min(pango_width_pixels, dialog_units_pixels); } diff --git a/ui/gfx/platform_font_win.cc b/ui/gfx/platform_font_win.cc index 0209be6..5f9a137 100644 --- a/ui/gfx/platform_font_win.cc +++ b/ui/gfx/platform_font_win.cc @@ -211,7 +211,7 @@ void PlatformFontWin::InitWithCopyOfHFONT(HFONT hfont) { void PlatformFontWin::InitWithFontNameAndSize(const std::string& font_name, int font_size) { HFONT hf = ::CreateFont(-font_size, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - UTF8ToUTF16(font_name).c_str()); + base::UTF8ToUTF16(font_name).c_str()); font_ref_ = CreateHFontRef(hf); } @@ -289,7 +289,7 @@ PlatformFontWin::HFontRef::HFontRef(HFONT hfont, LOGFONT font_info; GetObject(hfont_, sizeof(LOGFONT), &font_info); - font_name_ = UTF16ToUTF8(base::string16(font_info.lfFaceName)); + font_name_ = base::UTF16ToUTF8(base::string16(font_info.lfFaceName)); if (font_info.lfHeight < 0) requested_font_size_ = -font_info.lfHeight; } diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc index c8c50d4..cfa5fe6 100644 --- a/ui/gfx/render_text_unittest.cc +++ b/ui/gfx/render_text_unittest.cc @@ -28,6 +28,9 @@ #include <gtk/gtk.h> #endif +using base::ASCIIToUTF16; +using base::WideToUTF16; + namespace gfx { namespace { diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc index 4afbc7f..881c8b6 100644 --- a/ui/gfx/render_text_win.cc +++ b/ui/gfx/render_text_win.cc @@ -86,7 +86,8 @@ bool ChooseFallbackFont(HDC hdc, log_font.lfFaceName[0] = 0; EnumEnhMetaFile(0, meta_file, MetaFileEnumProc, &log_font, NULL); if (log_font.lfFaceName[0]) { - *result = Font(UTF16ToUTF8(log_font.lfFaceName), font.GetFontSize()); + *result = Font(base::UTF16ToUTF8(log_font.lfFaceName), + font.GetFontSize()); found_fallback = true; } } diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc index 5413c9f..2a03d65 100644 --- a/ui/gfx/screen_win.cc +++ b/ui/gfx/screen_win.cc @@ -25,7 +25,8 @@ MONITORINFOEX GetMonitorInfoForMonitor(HMONITOR monitor) { gfx::Display GetDisplay(MONITORINFOEX& monitor_info) { // TODO(oshima): Implement Observer. - int64 id = static_cast<int64>(base::Hash(WideToUTF8(monitor_info.szDevice))); + int64 id = static_cast<int64>( + base::Hash(base::WideToUTF8(monitor_info.szDevice))); gfx::Rect bounds = gfx::Rect(monitor_info.rcMonitor); gfx::Display display(id, bounds); display.set_work_area(gfx::Rect(monitor_info.rcWork)); diff --git a/ui/gfx/text_elider.cc b/ui/gfx/text_elider.cc index 0fa8388..74f6770 100644 --- a/ui/gfx/text_elider.cc +++ b/ui/gfx/text_elider.cc @@ -30,6 +30,10 @@ #include "ui/gfx/text_utils.h" #include "url/gurl.h" +using base::ASCIIToUTF16; +using base::UTF8ToUTF16; +using base::WideToUTF16; + namespace gfx { // U+2026 in utf8 diff --git a/ui/gfx/text_elider_unittest.cc b/ui/gfx/text_elider_unittest.cc index a97d764..e8a5aab 100644 --- a/ui/gfx/text_elider_unittest.cc +++ b/ui/gfx/text_elider_unittest.cc @@ -17,6 +17,11 @@ #include "ui/gfx/text_utils.h" #include "url/gurl.h" +using base::ASCIIToUTF16; +using base::UTF16ToUTF8; +using base::UTF8ToUTF16; +using base::WideToUTF16; + namespace gfx { namespace { diff --git a/ui/gfx/text_utils_unittest.cc b/ui/gfx/text_utils_unittest.cc index 1090b38..083f423 100644 --- a/ui/gfx/text_utils_unittest.cc +++ b/ui/gfx/text_utils_unittest.cc @@ -48,11 +48,12 @@ TEST(TextUtilsTest, RemoveAcceleratorChar) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { int accelerated_char_pos; int accelerated_char_span; - base::string16 result = RemoveAcceleratorChar(UTF8ToUTF16(cases[i].input), - kAcceleratorChar, - &accelerated_char_pos, - &accelerated_char_span); - EXPECT_EQ(result, UTF8ToUTF16(cases[i].output)); + base::string16 result = RemoveAcceleratorChar( + base::UTF8ToUTF16(cases[i].input), + kAcceleratorChar, + &accelerated_char_pos, + &accelerated_char_span); + EXPECT_EQ(result, base::UTF8ToUTF16(cases[i].output)); EXPECT_EQ(accelerated_char_pos, cases[i].accelerated_char_pos); EXPECT_EQ(accelerated_char_span, cases[i].accelerated_char_span); } diff --git a/ui/message_center/cocoa/notification_controller.mm b/ui/message_center/cocoa/notification_controller.mm index 574887f..f6b0dbe 100644 --- a/ui/message_center/cocoa/notification_controller.mm +++ b/ui/message_center/cocoa/notification_controller.mm @@ -744,7 +744,8 @@ if (wrapped.size() > lines) { // Add an ellipsis to the last line. If this ellipsis makes the last line // too wide, that line will be further elided by the gfx::ElideText below. - base::string16 last = wrapped[lines - 1] + UTF8ToUTF16(gfx::kEllipsis); + base::string16 last = + wrapped[lines - 1] + base::UTF8ToUTF16(gfx::kEllipsis); if (gfx::GetStringWidth(last, font_list) > width) last = gfx::ElideText(last, font_list, width, gfx::ELIDE_AT_END); wrapped.resize(lines - 1); diff --git a/ui/message_center/cocoa/notification_controller_unittest.mm b/ui/message_center/cocoa/notification_controller_unittest.mm index 57726ab..59046aa 100644 --- a/ui/message_center/cocoa/notification_controller_unittest.mm +++ b/ui/message_center/cocoa/notification_controller_unittest.mm @@ -16,6 +16,9 @@ #include "ui/message_center/notification.h" #include "ui/message_center/notification_types.h" +using base::ASCIIToUTF16; +using base::UTF8ToUTF16; + namespace { class MockMessageCenter : public message_center::FakeMessageCenter { diff --git a/ui/message_center/cocoa/popup_collection_unittest.mm b/ui/message_center/cocoa/popup_collection_unittest.mm index 8ea2ff1..63498a2 100644 --- a/ui/message_center/cocoa/popup_collection_unittest.mm +++ b/ui/message_center/cocoa/popup_collection_unittest.mm @@ -17,6 +17,8 @@ #include "ui/message_center/message_center_style.h" #include "ui/message_center/notification.h" +using base::ASCIIToUTF16; + namespace message_center { class PopupCollectionTest : public ui::CocoaTest { diff --git a/ui/message_center/cocoa/popup_controller_unittest.mm b/ui/message_center/cocoa/popup_controller_unittest.mm index 33a6e43..80d9768 100644 --- a/ui/message_center/cocoa/popup_controller_unittest.mm +++ b/ui/message_center/cocoa/popup_controller_unittest.mm @@ -11,6 +11,8 @@ #import "ui/base/test/ui_cocoa_test_helper.h" #include "ui/message_center/notification.h" +using base::ASCIIToUTF16; + namespace message_center { class PopupControllerTest : public ui::CocoaTest { diff --git a/ui/message_center/cocoa/tray_view_controller_unittest.mm b/ui/message_center/cocoa/tray_view_controller_unittest.mm index c3dd79a..6977ece 100644 --- a/ui/message_center/cocoa/tray_view_controller_unittest.mm +++ b/ui/message_center/cocoa/tray_view_controller_unittest.mm @@ -16,6 +16,8 @@ #include "ui/message_center/notification.h" #include "ui/message_center/notifier_settings.h" +using base::ASCIIToUTF16; + namespace message_center { class TrayViewControllerTest : public ui::CocoaTest { diff --git a/ui/message_center/fake_notifier_settings_provider.cc b/ui/message_center/fake_notifier_settings_provider.cc index c25f7a2..79c153a 100644 --- a/ui/message_center/fake_notifier_settings_provider.cc +++ b/ui/message_center/fake_notifier_settings_provider.cc @@ -27,8 +27,8 @@ FakeNotifierSettingsProvider::FakeNotifierSettingsProvider( notifier_settings_requested_count_(0u) { NotifierGroupItem item; item.group = new NotifierGroup(gfx::Image(), - UTF8ToUTF16("Fake name"), - UTF8ToUTF16("fake@email.com"), + base::UTF8ToUTF16("Fake name"), + base::UTF8ToUTF16("fake@email.com"), true); item.notifiers = notifiers; items_.push_back(item); diff --git a/ui/message_center/message_center_impl_unittest.cc b/ui/message_center/message_center_impl_unittest.cc index b26c446..e97c6f8 100644 --- a/ui/message_center/message_center_impl_unittest.cc +++ b/ui/message_center/message_center_impl_unittest.cc @@ -16,6 +16,8 @@ #include "ui/message_center/notification_blocker.h" #include "ui/message_center/notification_types.h" +using base::UTF8ToUTF16; + namespace message_center { namespace { diff --git a/ui/message_center/message_center_tray_unittest.cc b/ui/message_center/message_center_tray_unittest.cc index 2291e4b..c06cb2d 100644 --- a/ui/message_center/message_center_tray_unittest.cc +++ b/ui/message_center/message_center_tray_unittest.cc @@ -10,6 +10,8 @@ #include "ui/message_center/message_center.h" #include "ui/message_center/notification_types.h" +using base::ASCIIToUTF16; + namespace message_center { namespace { diff --git a/ui/message_center/notification_list_unittest.cc b/ui/message_center/notification_list_unittest.cc index 10c843f..7b27eb3 100644 --- a/ui/message_center/notification_list_unittest.cc +++ b/ui/message_center/notification_list_unittest.cc @@ -15,6 +15,8 @@ #include "ui/message_center/notification_types.h" #include "ui/message_center/notifier_settings.h" +using base::UTF8ToUTF16; + namespace message_center { class NotificationListTest : public testing::Test { diff --git a/ui/message_center/views/bounded_label.cc b/ui/message_center/views/bounded_label.cc index 0c67b7d..3f94701 100644 --- a/ui/message_center/views/bounded_label.cc +++ b/ui/message_center/views/bounded_label.cc @@ -142,7 +142,8 @@ std::vector<base::string16> InnerBoundedLabel::GetWrappedText(int width, // characters to avoid the http://crbug.com/237700 infinite loop. // TODO(dharcourt): Remove when http://crbug.com/237700 is fixed. width = std::max(width, - 2 * gfx::GetStringWidth(UTF8ToUTF16("W"), font_list())); + 2 * gfx::GetStringWidth(base::UTF8ToUTF16("W"), + font_list())); // Wrap, using INT_MAX for -1 widths that indicate no wrapping. std::vector<base::string16> wrapped; @@ -155,7 +156,8 @@ std::vector<base::string16> InnerBoundedLabel::GetWrappedText(int width, // Add an ellipsis to the last line. If this ellipsis makes the last line // too wide, that line will be further elided by the gfx::ElideText below, // so for example "ABC" could become "ABC..." and then "AB...". - base::string16 last = wrapped[lines - 1] + UTF8ToUTF16(gfx::kEllipsis); + base::string16 last = + wrapped[lines - 1] + base::UTF8ToUTF16(gfx::kEllipsis); if (width > 0 && gfx::GetStringWidth(last, font_list()) > width) last = gfx::ElideText(last, font_list(), width, gfx::ELIDE_AT_END); wrapped.resize(lines - 1); diff --git a/ui/message_center/views/bounded_label_unittest.cc b/ui/message_center/views/bounded_label_unittest.cc index 3761b9f..90452e2 100644 --- a/ui/message_center/views/bounded_label_unittest.cc +++ b/ui/message_center/views/bounded_label_unittest.cc @@ -23,9 +23,9 @@ namespace test { class BoundedLabelTest : public testing::Test { public: BoundedLabelTest() { - digit_pixels_ = gfx::GetStringWidth(UTF8ToUTF16("0"), font_list_); - space_pixels_ = gfx::GetStringWidth(UTF8ToUTF16(" "), font_list_); - ellipsis_pixels_ = gfx::GetStringWidth(UTF8ToUTF16("\xE2\x80\xA6"), + digit_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("0"), font_list_); + space_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16(" "), font_list_); + ellipsis_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("\xE2\x80\xA6"), font_list_); } @@ -36,9 +36,9 @@ class BoundedLabelTest : public testing::Test { // with the results. This allows test strings to be specified as ASCII const // char* strings, making tests more readable and easier to write. base::string16 ToString(const char* string) { - const base::string16 periods = UTF8ToUTF16("..."); - const base::string16 ellipses = UTF8ToUTF16("\xE2\x80\xA6"); - base::string16 result = UTF8ToUTF16(string); + const base::string16 periods = base::UTF8ToUTF16("..."); + const base::string16 ellipses = base::UTF8ToUTF16("\xE2\x80\xA6"); + base::string16 result = base::UTF8ToUTF16(string); ReplaceSubstringsAfterOffset(&result, 0, periods, ellipses); return result; } diff --git a/ui/message_center/views/message_center_view_unittest.cc b/ui/message_center/views/message_center_view_unittest.cc index 1a4ad9f..502b62d 100644 --- a/ui/message_center/views/message_center_view_unittest.cc +++ b/ui/message_center/views/message_center_view_unittest.cc @@ -136,10 +136,10 @@ void MessageCenterViewTest::SetUp() { // Create a dummy notification. Notification notification(NOTIFICATION_TYPE_SIMPLE, std::string("notification id"), - UTF8ToUTF16("title"), - UTF8ToUTF16("message"), + base::UTF8ToUTF16("title"), + base::UTF8ToUTF16("message"), gfx::Image(), - UTF8ToUTF16("display source"), + base::UTF8ToUTF16("display source"), NotifierId(NotifierId::APPLICATION, "extension_id"), message_center::RichNotificationData(), NULL); @@ -240,7 +240,7 @@ void MessageCenterViewTest::RegisterCall(CallType type) { void MessageCenterViewTest::LogBounds(int depth, views::View* view) { base::string16 inset; for (int i = 0; i < depth; ++i) - inset.append(UTF8ToUTF16(" ")); + inset.append(base::UTF8ToUTF16(" ")); gfx::Rect bounds = view->bounds(); DVLOG(0) << inset << bounds.width() << " x " << bounds.height() << " @ " << bounds.x() << ", " << bounds.y(); diff --git a/ui/message_center/views/message_popup_collection_unittest.cc b/ui/message_center/views/message_popup_collection_unittest.cc index 9b244276..eacc680 100644 --- a/ui/message_center/views/message_popup_collection_unittest.cc +++ b/ui/message_center/views/message_popup_collection_unittest.cc @@ -87,8 +87,8 @@ class MessagePopupCollectionTest : public views::ViewsTestBase { scoped_ptr<Notification> notification( new Notification(NOTIFICATION_TYPE_BASE_FORMAT, id, - UTF8ToUTF16("test title"), - UTF8ToUTF16("test message"), + base::UTF8ToUTF16("test title"), + base::UTF8ToUTF16("test message"), gfx::Image(), base::string16() /* display_source */, NotifierId(), diff --git a/ui/oak/oak_aura_window_display.cc b/ui/oak/oak_aura_window_display.cc index c78d0cd..51e83c4 100644 --- a/ui/oak/oak_aura_window_display.cc +++ b/ui/oak/oak_aura_window_display.cc @@ -68,7 +68,7 @@ base::string16 PropertyWithWindowType(int type) { NOTREACHED(); break; } - return ASCIIToUTF16(property); + return base::ASCIIToUTF16(property); } } // namespace @@ -110,9 +110,9 @@ base::string16 OakAuraWindowDisplay::GetText(int row, int column_id) { case ROW_TYPE: return PropertyWithWindowType(window_->type()); case ROW_NAME: - return ASCIIToUTF16("Name: " + window_->name()); + return base::ASCIIToUTF16("Name: " + window_->name()); case ROW_TITLE: - return ASCIIToUTF16("Title: ") + window_->title(); + return base::ASCIIToUTF16("Title: ") + window_->title(); case ROW_TRANSPARENT: return PropertyWithBool("Transparent: ", window_->transparent()); case ROW_LAYER: @@ -125,7 +125,7 @@ base::string16 OakAuraWindowDisplay::GetText(int row, int column_id) { return PropertyWithBounds("Bounds in Root Window: ", window_->GetBoundsInRootWindow()); case ROW_TRANSFORM: - return ASCIIToUTF16("Transform:"); + return base::ASCIIToUTF16("Transform:"); case ROW_PARENT: return PropertyWithVoidStar("Parent: ", window_->parent()); case ROW_ROOTWINDOW: diff --git a/ui/oak/oak_pretty_print.cc b/ui/oak/oak_pretty_print.cc index 0fb7dd4..dcde03d 100644 --- a/ui/oak/oak_pretty_print.cc +++ b/ui/oak/oak_pretty_print.cc @@ -15,28 +15,28 @@ namespace oak { namespace internal { base::string16 PropertyWithInteger(const std::string& prefix, int value) { - return ASCIIToUTF16(prefix) + base::IntToString16(value); + return base::ASCIIToUTF16(prefix) + base::IntToString16(value); } base::string16 PropertyWithVoidStar(const std::string& prefix, void* ptr) { unsigned int cast_ptr = static_cast<unsigned int>(reinterpret_cast<intptr_t>(ptr)); - return ASCIIToUTF16( + return base::ASCIIToUTF16( prefix + "0x" + (ptr ? base::StringPrintf("%x", cast_ptr) : "0")); } base::string16 PropertyWithBool(const std::string& prefix, bool value) { - return ASCIIToUTF16(prefix + (value ? "true" : "false")); + return base::ASCIIToUTF16(prefix + (value ? "true" : "false")); } base::string16 PropertyWithBounds(const std::string& prefix, const gfx::Rect& bounds) { - return ASCIIToUTF16(prefix + bounds.ToString()); + return base::ASCIIToUTF16(prefix + bounds.ToString()); } base::string16 PropertyWithInsets(const std::string& prefix, const gfx::Insets& insets) { - return ASCIIToUTF16(prefix + insets.ToString()); + return base::ASCIIToUTF16(prefix + insets.ToString()); } } // namespace internal diff --git a/ui/oak/oak_tree_model.cc b/ui/oak/oak_tree_model.cc index 375c3c0..c5247c3 100644 --- a/ui/oak/oak_tree_model.cc +++ b/ui/oak/oak_tree_model.cc @@ -16,7 +16,7 @@ base::string16 GetNodeTitleForWindow(aura::Window* window) { std::string window_name = window->name(); if (window_name.empty()) window_name.append("Unnamed window"); - return ASCIIToUTF16(window_name); + return base::ASCIIToUTF16(window_name); } void AddChildWindows(aura::Window* parent_window, WindowNode* parent_node) { diff --git a/ui/oak/oak_window.cc b/ui/oak/oak_window.cc index 64c6e42..5ef6b02 100644 --- a/ui/oak/oak_window.cc +++ b/ui/oak/oak_window.cc @@ -50,7 +50,7 @@ bool OakWindow::CanMaximize() const { } base::string16 OakWindow::GetWindowTitle() const { - return ASCIIToUTF16("Oak"); + return base::ASCIIToUTF16("Oak"); } views::View* OakWindow::GetContentsView() { diff --git a/ui/shell_dialogs/gtk/select_file_dialog_impl_gtk.cc b/ui/shell_dialogs/gtk/select_file_dialog_impl_gtk.cc index ecb97dc..67f35ed 100644 --- a/ui/shell_dialogs/gtk/select_file_dialog_impl_gtk.cc +++ b/ui/shell_dialogs/gtk/select_file_dialog_impl_gtk.cc @@ -183,7 +183,7 @@ void SelectFileDialogImplGTK::SelectFileImpl( if (owning_window) parents_.insert(owning_window); - std::string title_string = UTF16ToUTF8(title); + std::string title_string = base::UTF16ToUTF8(title); file_type_index_ = file_type_index; if (file_types) @@ -262,7 +262,7 @@ void SelectFileDialogImplGTK::AddFilters(GtkFileChooser* chooser) { // The description vector may be blank, in which case we are supposed to // use some sort of default description based on the filter. if (i < file_types_.extension_description_overrides.size()) { - gtk_file_filter_set_name(filter, UTF16ToUTF8( + gtk_file_filter_set_name(filter, base::UTF16ToUTF8( file_types_.extension_description_overrides[i]).c_str()); } else { // There is no system default filter description so we use diff --git a/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc b/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc index e41c327..e0e52b5 100644 --- a/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc +++ b/ui/shell_dialogs/gtk/select_file_dialog_impl_kde.cc @@ -185,7 +185,7 @@ void SelectFileDialogImplKDE::SelectFileImpl( if (owning_window) parents_.insert(owning_window); - std::string title_string = UTF16ToUTF8(title); + std::string title_string = base::UTF16ToUTF8(title); file_type_index_ = file_type_index; if (file_types) diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/select_file_dialog_win.cc index 1f8e364..e4f0ae4 100644 --- a/ui/shell_dialogs/select_file_dialog_win.cc +++ b/ui/shell_dialogs/select_file_dialog_win.cc @@ -171,7 +171,7 @@ std::wstring FormatFilterForExtensions( include_all_files = true; desc = l10n_util::GetStringFUTF16( IDS_APP_SAVEAS_EXTENSION_FORMAT, - base::i18n::ToUpper(WideToUTF16(ext_name)), + base::i18n::ToUpper(base::WideToUTF16(ext_name)), ext_name); } if (desc.empty()) @@ -552,7 +552,7 @@ void SelectFileDialogImpl::SelectFileImpl( GetShellDialogsDelegate()->IsWindowInMetro(owning_window)) { if (type == SELECT_SAVEAS_FILE) { aura::HandleSaveFile( - UTF16ToWide(title), + base::UTF16ToWide(title), default_path, GetFilterForFileTypes(*file_types), file_type_index, @@ -564,7 +564,7 @@ void SelectFileDialogImpl::SelectFileImpl( return; } else if (type == SELECT_OPEN_FILE) { aura::HandleOpenFile( - UTF16ToWide(title), + base::UTF16ToWide(title), default_path, GetFilterForFileTypes(*file_types), base::Bind(&ui::SelectFileDialog::Listener::FileSelected, @@ -574,7 +574,7 @@ void SelectFileDialogImpl::SelectFileImpl( return; } else if (type == SELECT_OPEN_MULTI_FILE) { aura::HandleOpenMultipleFiles( - UTF16ToWide(title), + base::UTF16ToWide(title), default_path, GetFilterForFileTypes(*file_types), base::Bind(&ui::SelectFileDialog::Listener::MultiFilesSelected, @@ -591,7 +591,7 @@ void SelectFileDialogImpl::SelectFileImpl( IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE); } aura::HandleSelectFolder( - UTF16ToWide(title_string), + base::UTF16ToWide(title_string), base::Bind(&ui::SelectFileDialog::Listener::FileSelected, base::Unretained(listener_)), base::Bind(&ui::SelectFileDialog::Listener::FileSelectionCanceled, @@ -604,8 +604,8 @@ void SelectFileDialogImpl::SelectFileImpl( #else HWND owner = owning_window; #endif - ExecuteSelectParams execute_params(type, UTF16ToWide(title), default_path, - file_types, file_type_index, + ExecuteSelectParams execute_params(type, base::UTF16ToWide(title), + default_path, file_types, file_type_index, default_extension, BeginRun(owner), owner, params); execute_params.run_state.dialog_thread->message_loop()->PostTask( @@ -647,7 +647,7 @@ void SelectFileDialogImpl::ExecuteSelectFile( if (title.empty() && params.type == SELECT_UPLOAD_FOLDER) { // If it's for uploading don't use default dialog title to // make sure we clearly tell it's for uploading. - title = UTF16ToWide( + title = base::UTF16ToWide( l10n_util::GetStringUTF16(IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE)); } success = RunSelectFolderDialog(title, diff --git a/ui/views/button_drag_utils.cc b/ui/views/button_drag_utils.cc index e3ab1d0..0084ba9 100644 --- a/ui/views/button_drag_utils.cc +++ b/ui/views/button_drag_utils.cc @@ -31,7 +31,8 @@ void SetURLAndDragImage(const GURL& url, // Create a button to render the drag image for us. views::TextButton button(NULL, - title.empty() ? UTF8ToUTF16(url.spec()) : title); + title.empty() ? base::UTF8ToUTF16(url.spec()) + : title); button.set_max_width(kLinkDragImageMaxWidth); if (icon.isNull()) { button.SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageNamed( diff --git a/ui/views/color_chooser/color_chooser_view.cc b/ui/views/color_chooser/color_chooser_view.cc index 4536e27..93938c9 100644 --- a/ui/views/color_chooser/color_chooser_view.cc +++ b/ui/views/color_chooser/color_chooser_view.cc @@ -33,17 +33,18 @@ const int kBorderWidth = 1; const int kTextfieldLengthInChars = 14; base::string16 GetColorText(SkColor color) { - return ASCIIToUTF16(base::StringPrintf("#%02x%02x%02x", - SkColorGetR(color), - SkColorGetG(color), - SkColorGetB(color))); + return base::ASCIIToUTF16(base::StringPrintf("#%02x%02x%02x", + SkColorGetR(color), + SkColorGetG(color), + SkColorGetB(color))); } bool GetColorFromText(const base::string16& text, SkColor* result) { if (text.size() != 6 && !(text.size() == 7 && text[0] == '#')) return false; - std::string input = UTF16ToUTF8((text.size() == 6) ? text : text.substr(1)); + std::string input = + base::UTF16ToUTF8((text.size() == 6) ? text : text.substr(1)); std::vector<uint8> hex; if (!base::HexStringToBytes(input, &hex)) return false; diff --git a/ui/views/controls/button/label_button_unittest.cc b/ui/views/controls/button/label_button_unittest.cc index e2828c8..9b65ac56 100644 --- a/ui/views/controls/button/label_button_unittest.cc +++ b/ui/views/controls/button/label_button_unittest.cc @@ -12,6 +12,8 @@ #include "ui/gfx/text_utils.h" #include "ui/views/test/views_test_base.h" +using base::ASCIIToUTF16; + namespace { gfx::ImageSkia CreateTestImage(int width, int height) { diff --git a/ui/views/controls/combobox/combobox_unittest.cc b/ui/views/controls/combobox/combobox_unittest.cc index ec4cf85..41a069b 100644 --- a/ui/views/controls/combobox/combobox_unittest.cc +++ b/ui/views/controls/combobox/combobox_unittest.cc @@ -19,6 +19,8 @@ #include "ui/views/test/views_test_base.h" #include "ui/views/widget/widget.h" +using base::ASCIIToUTF16; + namespace views { namespace { diff --git a/ui/views/controls/label_unittest.cc b/ui/views/controls/label_unittest.cc index 79aa52a..640b9d6 100644 --- a/ui/views/controls/label_unittest.cc +++ b/ui/views/controls/label_unittest.cc @@ -12,6 +12,8 @@ #include "ui/gfx/canvas.h" #include "ui/views/border.h" +using base::ASCIIToUTF16; + namespace views { // All text sizing measurements (width and height) should be greater than this. @@ -288,7 +290,7 @@ TEST(LabelTest, AutoDetectDirectionality) { label.set_directionality_mode(Label::AUTO_DETECT_DIRECTIONALITY); // Test text starts with RTL character. - base::string16 test_text(WideToUTF16(L" \x5d0\x5d1\x5d2 abc")); + base::string16 test_text(base::WideToUTF16(L" \x5d0\x5d1\x5d2 abc")); label.SetText(test_text); gfx::Size required_size(label.GetPreferredSize()); gfx::Size extra(22, 8); @@ -306,7 +308,7 @@ TEST(LabelTest, AutoDetectDirectionality) { gfx::Canvas::FORCE_LTR_DIRECTIONALITY)); // Test text starts with LTR character. - test_text = (WideToUTF16(L"ltr \x5d0\x5d1\x5d2 abc")); + test_text = (base::WideToUTF16(L"ltr \x5d0\x5d1\x5d2 abc")); label.SetText(test_text); required_size = label.GetPreferredSize(); label.SetBounds(0, diff --git a/ui/views/controls/menu/menu_model_adapter_unittest.cc b/ui/views/controls/menu/menu_model_adapter_unittest.cc index 6d2428a..b17f3f0 100644 --- a/ui/views/controls/menu/menu_model_adapter_unittest.cc +++ b/ui/views/controls/menu/menu_model_adapter_unittest.cc @@ -128,7 +128,7 @@ class MenuModelBase : public ui::MenuModel { const std::string& item_label, ui::MenuModel* item_submenu) : type(item_type), - label(ASCIIToUTF16(item_label)), + label(base::ASCIIToUTF16(item_label)), submenu(item_submenu) { } diff --git a/ui/views/controls/prefix_selector_unittest.cc b/ui/views/controls/prefix_selector_unittest.cc index 14356df..031c007 100644 --- a/ui/views/controls/prefix_selector_unittest.cc +++ b/ui/views/controls/prefix_selector_unittest.cc @@ -11,6 +11,8 @@ #include "ui/views/controls/prefix_delegate.h" #include "ui/views/test/views_test_base.h" +using base::ASCIIToUTF16; + namespace views { class TestPrefixDelegate : public PrefixDelegate { diff --git a/ui/views/controls/progress_bar_unittest.cc b/ui/views/controls/progress_bar_unittest.cc index de985e8..79a5715 100644 --- a/ui/views/controls/progress_bar_unittest.cc +++ b/ui/views/controls/progress_bar_unittest.cc @@ -12,10 +12,10 @@ namespace views { TEST(ProgressBarTest, TooltipTextProperty) { ProgressBar bar; - base::string16 tooltip = ASCIIToUTF16("Some text"); + base::string16 tooltip = base::ASCIIToUTF16("Some text"); EXPECT_FALSE(bar.GetTooltipText(gfx::Point(), &tooltip)); EXPECT_EQ(base::string16(), tooltip); - base::string16 tooltip_text = ASCIIToUTF16("My progress"); + base::string16 tooltip_text = base::ASCIIToUTF16("My progress"); bar.SetTooltipText(tooltip_text); EXPECT_TRUE(bar.GetTooltipText(gfx::Point(), &tooltip)); EXPECT_EQ(tooltip_text, tooltip); diff --git a/ui/views/controls/slider.cc b/ui/views/controls/slider.cc index 69772ed..7789e5f 100644 --- a/ui/views/controls/slider.cc +++ b/ui/views/controls/slider.cc @@ -326,7 +326,7 @@ void Slider::AnimationProgressed(const gfx::Animation* animation) { void Slider::GetAccessibleState(ui::AccessibleViewState* state) { state->role = ui::AccessibilityTypes::ROLE_SLIDER; state->name = accessible_name_; - state->value = UTF8ToUTF16( + state->value = base::UTF8ToUTF16( base::StringPrintf("%d%%", (int)(value_ * 100 + 0.5))); } diff --git a/ui/views/controls/styled_label_unittest.cc b/ui/views/controls/styled_label_unittest.cc index b1c9015..841f7b7 100644 --- a/ui/views/controls/styled_label_unittest.cc +++ b/ui/views/controls/styled_label_unittest.cc @@ -15,6 +15,8 @@ #include "ui/views/controls/styled_label.h" #include "ui/views/controls/styled_label_listener.h" +using base::ASCIIToUTF16; + namespace views { class StyledLabelTest : public testing::Test, public StyledLabelListener { diff --git a/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc b/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc index f887a8d..2e73ff6 100644 --- a/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc +++ b/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc @@ -9,6 +9,8 @@ #include "ui/views/controls/tabbed_pane/tabbed_pane.h" #include "ui/views/test/views_test_base.h" +using base::ASCIIToUTF16; + namespace views { namespace { diff --git a/ui/views/controls/table/table_view_unittest.cc b/ui/views/controls/table/table_view_unittest.cc index e381a13..1d59358 100644 --- a/ui/views/controls/table/table_view_unittest.cc +++ b/ui/views/controls/table/table_view_unittest.cc @@ -175,9 +175,9 @@ class TableViewTest : public testing::Test { virtual void SetUp() OVERRIDE { model_.reset(new TestTableModel2); std::vector<ui::TableColumn> columns(2); - columns[0].title = ASCIIToUTF16("Title Column 0"); + columns[0].title = base::ASCIIToUTF16("Title Column 0"); columns[0].sortable = true; - columns[1].title = ASCIIToUTF16("Title Column 1"); + columns[1].title = base::ASCIIToUTF16("Title Column 1"); columns[1].id = 1; columns[1].sortable = true; table_ = new TestTableView(model_.get(), columns); diff --git a/ui/views/controls/table/test_table_model.cc b/ui/views/controls/table/test_table_model.cc index 58e82d3..6cac56c 100644 --- a/ui/views/controls/table/test_table_model.cc +++ b/ui/views/controls/table/test_table_model.cc @@ -23,8 +23,8 @@ int TestTableModel::RowCount() { } base::string16 TestTableModel::GetText(int row, int column_id) { - return ASCIIToUTF16(base::IntToString(row) + "x" + - base::IntToString(column_id)); + return base::ASCIIToUTF16(base::IntToString(row) + "x" + + base::IntToString(column_id)); } gfx::ImageSkia TestTableModel::GetIcon(int row) { diff --git a/ui/views/controls/textfield/native_textfield_views_unittest.cc b/ui/views/controls/textfield/native_textfield_views_unittest.cc index aa926a7..eb49e6b 100644 --- a/ui/views/controls/textfield/native_textfield_views_unittest.cc +++ b/ui/views/controls/textfield/native_textfield_views_unittest.cc @@ -43,6 +43,10 @@ #include "base/win/windows_version.h" #endif +using base::ASCIIToUTF16; +using base::UTF8ToUTF16; +using base::WideToUTF16; + #define EXPECT_STR_EQ(ascii, utf16) EXPECT_EQ(ASCIIToUTF16(ascii), utf16) namespace { diff --git a/ui/views/controls/textfield/textfield_views_model_unittest.cc b/ui/views/controls/textfield/textfield_views_model_unittest.cc index 1c6734c..4fa0d9c 100644 --- a/ui/views/controls/textfield/textfield_views_model_unittest.cc +++ b/ui/views/controls/textfield/textfield_views_model_unittest.cc @@ -23,6 +23,10 @@ #include "base/win/windows_version.h" #endif +using base::ASCIIToUTF16; +using base::UTF8ToUTF16; +using base::WideToUTF16; + #define EXPECT_STR_EQ(ascii, utf16) EXPECT_EQ(ASCIIToUTF16(ascii), utf16) namespace { diff --git a/ui/views/controls/tree/tree_view_unittest.cc b/ui/views/controls/tree/tree_view_unittest.cc index ba89f69..fd77026 100644 --- a/ui/views/controls/tree/tree_view_unittest.cc +++ b/ui/views/controls/tree/tree_view_unittest.cc @@ -17,6 +17,8 @@ using ui::TreeModel; using ui::TreeModelNode; using ui::TreeNode; +using base::ASCIIToUTF16; + namespace views { class TestNode : public TreeNode<TestNode> { diff --git a/ui/views/corewm/tooltip_aura_unittest.cc b/ui/views/corewm/tooltip_aura_unittest.cc index 1fc46d2..9850c6e 100644 --- a/ui/views/corewm/tooltip_aura_unittest.cc +++ b/ui/views/corewm/tooltip_aura_unittest.cc @@ -11,6 +11,8 @@ #include "ui/gfx/text_utils.h" #include "ui/views/test/views_test_base.h" +using base::ASCIIToUTF16; + namespace views { namespace corewm { diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc index a7715ef..cf17bf6 100644 --- a/ui/views/corewm/tooltip_controller_unittest.cc +++ b/ui/views/corewm/tooltip_controller_unittest.cc @@ -37,6 +37,8 @@ #include "ui/views/widget/desktop_aura/desktop_screen.h" #endif +using base::ASCIIToUTF16; + namespace views { namespace corewm { namespace test { diff --git a/ui/views/debug_utils.cc b/ui/views/debug_utils.cc index 536a6f6..0b03d82 100644 --- a/ui/views/debug_utils.cc +++ b/ui/views/debug_utils.cc @@ -18,7 +18,7 @@ void PrintViewHierarchyImp(const View* view, int ind = indent; while (ind-- > 0) *out << L' '; - *out << UTF8ToWide(view->GetClassName()); + *out << base::UTF8ToWide(view->GetClassName()); *out << L' '; *out << view->id(); *out << L' '; @@ -38,7 +38,7 @@ void PrintFocusHierarchyImp(const View* view, int ind = indent; while (ind-- > 0) *out << L' '; - *out << UTF8ToWide(view->GetClassName()); + *out << base::UTF8ToWide(view->GetClassName()); *out << L' '; *out << view->id(); *out << L' '; diff --git a/ui/views/examples/bubble_example.cc b/ui/views/examples/bubble_example.cc index 1b00db2..c536613 100644 --- a/ui/views/examples/bubble_example.cc +++ b/ui/views/examples/bubble_example.cc @@ -11,6 +11,8 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/widget/widget.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/button_example.cc b/ui/views/examples/button_example.cc index a791559..5e85e15 100644 --- a/ui/views/examples/button_example.cc +++ b/ui/views/examples/button_example.cc @@ -16,6 +16,8 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/view.h" +using base::ASCIIToUTF16; + namespace { const char kLabelButton[] = "Label Button"; const char kTextButton[] = "Text Button"; diff --git a/ui/views/examples/checkbox_example.cc b/ui/views/examples/checkbox_example.cc index cfe930f..b25dd8e 100644 --- a/ui/views/examples/checkbox_example.cc +++ b/ui/views/examples/checkbox_example.cc @@ -20,7 +20,7 @@ CheckboxExample::~CheckboxExample() { } void CheckboxExample::CreateExampleView(View* container) { - button_ = new Checkbox(ASCIIToUTF16("Checkbox")); + button_ = new Checkbox(base::ASCIIToUTF16("Checkbox")); button_->set_listener(this); container->SetLayoutManager(new FillLayout); container->AddChildView(button_); diff --git a/ui/views/examples/combobox_example.cc b/ui/views/examples/combobox_example.cc index a5b2dbc..6529564 100644 --- a/ui/views/examples/combobox_example.cc +++ b/ui/views/examples/combobox_example.cc @@ -23,7 +23,7 @@ int ComboboxModelExample::GetItemCount() const { } base::string16 ComboboxModelExample::GetItemAt(int index) { - return UTF8ToUTF16(base::StringPrintf("Item %d", index)); + return base::UTF8ToUTF16(base::StringPrintf("Item %d", index)); } ComboboxExample::ComboboxExample() : ExampleBase("Combo Box"), combobox_(NULL) { @@ -46,7 +46,7 @@ void ComboboxExample::CreateExampleView(View* container) { void ComboboxExample::OnSelectedIndexChanged(Combobox* combobox) { DCHECK_EQ(combobox_, combobox); - PrintStatus("Selected: %s", UTF16ToUTF8(combobox_model_.GetItemAt( + PrintStatus("Selected: %s", base::UTF16ToUTF8(combobox_model_.GetItemAt( combobox->selected_index())).c_str()); } diff --git a/ui/views/examples/example_combobox_model.cc b/ui/views/examples/example_combobox_model.cc index 9b4066f..a1160e7 100644 --- a/ui/views/examples/example_combobox_model.cc +++ b/ui/views/examples/example_combobox_model.cc @@ -21,7 +21,7 @@ int ExampleComboboxModel::GetItemCount() const { } base::string16 ExampleComboboxModel::GetItemAt(int index) { - return ASCIIToUTF16(strings_[index]); + return base::ASCIIToUTF16(strings_[index]); } } // namespace examples diff --git a/ui/views/examples/examples_window.cc b/ui/views/examples/examples_window.cc index b8bcf50..fae70f9 100644 --- a/ui/views/examples/examples_window.cc +++ b/ui/views/examples/examples_window.cc @@ -52,7 +52,7 @@ class ComboboxModelExampleList : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE { return example_list_.size(); } virtual base::string16 GetItemAt(int index) OVERRIDE { - return UTF8ToUTF16(example_list_[index]->example_title()); + return base::UTF8ToUTF16(example_list_[index]->example_title()); } View* GetItemViewAt(int index) { @@ -88,7 +88,7 @@ class ExamplesWindowContents : public WidgetDelegateView, // Prints a message in the status area, at the bottom of the window. void SetStatus(const std::string& status) { - status_label_->SetText(UTF8ToUTF16(status)); + status_label_->SetText(base::UTF8ToUTF16(status)); } static ExamplesWindowContents* instance() { return instance_; } @@ -98,7 +98,7 @@ class ExamplesWindowContents : public WidgetDelegateView, virtual bool CanResize() const OVERRIDE { return true; } virtual bool CanMaximize() const OVERRIDE { return true; } virtual base::string16 GetWindowTitle() const OVERRIDE { - return ASCIIToUTF16("Views Examples"); + return base::ASCIIToUTF16("Views Examples"); } virtual View* GetContentsView() OVERRIDE { return this; } virtual void WindowClosing() OVERRIDE { diff --git a/ui/views/examples/examples_window_with_content.cc b/ui/views/examples/examples_window_with_content.cc index c29ba5c..9f3f3ee 100644 --- a/ui/views/examples/examples_window_with_content.cc +++ b/ui/views/examples/examples_window_with_content.cc @@ -54,7 +54,7 @@ class ComboboxModelExampleList : public ui::ComboboxModel { // Overridden from ui::ComboboxModel: virtual int GetItemCount() const OVERRIDE { return example_list_.size(); } virtual base::string16 GetItemAt(int index) OVERRIDE { - return UTF8ToUTF16(example_list_[index]->example_title()); + return base::UTF8ToUTF16(example_list_[index]->example_title()); } View* GetItemViewAt(int index) { @@ -92,7 +92,7 @@ class ExamplesWindowContents : public WidgetDelegateView, // Prints a message in the status area, at the bottom of the window. void SetStatus(const std::string& status) { - status_label_->SetText(UTF8ToUTF16(status)); + status_label_->SetText(base::UTF8ToUTF16(status)); } static ExamplesWindowContents* instance() { return instance_; } @@ -102,7 +102,7 @@ class ExamplesWindowContents : public WidgetDelegateView, virtual bool CanResize() const OVERRIDE { return true; } virtual bool CanMaximize() const OVERRIDE { return true; } virtual base::string16 GetWindowTitle() const OVERRIDE { - return ASCIIToUTF16("Views Examples"); + return base::ASCIIToUTF16("Views Examples"); } virtual View* GetContentsView() OVERRIDE { return this; } virtual void WindowClosing() OVERRIDE { diff --git a/ui/views/examples/label_example.cc b/ui/views/examples/label_example.cc index 712e77e..66e238d 100644 --- a/ui/views/examples/label_example.cc +++ b/ui/views/examples/label_example.cc @@ -10,6 +10,8 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/view.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/link_example.cc b/ui/views/examples/link_example.cc index a28c5d5..3795c8c 100644 --- a/ui/views/examples/link_example.cc +++ b/ui/views/examples/link_example.cc @@ -19,7 +19,7 @@ LinkExample::~LinkExample() { } void LinkExample::CreateExampleView(View* container) { - link_ = new Link(ASCIIToUTF16("Click me!")); + link_ = new Link(base::ASCIIToUTF16("Click me!")); link_->set_listener(this); container->SetLayoutManager(new FillLayout); diff --git a/ui/views/examples/menu_example.cc b/ui/views/examples/menu_example.cc index 434904c..6637253 100644 --- a/ui/views/examples/menu_example.cc +++ b/ui/views/examples/menu_example.cc @@ -15,6 +15,8 @@ #include "ui/views/view.h" #include "ui/views/widget/widget.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/message_box_example.cc b/ui/views/examples/message_box_example.cc index 2563525..cb9e924 100644 --- a/ui/views/examples/message_box_example.cc +++ b/ui/views/examples/message_box_example.cc @@ -10,6 +10,8 @@ #include "ui/views/layout/grid_layout.h" #include "ui/views/view.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/multiline_example.cc b/ui/views/examples/multiline_example.cc index b7d971e..275a0a5 100644 --- a/ui/views/examples/multiline_example.cc +++ b/ui/views/examples/multiline_example.cc @@ -14,6 +14,8 @@ #include "ui/views/layout/grid_layout.h" #include "ui/views/view.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/progress_bar_example.cc b/ui/views/examples/progress_bar_example.cc index ce29ecd..8a860f2 100644 --- a/ui/views/examples/progress_bar_example.cc +++ b/ui/views/examples/progress_bar_example.cc @@ -51,11 +51,11 @@ void ProgressBarExample::CreateExampleView(View* container) { 0, GridLayout::USE_PREF, 0, 0); layout->StartRow(0, 0); - minus_button_ = new LabelButton(this, ASCIIToUTF16("-")); + minus_button_ = new LabelButton(this, base::ASCIIToUTF16("-")); layout->AddView(minus_button_); progress_bar_ = new ProgressBar(); layout->AddView(progress_bar_); - plus_button_ = new LabelButton(this, ASCIIToUTF16("+")); + plus_button_ = new LabelButton(this, base::ASCIIToUTF16("+")); layout->AddView(plus_button_); } diff --git a/ui/views/examples/radio_button_example.cc b/ui/views/examples/radio_button_example.cc index 72a844e..5e3c7dd 100644 --- a/ui/views/examples/radio_button_example.cc +++ b/ui/views/examples/radio_button_example.cc @@ -23,13 +23,13 @@ RadioButtonExample::~RadioButtonExample() { } void RadioButtonExample::CreateExampleView(View* container) { - select_ = new LabelButton(this, ASCIIToUTF16("Select")); - status_ = new LabelButton(this, ASCIIToUTF16("Show Status")); + select_ = new LabelButton(this, base::ASCIIToUTF16("Select")); + status_ = new LabelButton(this, base::ASCIIToUTF16("Show Status")); int group = 1; for (size_t i = 0; i < arraysize(radio_buttons_); ++i) { radio_buttons_[i] = new RadioButton( - UTF8ToUTF16(base::StringPrintf( + base::UTF8ToUTF16(base::StringPrintf( "Radio %d in group %d", static_cast<int>(i) + 1, group)), group); radio_buttons_[i]->set_listener(this); diff --git a/ui/views/examples/scroll_view_example.cc b/ui/views/examples/scroll_view_example.cc index 38b18fc..eba536e 100644 --- a/ui/views/examples/scroll_view_example.cc +++ b/ui/views/examples/scroll_view_example.cc @@ -12,6 +12,8 @@ #include "ui/views/layout/grid_layout.h" #include "ui/views/view.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/slider_example.cc b/ui/views/examples/slider_example.cc index 8ae4d6b..89f7856 100644 --- a/ui/views/examples/slider_example.cc +++ b/ui/views/examples/slider_example.cc @@ -37,7 +37,7 @@ void SliderExample::SliderValueChanged(Slider* sender, float value, float old_value, SliderChangeReason reason) { - label_->SetText(ASCIIToUTF16(base::StringPrintf("%.3lf", value))); + label_->SetText(base::ASCIIToUTF16(base::StringPrintf("%.3lf", value))); } } // namespace examples diff --git a/ui/views/examples/tabbed_pane_example.cc b/ui/views/examples/tabbed_pane_example.cc index 9c4bdde..087c77b 100644 --- a/ui/views/examples/tabbed_pane_example.cc +++ b/ui/views/examples/tabbed_pane_example.cc @@ -9,6 +9,8 @@ #include "ui/views/controls/tabbed_pane/tabbed_pane.h" #include "ui/views/layout/grid_layout.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/table_example.cc b/ui/views/examples/table_example.cc index fcd79d8..eb1a29a 100644 --- a/ui/views/examples/table_example.cc +++ b/ui/views/examples/table_example.cc @@ -14,6 +14,8 @@ #include "ui/views/controls/button/checkbox.h" #include "ui/views/layout/grid_layout.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/text_example.cc b/ui/views/examples/text_example.cc index 63c51e1..64e9107 100644 --- a/ui/views/examples/text_example.cc +++ b/ui/views/examples/text_example.cc @@ -16,6 +16,8 @@ #include "ui/views/layout/grid_layout.h" #include "ui/views/view.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/textfield_example.cc b/ui/views/examples/textfield_example.cc index a33421c..3738fe7 100644 --- a/ui/views/examples/textfield_example.cc +++ b/ui/views/examples/textfield_example.cc @@ -14,6 +14,8 @@ #include "ui/views/layout/grid_layout.h" #include "ui/views/view.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/tree_view_example.cc b/ui/views/examples/tree_view_example.cc index 6dfc558..e7cce32 100644 --- a/ui/views/examples/tree_view_example.cc +++ b/ui/views/examples/tree_view_example.cc @@ -11,6 +11,8 @@ #include "ui/views/controls/tree/tree_view.h" #include "ui/views/layout/grid_layout.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/examples/widget_example.cc b/ui/views/examples/widget_example.cc index c4042b5..4e2a335 100644 --- a/ui/views/examples/widget_example.cc +++ b/ui/views/examples/widget_example.cc @@ -13,6 +13,8 @@ #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h" +using base::ASCIIToUTF16; + namespace views { namespace examples { diff --git a/ui/views/focus/focus_manager_unittest.cc b/ui/views/focus/focus_manager_unittest.cc index 9c6a5bc..820ba73 100644 --- a/ui/views/focus/focus_manager_unittest.cc +++ b/ui/views/focus/focus_manager_unittest.cc @@ -572,7 +572,7 @@ TEST_F(FocusManagerDtorTest, FocusManagerDestructedLast) { // Setup views hierarchy. GetContentsView()->AddChildView(new Textfield()); GetContentsView()->AddChildView(new LabelButtonDtorTracked( - ASCIIToUTF16("button"), &dtor_tracker_)); + base::ASCIIToUTF16("button"), &dtor_tracker_)); // Close the window. GetWidget()->Close(); diff --git a/ui/views/focus/focus_manager_unittest_win.cc b/ui/views/focus/focus_manager_unittest_win.cc index 267a8b7..fe5b8a9 100644 --- a/ui/views/focus/focus_manager_unittest_win.cc +++ b/ui/views/focus/focus_manager_unittest_win.cc @@ -70,7 +70,7 @@ TEST_F(FocusManagerTest, FocusStoreRestore) { // Simulate an activate, otherwise the deactivate isn't going to do anything. SimulateActivateWindow(); - LabelButton* button = new LabelButton(NULL, ASCIIToUTF16("Press me")); + LabelButton* button = new LabelButton(NULL, base::ASCIIToUTF16("Press me")); button->SetStyle(Button::STYLE_NATIVE_TEXTBUTTON); View* view = new View(); view->SetFocusable(true); diff --git a/ui/views/focus/focus_traversal_unittest.cc b/ui/views/focus/focus_traversal_unittest.cc index 0976a4c..4bb961b 100644 --- a/ui/views/focus/focus_traversal_unittest.cc +++ b/ui/views/focus/focus_traversal_unittest.cc @@ -25,6 +25,8 @@ #include "ui/views/widget/root_view.h" #include "ui/views/widget/widget.h" +using base::ASCIIToUTF16; + namespace views { namespace { diff --git a/ui/views/test/child_modal_window.cc b/ui/views/test/child_modal_window.cc index a7eda417..db8f8a4 100644 --- a/ui/views/test/child_modal_window.cc +++ b/ui/views/test/child_modal_window.cc @@ -4,7 +4,7 @@ #include "ui/views/test/child_modal_window.h" -#include "base/strings/utf_string_conversions.h" // ASCIIToUTF16 +#include "base/strings/utf_string_conversions.h" #include "ui/aura/window.h" #include "ui/gfx/canvas.h" #include "ui/views/background.h" @@ -96,7 +96,7 @@ View* ChildModalWindow::GetContentsView() { } base::string16 ChildModalWindow::GetWindowTitle() const { - return ASCIIToUTF16("Examples: Child Modal Window"); + return base::ASCIIToUTF16("Examples: Child Modal Window"); } bool ChildModalWindow::CanResize() const { @@ -109,7 +109,8 @@ ui::ModalType ChildModalWindow::GetModalType() const { ChildModalParent::ChildModalParent(gfx::NativeView context) : button_(new LabelButton(this, - ASCIIToUTF16("Show/Hide Child Modal Window"))), + base::ASCIIToUTF16( + "Show/Hide Child Modal Window"))), textfield_(new Textfield), host_(new NativeViewHost), modal_parent_(NULL), @@ -160,7 +161,7 @@ View* ChildModalParent::GetContentsView() { } base::string16 ChildModalParent::GetWindowTitle() const { - return ASCIIToUTF16("Examples: Child Modal Parent"); + return base::ASCIIToUTF16("Examples: Child Modal Parent"); } bool ChildModalParent::CanResize() const { diff --git a/ui/views/touchui/touch_editing_menu.cc b/ui/views/touchui/touch_editing_menu.cc index b3215aa..986d01b 100644 --- a/ui/views/touchui/touch_editing_menu.cc +++ b/ui/views/touchui/touch_editing_menu.cc @@ -122,7 +122,7 @@ void TouchEditingMenuView::CreateButtons() { // Finally, add ellipses button. AddChildView(CreateButton( - UTF8ToUTF16(kEllipsesButtonText), kEllipsesButtonTag)); + base::UTF8ToUTF16(kEllipsesButtonText), kEllipsesButtonTag)); Layout(); } diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc index 4e34dcb..e1d0259 100644 --- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc +++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc @@ -22,6 +22,9 @@ #include "ui/aura/window.h" #endif +using base::ASCIIToUTF16; +using base::UTF16ToUTF8; + namespace { // Should match kSelectionHandlePadding in touch_selection_controller. const int kPadding = 10; diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc index 4271b8c..b4541d0 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc @@ -527,7 +527,7 @@ bool DesktopRootWindowHostX11::SetWindowTitle(const base::string16& title) { if (window_title_ == title) return false; window_title_ = title; - std::string utf8str = UTF16ToUTF8(title); + std::string utf8str = base::UTF16ToUTF8(title); XChangeProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("_NET_WM_NAME"), diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index 4196da6..2273acb 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc @@ -914,7 +914,7 @@ TEST_F(WidgetTest, KeyboardInputEvent) { View* container = toplevel->client_view(); Textfield* textfield = new Textfield(); - textfield->SetText(ASCIIToUTF16("some text")); + textfield->SetText(base::ASCIIToUTF16("some text")); container->AddChildView(textfield); toplevel->Show(); textfield->RequestFocus(); @@ -1604,9 +1604,9 @@ class WidgetWindowTitleTest : public WidgetTest { widget->native_widget_private(); base::string16 empty; - base::string16 s1(UTF8ToUTF16("Title1")); - base::string16 s2(UTF8ToUTF16("Title2")); - base::string16 s3(UTF8ToUTF16("TitleLong")); + base::string16 s1(base::UTF8ToUTF16("Title1")); + base::string16 s2(base::UTF8ToUTF16("Title2")); + base::string16 s3(base::UTF8ToUTF16("TitleLong")); // The widget starts with no title, setting empty should not change // anything. diff --git a/ui/views/window/dialog_delegate_unittest.cc b/ui/views/window/dialog_delegate_unittest.cc index 5398ed0..fee160e 100644 --- a/ui/views/window/dialog_delegate_unittest.cc +++ b/ui/views/window/dialog_delegate_unittest.cc @@ -207,7 +207,7 @@ TEST_F(DialogTest, HitTest) { TEST_F(DialogTest, InitialBoundsAccommodateTitle) { TestDialog* titled_dialog(new TestDialog()); - titled_dialog->set_title(ASCIIToUTF16("Title")); + titled_dialog->set_title(base::ASCIIToUTF16("Title")); DialogDelegate::CreateDialogWidget(titled_dialog, GetContext(), NULL); // Titled dialogs have taller initial frame bounds than untitled dialogs. @@ -215,7 +215,7 @@ TEST_F(DialogTest, InitialBoundsAccommodateTitle) { dialog()->GetWidget()->GetWindowBoundsInScreen().height()); // Giving the default test dialog a title will make the bounds the same. - dialog()->set_title(ASCIIToUTF16("Title")); + dialog()->set_title(base::ASCIIToUTF16("Title")); dialog()->GetWidget()->UpdateWindowTitle(); View* frame = dialog()->GetWidget()->non_client_view()->frame_view(); EXPECT_EQ(titled_dialog->GetWidget()->GetWindowBoundsInScreen().height(), diff --git a/ui/web_dialogs/test/test_web_dialog_delegate.cc b/ui/web_dialogs/test/test_web_dialog_delegate.cc index da13bbd..cf3e659 100644 --- a/ui/web_dialogs/test/test_web_dialog_delegate.cc +++ b/ui/web_dialogs/test/test_web_dialog_delegate.cc @@ -25,7 +25,7 @@ ModalType TestWebDialogDelegate::GetDialogModalType() const { } base::string16 TestWebDialogDelegate::GetDialogTitle() const { - return UTF8ToUTF16("Test"); + return base::UTF8ToUTF16("Test"); } GURL TestWebDialogDelegate::GetDialogContentURL() const { |