diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-24 16:23:25 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-24 16:23:25 +0000 |
commit | b57c9d55d3dc1b31cd806c3861f7356bbd3ff2b7 (patch) | |
tree | dcdf7e81b7f0ff38f4ac891ab9373eb7db9d0cbe /ash | |
parent | 5b871bca736fe4228c3c2efdfcd7ad619449d362 (diff) | |
download | chromium_src-b57c9d55d3dc1b31cd806c3861f7356bbd3ff2b7.zip chromium_src-b57c9d55d3dc1b31cd806c3861f7356bbd3ff2b7.tar.gz chromium_src-b57c9d55d3dc1b31cd806c3861f7356bbd3ff2b7.tar.bz2 |
Update uses of UTF conversions in android_webview/, apps/, ash/, chrome/app to use the base:: namespace.
BUG=330556
TEST=no change
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/102443009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242444 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
38 files changed, 183 insertions, 166 deletions
diff --git a/ash/display/resolution_notification_controller.cc b/ash/display/resolution_notification_controller.cc index 0914772..b51065a 100644 --- a/ash/display/resolution_notification_controller.cc +++ b/ash/display/resolution_notification_controller.cc @@ -222,9 +222,9 @@ void ResolutionNotificationController::CreateOrUpdateNotification( kNotificationId, l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED, - UTF8ToUTF16(Shell::GetInstance()->display_manager()-> + base::UTF8ToUTF16(Shell::GetInstance()->display_manager()-> GetDisplayNameForId(change_info_->display_id)), - UTF8ToUTF16(change_info_->new_resolution.ToString())), + base::UTF8ToUTF16(change_info_->new_resolution.ToString())), timeout_message, bundle.GetImageNamed(IDR_AURA_UBER_TRAY_DISPLAY), base::string16() /* display_source */, diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc index f7481c6..6b838c9 100644 --- a/ash/drag_drop/drag_drop_controller_unittest.cc +++ b/ash/drag_drop/drag_drop_controller_unittest.cc @@ -76,7 +76,7 @@ class DragTestView : public views::View { virtual void WriteDragData(const gfx::Point& p, OSExchangeData* data) OVERRIDE { - data->SetString(UTF8ToUTF16("I am being dragged")); + data->SetString(base::UTF8ToUTF16("I am being dragged")); gfx::ImageSkiaRep image_rep(gfx::Size(10, 20), 1.0f); gfx::ImageSkia image_skia(image_rep); @@ -362,7 +362,7 @@ TEST_F(DragDropControllerTest, MAYBE_DragDropInSingleViewTest) { DragTestView* drag_view = new DragTestView; AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), widget->GetNativeView()); generator.PressLeftButton(); @@ -392,7 +392,7 @@ TEST_F(DragDropControllerTest, MAYBE_DragDropInSingleViewTest) { EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), drag_drop_controller_->num_drag_updates_); EXPECT_TRUE(drag_drop_controller_->drop_received_); - EXPECT_EQ(UTF8ToUTF16("I am being dragged"), + EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"), drag_drop_controller_->drag_string_); EXPECT_EQ(1, drag_view->num_drag_enters_); @@ -408,7 +408,7 @@ TEST_F(DragDropControllerTest, DragDropWithZeroDragUpdates) { DragTestView* drag_view = new DragTestView; AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), widget->GetNativeView()); generator.PressLeftButton(); @@ -455,7 +455,7 @@ TEST_F(DragDropControllerTest, MAYBE_DragDropInMultipleViewsSingleWidgetTest) { AddViewToWidgetAndResize(widget.get(), drag_view2); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseRelativeTo(widget->GetNativeView(), @@ -482,7 +482,7 @@ TEST_F(DragDropControllerTest, MAYBE_DragDropInMultipleViewsSingleWidgetTest) { EXPECT_EQ(num_drags - 1 - drag_view1->HorizontalDragThreshold(), drag_drop_controller_->num_drag_updates_); EXPECT_TRUE(drag_drop_controller_->drop_received_); - EXPECT_EQ(UTF8ToUTF16("I am being dragged"), + EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"), drag_drop_controller_->drag_string_); EXPECT_EQ(1, drag_view1->num_drag_enters_); @@ -521,7 +521,7 @@ TEST_F(DragDropControllerTest, MAYBE_DragDropInMultipleViewsMultipleWidgetsTest) widget2_bounds.width(), widget2_bounds.height())); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), widget1->GetNativeView()); @@ -547,7 +547,7 @@ TEST_F(DragDropControllerTest, MAYBE_DragDropInMultipleViewsMultipleWidgetsTest) EXPECT_EQ(num_drags - 1 - drag_view1->HorizontalDragThreshold(), drag_drop_controller_->num_drag_updates_); EXPECT_TRUE(drag_drop_controller_->drop_received_); - EXPECT_EQ(UTF8ToUTF16("I am being dragged"), + EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"), drag_drop_controller_->drag_string_); EXPECT_EQ(1, drag_view1->num_drag_enters_); @@ -579,7 +579,7 @@ TEST_F(DragDropControllerTest, MAYBE_ViewRemovedWhileInDragDropTest) { AddViewToWidgetAndResize(widget.get(), drag_view.get()); gfx::Point point = gfx::Rect(drag_view->bounds()).CenterPoint(); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseToCenterOf(widget->GetNativeView()); @@ -616,7 +616,7 @@ TEST_F(DragDropControllerTest, MAYBE_ViewRemovedWhileInDragDropTest) { EXPECT_EQ(num_drags_1 + num_drags_2 - 1 - drag_view->VerticalDragThreshold(), drag_drop_controller_->num_drag_updates_); EXPECT_TRUE(drag_drop_controller_->drop_received_); - EXPECT_EQ(UTF8ToUTF16("I am being dragged"), + EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"), drag_drop_controller_->drag_string_); EXPECT_EQ(1, drag_view->num_drag_enters_); @@ -633,7 +633,7 @@ TEST_F(DragDropControllerTest, DragLeavesClipboardAloneTest) { { // We first copy some text to the clipboard. ui::ScopedClipboardWriter scw(cb, ui::CLIPBOARD_TYPE_COPY_PASTE); - scw.WriteText(ASCIIToUTF16(clip_str)); + scw.WriteText(base::ASCIIToUTF16(clip_str)); } EXPECT_TRUE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), ui::CLIPBOARD_TYPE_COPY_PASTE)); @@ -646,7 +646,7 @@ TEST_F(DragDropControllerTest, DragLeavesClipboardAloneTest) { widget->GetNativeView()); ui::OSExchangeData data; std::string data_str("I am being dragged"); - data.SetString(ASCIIToUTF16(data_str)); + data.SetString(base::ASCIIToUTF16(data_str)); generator.PressLeftButton(); generator.MoveMouseBy(0, drag_view->VerticalDragThreshold() + 1); @@ -672,7 +672,7 @@ TEST_F(DragDropControllerTest, WindowDestroyedDuringDragDrop) { aura::Window* window = widget->GetNativeView(); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), widget->GetNativeView()); generator.PressLeftButton(); @@ -716,7 +716,7 @@ TEST_F(DragDropControllerTest, SyntheticEventsDuringDragDrop) { DragTestView* drag_view = new DragTestView; AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), widget->GetNativeView()); generator.PressLeftButton(); @@ -747,7 +747,7 @@ TEST_F(DragDropControllerTest, SyntheticEventsDuringDragDrop) { EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), drag_drop_controller_->num_drag_updates_); EXPECT_TRUE(drag_drop_controller_->drop_received_); - EXPECT_EQ(UTF8ToUTF16("I am being dragged"), + EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"), drag_drop_controller_->drag_string_); EXPECT_EQ(1, drag_view->num_drag_enters_); @@ -771,7 +771,7 @@ TEST_F(DragDropControllerTest, MAYBE_PressingEscapeCancelsDragDrop) { DragTestView* drag_view = new DragTestView; AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), widget->GetNativeView()); generator.PressLeftButton(); @@ -797,7 +797,7 @@ TEST_F(DragDropControllerTest, MAYBE_PressingEscapeCancelsDragDrop) { drag_drop_controller_->num_drag_updates_); EXPECT_FALSE(drag_drop_controller_->drop_received_); EXPECT_TRUE(drag_drop_controller_->drag_canceled_); - EXPECT_EQ(UTF8ToUTF16("I am being dragged"), + EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"), drag_drop_controller_->drag_string_); EXPECT_EQ(1, drag_view->num_drag_enters_); @@ -813,7 +813,7 @@ TEST_F(DragDropControllerTest, MAYBE_CaptureLostCancelsDragDrop) { DragTestView* drag_view = new DragTestView; AddViewToWidgetAndResize(widget.get(), drag_view); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), widget->GetNativeView()); generator.PressLeftButton(); @@ -848,7 +848,7 @@ TEST_F(DragDropControllerTest, MAYBE_CaptureLostCancelsDragDrop) { drag_drop_controller_->num_drag_updates_); EXPECT_FALSE(drag_drop_controller_->drop_received_); EXPECT_TRUE(drag_drop_controller_->drag_canceled_); - EXPECT_EQ(UTF8ToUTF16("I am being dragged"), + EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"), drag_drop_controller_->drag_string_); EXPECT_EQ(1, drag_view->num_drag_enters_); @@ -874,7 +874,7 @@ TEST_F(DragDropControllerTest, TouchDragDropInMultipleWindows) { widget2_bounds.width(), widget2_bounds.height())); ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), widget1->GetNativeView()); @@ -901,7 +901,7 @@ TEST_F(DragDropControllerTest, TouchDragDropInMultipleWindows) { EXPECT_TRUE(drag_drop_controller_->drag_start_received_); EXPECT_EQ(num_drags, drag_drop_controller_->num_drag_updates_); EXPECT_TRUE(drag_drop_controller_->drop_received_); - EXPECT_EQ(UTF8ToUTF16("I am being dragged"), + EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"), drag_drop_controller_->drag_string_); EXPECT_EQ(1, drag_view1->num_drag_enters_); @@ -938,7 +938,7 @@ TEST_F(DragDropControllerTest, TouchDragDropCancelsOnLongTap) { EXPECT_TRUE(drag_drop_controller_->drag_canceled_); EXPECT_EQ(0, drag_drop_controller_->num_drag_updates_); EXPECT_FALSE(drag_drop_controller_->drop_received_); - EXPECT_EQ(UTF8ToUTF16("I am being dragged"), + EXPECT_EQ(base::UTF8ToUTF16("I am being dragged"), drag_drop_controller_->drag_string_); EXPECT_EQ(0, drag_view->num_drag_enters_); EXPECT_EQ(0, drag_view->num_drops_); @@ -1002,7 +1002,7 @@ TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) { } ui::OSExchangeData data; - data.SetString(UTF8ToUTF16("I am being dragged")); + data.SetString(base::UTF8ToUTF16("I am being dragged")); { scoped_ptr<views::Widget> widget(CreateNewWidget()); aura::Window* window = widget->GetNativeWindow(); diff --git a/ash/drag_drop/drag_drop_interactive_uitest.cc b/ash/drag_drop/drag_drop_interactive_uitest.cc index 73422f3..28295ff 100644 --- a/ash/drag_drop/drag_drop_interactive_uitest.cc +++ b/ash/drag_drop/drag_drop_interactive_uitest.cc @@ -30,7 +30,7 @@ class DraggableView : public views::View { } virtual void WriteDragData(const gfx::Point& press_pt, OSExchangeData* data)OVERRIDE { - data->SetString(UTF8ToUTF16("test")); + data->SetString(base::UTF8ToUTF16("test")); } private: diff --git a/ash/keyboard_overlay/keyboard_overlay_delegate_unittest.cc b/ash/keyboard_overlay/keyboard_overlay_delegate_unittest.cc index 95c048de..2605263 100644 --- a/ash/keyboard_overlay/keyboard_overlay_delegate_unittest.cc +++ b/ash/keyboard_overlay/keyboard_overlay_delegate_unittest.cc @@ -37,7 +37,7 @@ TEST_P(KeyboardOverlayDelegateTest, ShowAndClose) { UpdateDisplay("500x400,300x200"); ash::Shell* shell = ash::Shell::GetInstance(); shell->SetShelfAlignment(shelf_alignment(), shell->GetPrimaryRootWindow()); - KeyboardOverlayDelegate delegate(ASCIIToUTF16("Title"), + KeyboardOverlayDelegate delegate(base::ASCIIToUTF16("Title"), GURL("chrome://keyboardoverlay/")); // Showing the dialog creates a widget. views::Widget* widget = delegate.Show(NULL); diff --git a/ash/session_state_delegate_stub.cc b/ash/session_state_delegate_stub.cc index cea4132..f336f02 100644 --- a/ash/session_state_delegate_stub.cc +++ b/ash/session_state_delegate_stub.cc @@ -58,7 +58,7 @@ bool SessionStateDelegateStub::IsUserSessionBlocked() const { const base::string16 SessionStateDelegateStub::GetUserDisplayName( MultiProfileIndex index) const { - return UTF8ToUTF16("stub-user"); + return base::UTF8ToUTF16("stub-user"); } const std::string SessionStateDelegateStub::GetUserEmail( diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 500450a..89ee4ce 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc @@ -270,21 +270,22 @@ class TestItem : public SystemTrayItem { tray_view_ = new views::View; // Add a label so it has non-zero width. tray_view_->SetLayoutManager(new views::FillLayout); - tray_view_->AddChildView(new views::Label(UTF8ToUTF16("Tray"))); + tray_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Tray"))); return tray_view_; } virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE { default_view_ = new views::View; default_view_->SetLayoutManager(new views::FillLayout); - default_view_->AddChildView(new views::Label(UTF8ToUTF16("Default"))); + default_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Default"))); return default_view_; } virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE { detailed_view_ = new views::View; detailed_view_->SetLayoutManager(new views::FillLayout); - detailed_view_->AddChildView(new views::Label(UTF8ToUTF16("Detailed"))); + detailed_view_->AddChildView( + new views::Label(base::UTF8ToUTF16("Detailed"))); return detailed_view_; } diff --git a/ash/shell/app_list.cc b/ash/shell/app_list.cc index ad36307..0bb0a7a 100644 --- a/ash/shell/app_list.cc +++ b/ash/shell/app_list.cc @@ -159,7 +159,8 @@ class ExampleSearchResult : public app_list::SearchResult { : type_(type) { SetIcon(WindowTypeLauncherItem::GetIcon(type_)); - base::string16 title = UTF8ToUTF16(WindowTypeLauncherItem::GetTitle(type_)); + base::string16 title = + base::UTF8ToUTF16(WindowTypeLauncherItem::GetTitle(type_)); set_title(title); Tags title_tags; @@ -178,7 +179,7 @@ class ExampleSearchResult : public app_list::SearchResult { set_title_tags(title_tags); base::string16 details = - UTF8ToUTF16(WindowTypeLauncherItem::GetDetails(type_)); + base::UTF8ToUTF16(WindowTypeLauncherItem::GetDetails(type_)); set_details(details); Tags details_tags; details_tags.push_back(Tag(Tag::DIM, 0, details.length())); @@ -214,7 +215,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { } gfx::ImageSkia CreateSearchBoxIcon() { - const base::string16 icon_text = ASCIIToUTF16("ash"); + const base::string16 icon_text = base::ASCIIToUTF16("ash"); const gfx::Size icon_size(32, 32); gfx::Canvas canvas(icon_size, 1.0f, false /* is_opaque */); @@ -230,7 +231,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { void DecorateSearchBox(app_list::SearchBoxModel* search_box_model) { search_box_model->SetIcon(CreateSearchBoxIcon()); - search_box_model->SetHintText(ASCIIToUTF16("Type to search...")); + search_box_model->SetHintText(base::ASCIIToUTF16("Type to search...")); } // Overridden from app_list::AppListViewDelegate: @@ -291,7 +292,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { static_cast<WindowTypeLauncherItem::Type>(i); base::string16 title = - UTF8ToUTF16(WindowTypeLauncherItem::GetTitle(type)); + base::UTF8ToUTF16(WindowTypeLauncherItem::GetTitle(type)); if (base::i18n::StringSearchIgnoringCaseAndAccents( query, title, NULL, NULL)) { model_->results()->Add(new ExampleSearchResult(type, query)); diff --git a/ash/shell/bubble.cc b/ash/shell/bubble.cc index c39f76a..cc8dc79 100644 --- a/ash/shell/bubble.cc +++ b/ash/shell/bubble.cc @@ -36,7 +36,7 @@ class ExampleBubbleDelegateView : public views::BubbleDelegateView { void CreatePointyBubble(views::View* anchor_view) { BubbleConfig config; - config.label = ASCIIToUTF16("PointyBubble"); + config.label = base::ASCIIToUTF16("PointyBubble"); config.anchor_view = anchor_view; config.arrow = views::BubbleBorder::TOP_LEFT; ExampleBubbleDelegateView* bubble = new ExampleBubbleDelegateView(config); diff --git a/ash/shell/lock_view.cc b/ash/shell/lock_view.cc index 7a95ea439..ba04fed 100644 --- a/ash/shell/lock_view.cc +++ b/ash/shell/lock_view.cc @@ -24,8 +24,8 @@ namespace shell { class LockView : public views::WidgetDelegateView, public views::ButtonListener { public: - LockView() - : unlock_button_(new views::LabelButton(this, ASCIIToUTF16("Unlock"))) { + LockView() : unlock_button_(new views::LabelButton( + this, base::ASCIIToUTF16("Unlock"))) { unlock_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); AddChildView(unlock_button_); unlock_button_->SetFocusable(true); @@ -41,7 +41,7 @@ class LockView : public views::WidgetDelegateView, // Overridden from views::View: virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { canvas->FillRect(GetLocalBounds(), SK_ColorYELLOW); - base::string16 text = ASCIIToUTF16("LOCKED!"); + base::string16 text = base::ASCIIToUTF16("LOCKED!"); int string_width = font_.GetStringWidth(text); canvas->DrawStringInt(text, font_, SK_ColorRED, (width() - string_width)/ 2, (height() - font_.GetHeight()) / 2, diff --git a/ash/shell/panel_window.cc b/ash/shell/panel_window.cc index 9593a40..3e59680 100644 --- a/ash/shell/panel_window.cc +++ b/ash/shell/panel_window.cc @@ -66,7 +66,7 @@ void PanelWindow::OnPaint(gfx::Canvas* canvas) { } base::string16 PanelWindow::GetWindowTitle() const { - return ASCIIToUTF16(name_); + return base::ASCIIToUTF16(name_); } views::View* PanelWindow::GetContentsView() { diff --git a/ash/shell/toplevel_window.cc b/ash/shell/toplevel_window.cc index ea8b79f..4223732 100644 --- a/ash/shell/toplevel_window.cc +++ b/ash/shell/toplevel_window.cc @@ -64,7 +64,7 @@ void ToplevelWindow::OnPaint(gfx::Canvas* canvas) { } base::string16 ToplevelWindow::GetWindowTitle() const { - return ASCIIToUTF16("Examples: Toplevel Window"); + return base::ASCIIToUTF16("Examples: Toplevel Window"); } void ToplevelWindow::SaveWindowPlacement(const gfx::Rect& bounds, diff --git a/ash/shell/widgets.cc b/ash/shell/widgets.cc index 0165490..b92b10c6 100644 --- a/ash/shell/widgets.cc +++ b/ash/shell/widgets.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "ash/shell.h" -#include "base/strings/utf_string_conversions.h" // ASCIIToUTF16 +#include "base/strings/utf_string_conversions.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/gfx/canvas.h" @@ -53,22 +53,24 @@ class WidgetsWindow : public views::WidgetDelegateView { }; WidgetsWindow::WidgetsWindow() - : button_(new views::LabelButton(NULL, ASCIIToUTF16("Button"))), + : button_(new views::LabelButton(NULL, base::ASCIIToUTF16("Button"))), disabled_button_( - new views::LabelButton(NULL, ASCIIToUTF16("Disabled button"))), - checkbox_(new views::Checkbox(ASCIIToUTF16("Checkbox"))), + new views::LabelButton(NULL, base::ASCIIToUTF16("Disabled button"))), + checkbox_(new views::Checkbox(base::ASCIIToUTF16("Checkbox"))), checkbox_disabled_(new views::Checkbox( - ASCIIToUTF16("Checkbox disabled"))), - checkbox_checked_(new views::Checkbox(ASCIIToUTF16("Checkbox checked"))), + base::ASCIIToUTF16("Checkbox disabled"))), + checkbox_checked_(new views::Checkbox( + base::ASCIIToUTF16("Checkbox checked"))), checkbox_checked_disabled_(new views::Checkbox( - ASCIIToUTF16("Checkbox checked disabled"))), - radio_button_(new views::RadioButton(ASCIIToUTF16("Radio button"), 0)), + base::ASCIIToUTF16("Checkbox checked disabled"))), + radio_button_(new views::RadioButton( + base::ASCIIToUTF16("Radio button"), 0)), radio_button_disabled_(new views::RadioButton( - ASCIIToUTF16("Radio button disabled"), 0)), + base::ASCIIToUTF16("Radio button disabled"), 0)), radio_button_selected_(new views::RadioButton( - ASCIIToUTF16("Radio button selected"), 0)), + base::ASCIIToUTF16("Radio button selected"), 0)), radio_button_selected_disabled_(new views::RadioButton( - ASCIIToUTF16("Radio button selected disabled"), 1)) { + base::ASCIIToUTF16("Radio button selected disabled"), 1)) { button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); AddChildView(button_); disabled_button_->SetEnabled(false); @@ -120,7 +122,7 @@ views::View* WidgetsWindow::GetContentsView() { } base::string16 WidgetsWindow::GetWindowTitle() const { - return ASCIIToUTF16("Examples: Widgets"); + return base::ASCIIToUTF16("Examples: Widgets"); } bool WidgetsWindow::CanResize() const { diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc index d245ecf..44c9e3c 100644 --- a/ash/shell/window_type_launcher.cc +++ b/ash/shell/window_type_launcher.cc @@ -55,7 +55,8 @@ class ModalWindow : public views::WidgetDelegateView, explicit ModalWindow(ui::ModalType modal_type) : modal_type_(modal_type), color_(g_colors[g_color_index]), - open_button_(new views::LabelButton(this, ASCIIToUTF16("Moar!"))) { + open_button_(new views::LabelButton(this, + base::ASCIIToUTF16("Moar!"))) { ++g_color_index %= arraysize(g_colors); open_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); AddChildView(open_button_); @@ -94,7 +95,7 @@ class ModalWindow : public views::WidgetDelegateView, return true; } virtual base::string16 GetWindowTitle() const OVERRIDE { - return ASCIIToUTF16("Modal Window"); + return base::ASCIIToUTF16("Modal Window"); } virtual ui::ModalType GetModalType() const OVERRIDE { return modal_type_; @@ -159,7 +160,7 @@ class NonModalTransient : public views::WidgetDelegateView { return true; } virtual base::string16 GetWindowTitle() const OVERRIDE { - return ASCIIToUTF16("Non-Modal Transient"); + return base::ASCIIToUTF16("Non-Modal Transient"); } virtual void DeleteDelegate() OVERRIDE { if (GetWidget() == non_modal_transient_) @@ -201,33 +202,33 @@ void InitWindowTypeLauncher() { WindowTypeLauncher::WindowTypeLauncher() : create_button_(new views::LabelButton( - this, ASCIIToUTF16("Create Window"))), + this, base::ASCIIToUTF16("Create Window"))), panel_button_(new views::LabelButton( - this, ASCIIToUTF16("Create Panel"))), + this, base::ASCIIToUTF16("Create Panel"))), create_nonresizable_button_(new views::LabelButton( - this, ASCIIToUTF16("Create Non-Resizable Window"))), + this, base::ASCIIToUTF16("Create Non-Resizable Window"))), bubble_button_(new views::LabelButton( - this, ASCIIToUTF16("Create Pointy Bubble"))), + this, base::ASCIIToUTF16("Create Pointy Bubble"))), lock_button_(new views::LabelButton( - this, ASCIIToUTF16("Lock Screen"))), + this, base::ASCIIToUTF16("Lock Screen"))), widgets_button_(new views::LabelButton( - this, ASCIIToUTF16("Show Example Widgets"))), + this, base::ASCIIToUTF16("Show Example Widgets"))), system_modal_button_(new views::LabelButton( - this, ASCIIToUTF16("Open System Modal Window"))), + this, base::ASCIIToUTF16("Open System Modal Window"))), window_modal_button_(new views::LabelButton( - this, ASCIIToUTF16("Open Window Modal Window"))), + this, base::ASCIIToUTF16("Open Window Modal Window"))), child_modal_button_(new views::LabelButton( - this, ASCIIToUTF16("Open Child Modal Window"))), + this, base::ASCIIToUTF16("Open Child Modal Window"))), transient_button_(new views::LabelButton( - this, ASCIIToUTF16("Open Non-Modal Transient Window"))), + this, base::ASCIIToUTF16("Open Non-Modal Transient Window"))), examples_button_(new views::LabelButton( - this, ASCIIToUTF16("Open Views Examples Window"))), + this, base::ASCIIToUTF16("Open Views Examples Window"))), show_hide_window_button_(new views::LabelButton( - this, ASCIIToUTF16("Show/Hide a Window"))), + this, base::ASCIIToUTF16("Show/Hide a Window"))), show_screensaver_(new views::LabelButton( - this, ASCIIToUTF16("Show the Screensaver [for 5 seconds]"))), + this, base::ASCIIToUTF16("Show the Screensaver [for 5 seconds]"))), show_web_notification_(new views::LabelButton( - this, ASCIIToUTF16("Show a web/app notification"))) { + this, base::ASCIIToUTF16("Show a web/app notification"))) { create_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); panel_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); create_nonresizable_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); @@ -291,7 +292,7 @@ bool WindowTypeLauncher::CanResize() const { } base::string16 WindowTypeLauncher::GetWindowTitle() const { - return ASCIIToUTF16("Examples: Window Builder"); + return base::ASCIIToUTF16("Examples: Window Builder"); } bool WindowTypeLauncher::CanMaximize() const { @@ -340,10 +341,10 @@ void WindowTypeLauncher::ButtonPressed(views::Button* sender, notification.reset(new message_center::Notification( message_center::NOTIFICATION_TYPE_SIMPLE, "id0", - ASCIIToUTF16("Test Shell Web Notification"), - ASCIIToUTF16("Notification message body."), + base::ASCIIToUTF16("Test Shell Web Notification"), + base::ASCIIToUTF16("Notification message body."), gfx::Image(), - ASCIIToUTF16("www.testshell.org"), + base::ASCIIToUTF16("www.testshell.org"), message_center::NotifierId( message_center::NotifierId::APPLICATION, "test-id"), message_center::RichNotificationData(), @@ -379,10 +380,10 @@ void WindowTypeLauncher::ShowContextMenuForView( ui::MenuSourceType source_type) { MenuItemView* root = new MenuItemView(this); root->AppendMenuItem(COMMAND_NEW_WINDOW, - ASCIIToUTF16("New Window"), + base::ASCIIToUTF16("New Window"), MenuItemView::NORMAL); root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN, - ASCIIToUTF16("Toggle FullScreen"), + base::ASCIIToUTF16("Toggle FullScreen"), MenuItemView::NORMAL); // MenuRunner takes ownership of root. menu_runner_.reset(new MenuRunner(root)); diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc index 99a67d4..72a4524 100644 --- a/ash/shell_unittest.cc +++ b/ash/shell_unittest.cc @@ -102,7 +102,7 @@ class ModalWindow : public views::WidgetDelegateView { return true; } virtual base::string16 GetWindowTitle() const OVERRIDE { - return ASCIIToUTF16("Modal Window"); + return base::ASCIIToUTF16("Modal Window"); } virtual ui::ModalType GetModalType() const OVERRIDE { return ui::MODAL_TYPE_SYSTEM; @@ -371,7 +371,7 @@ TEST_F(ShellTest, LockScreenClosesActiveMenu) { SimpleMenuDelegate menu_delegate; scoped_ptr<ui::SimpleMenuModel> menu_model( new ui::SimpleMenuModel(&menu_delegate)); - menu_model->AddItem(0, ASCIIToUTF16("Menu item")); + menu_model->AddItem(0, base::ASCIIToUTF16("Menu item")); views::Widget* widget = ash::Shell::GetPrimaryRootWindowController()-> wallpaper_controller()->widget(); scoped_ptr<views::MenuRunner> menu_runner( diff --git a/ash/system/chromeos/audio/tray_audio.cc b/ash/system/chromeos/audio/tray_audio.cc index 67f7886..b2ce819 100644 --- a/ash/system/chromeos/audio/tray_audio.cc +++ b/ash/system/chromeos/audio/tray_audio.cc @@ -91,17 +91,17 @@ base::string16 GetAudioDeviceName(const chromeos::AudioDevice& device) { case chromeos::AUDIO_TYPE_USB: return l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_AUDIO_USB_DEVICE, - UTF8ToUTF16(device.display_name)); + base::UTF8ToUTF16(device.display_name)); case chromeos::AUDIO_TYPE_BLUETOOTH: return l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_AUDIO_BLUETOOTH_DEVICE, - UTF8ToUTF16(device.display_name)); + base::UTF8ToUTF16(device.display_name)); case chromeos::AUDIO_TYPE_HDMI: return l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_AUDIO_HDMI_DEVICE, - UTF8ToUTF16(device.display_name)); + base::UTF8ToUTF16(device.display_name)); default: - return UTF8ToUTF16(device.display_name); + return base::UTF8ToUTF16(device.display_name); } } diff --git a/ash/system/chromeos/network/network_connect.cc b/ash/system/chromeos/network/network_connect.cc index 81f8f83..2ff387b 100644 --- a/ash/system/chromeos/network/network_connect.cc +++ b/ash/system/chromeos/network/network_connect.cc @@ -436,7 +436,7 @@ void ShowMobileSetup(const std::string& service_path) { kNetworkActivateNotificationId, l10n_util::GetStringUTF16(IDS_NETWORK_ACTIVATION_ERROR_TITLE), l10n_util::GetStringFUTF16(IDS_NETWORK_ACTIVATION_NEEDS_CONNECTION, - UTF8ToUTF16(cellular->name())), + base::UTF8ToUTF16(cellular->name())), ui::ResourceBundle::GetSharedInstance().GetImageNamed( IDR_AURA_UBER_TRAY_CELLULAR_NETWORK_FAILED), ash::system_notifier::kNotifierNetwork, @@ -565,7 +565,7 @@ base::string16 ErrorString(const std::string& error, return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); } return l10n_util::GetStringFUTF16(IDS_NETWORK_UNRECOGNIZED_ERROR, - UTF8ToUTF16(error)); + base::UTF8ToUTF16(error)); } void ShowNetworkSettings(const std::string& service_path) { diff --git a/ash/system/chromeos/network/network_icon.cc b/ash/system/chromeos/network/network_icon.cc index d3c4899..995d8e5 100644 --- a/ash/system/chromeos/network/network_icon.cc +++ b/ash/system/chromeos/network/network_icon.cc @@ -694,33 +694,33 @@ base::string16 GetLabelForNetwork(const chromeos::NetworkState* network, if (network->IsConnectingState()) { return l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_NETWORK_LIST_CONNECTING, - UTF8ToUTF16(network->name())); + base::UTF8ToUTF16(network->name())); } if (activation_state == shill::kActivationStateActivating) { return l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_NETWORK_LIST_ACTIVATING, - UTF8ToUTF16(network->name())); + base::UTF8ToUTF16(network->name())); } // Show "Activate <network>" in list view only. if (activation_state == shill::kActivationStateNotActivated || activation_state == shill::kActivationStatePartiallyActivated) { return l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_NETWORK_LIST_ACTIVATE, - UTF8ToUTF16(network->name())); + base::UTF8ToUTF16(network->name())); } } else { // Show "[Connected to|Connecting to|Activating] <network>" (non-list view). if (network->IsConnectedState()) { - return l10n_util::GetStringFUTF16( - IDS_ASH_STATUS_TRAY_NETWORK_CONNECTED, UTF8ToUTF16(network->name())); + return l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_NETWORK_CONNECTED, + base::UTF8ToUTF16(network->name())); } if (network->IsConnectingState()) { - return l10n_util::GetStringFUTF16( - IDS_ASH_STATUS_TRAY_NETWORK_CONNECTING, UTF8ToUTF16(network->name())); + return l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_NETWORK_CONNECTING, + base::UTF8ToUTF16(network->name())); } if (activation_state == shill::kActivationStateActivating) { - return l10n_util::GetStringFUTF16( - IDS_ASH_STATUS_TRAY_NETWORK_ACTIVATING, UTF8ToUTF16(network->name())); + return l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_NETWORK_ACTIVATING, + base::UTF8ToUTF16(network->name())); } } @@ -728,7 +728,7 @@ base::string16 GetLabelForNetwork(const chromeos::NetworkState* network, if (network->Matches(NetworkTypePattern::Ethernet())) { return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ETHERNET); } else { - return UTF8ToUTF16(network->name()); + return base::UTF8ToUTF16(network->name()); } } diff --git a/ash/system/chromeos/network/network_state_list_detailed_view.cc b/ash/system/chromeos/network/network_state_list_detailed_view.cc index ed2d038..0c0dde3 100644 --- a/ash/system/chromeos/network/network_state_list_detailed_view.cc +++ b/ash/system/chromeos/network/network_state_list_detailed_view.cc @@ -89,8 +89,8 @@ views::View* CreateInfoBubbleLine(const base::string16& text_label, view->SetLayoutManager( new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 1)); view->AddChildView(CreateInfoBubbleLabel(text_label)); - view->AddChildView(CreateInfoBubbleLabel(UTF8ToUTF16(": "))); - view->AddChildView(CreateInfoBubbleLabel(UTF8ToUTF16(text_string))); + view->AddChildView(CreateInfoBubbleLabel(base::UTF8ToUTF16(": "))); + view->AddChildView(CreateInfoBubbleLabel(base::UTF8ToUTF16(text_string))); return view; } @@ -429,7 +429,7 @@ void NetworkStateListDetailedView::CreateNetworkExtra() { std::string toggle_debug_preferred_label = (list_type_ == LIST_TYPE_DEBUG_PREFERRED) ? "Visible" : "Preferred"; toggle_debug_preferred_networks_ = new TrayPopupLabelButton( - this, UTF8ToUTF16(toggle_debug_preferred_label)); + this, base::UTF8ToUTF16(toggle_debug_preferred_label)); bottom_row->AddChildView(toggle_debug_preferred_networks_); } } else { @@ -546,7 +546,7 @@ void NetworkStateListDetailedView::UpdateNetworkList() { if (favorite) { info->image = network_icon::GetImageForDisconnectedNetwork( network_icon::ICON_TYPE_LIST, favorite->type()); - info->label = UTF8ToUTF16(favorite->name()); + info->label = base::UTF8ToUTF16(favorite->name()); } } } diff --git a/ash/system/chromeos/network/network_state_notifier.cc b/ash/system/chromeos/network/network_state_notifier.cc index 79a5d5b..fb90fca 100644 --- a/ash/system/chromeos/network/network_state_notifier.cc +++ b/ash/system/chromeos/network/network_state_notifier.cc @@ -145,7 +145,7 @@ void NetworkStateNotifier::UpdateCellularOutOfCredits( out_of_credits_notify_time_ = base::Time::Now(); base::string16 error_msg = l10n_util::GetStringFUTF16( IDS_NETWORK_OUT_OF_CREDITS_BODY, - UTF8ToUTF16(cellular->name())); + base::UTF8ToUTF16(cellular->name())); ShowErrorNotification( kNetworkOutOfCreditsNotificationId, cellular->type(), @@ -182,7 +182,7 @@ void NetworkStateNotifier::UpdateCellularActivating( ash::network_connect::kNetworkActivateNotificationId, l10n_util::GetStringUTF16(IDS_NETWORK_CELLULAR_ACTIVATED_TITLE), l10n_util::GetStringFUTF16(IDS_NETWORK_CELLULAR_ACTIVATED, - UTF8ToUTF16((cellular->name()))), + base::UTF8ToUTF16((cellular->name()))), icon, system_notifier::kNotifierNetwork, base::Bind(&ash::network_connect::ShowNetworkSettings, @@ -247,7 +247,7 @@ void NetworkStateNotifier::ShowConnectErrorNotification( if (error.empty()) error = l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); } - NET_LOG_ERROR("Connect error notification: " + UTF16ToUTF8(error), + NET_LOG_ERROR("Connect error notification: " + base::UTF16ToUTF8(error), service_path); std::string network_name = @@ -262,15 +262,15 @@ void NetworkStateNotifier::ShowConnectErrorNotification( // network_name should't be empty if network_error_details is set. error_msg = l10n_util::GetStringFUTF16( IDS_NETWORK_CONNECTION_ERROR_MESSAGE_WITH_SERVER_MESSAGE, - UTF8ToUTF16(network_name), error, - UTF8ToUTF16(network_error_details)); + base::UTF8ToUTF16(network_name), error, + base::UTF8ToUTF16(network_error_details)); } else if (network_name.empty()) { error_msg = l10n_util::GetStringFUTF16( IDS_NETWORK_CONNECTION_ERROR_MESSAGE_NO_NAME, error); } else { error_msg = l10n_util::GetStringFUTF16( IDS_NETWORK_CONNECTION_ERROR_MESSAGE, - UTF8ToUTF16(network_name), error); + base::UTF8ToUTF16(network_name), error); } std::string network_type; diff --git a/ash/system/chromeos/network/tray_network.cc b/ash/system/chromeos/network/tray_network.cc index 4d2c82a..1a15a72 100644 --- a/ash/system/chromeos/network/tray_network.cc +++ b/ash/system/chromeos/network/tray_network.cc @@ -84,10 +84,12 @@ class NetworkTrayView : public TrayItemView, // Update accessibility. const NetworkState* connected_network = handler->ConnectedNetworkByType(NetworkTypePattern::NonVirtual()); - if (connected_network) - UpdateConnectionStatus(UTF8ToUTF16(connected_network->name()), true); - else + if (connected_network) { + UpdateConnectionStatus( + base::UTF8ToUTF16(connected_network->name()), true); + } else { UpdateConnectionStatus(base::string16(), false); + } } void UpdateAlignment(ShelfAlignment alignment) { diff --git a/ash/system/chromeos/network/tray_sms.cc b/ash/system/chromeos/network/tray_sms.cc index a358d3e..f1e1e56 100644 --- a/ash/system/chromeos/network/tray_sms.cc +++ b/ash/system/chromeos/network/tray_sms.cc @@ -96,12 +96,12 @@ class TraySms::SmsMessageView : public views::View, index_(index) { number_label_ = new views::Label( l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_SMS_NUMBER, - UTF8ToUTF16(number))); + base::UTF8ToUTF16(number))); number_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); number_label_->SetFont( number_label_->font().DeriveFont(0, gfx::Font::BOLD)); - message_label_ = new views::Label(UTF8ToUTF16(message)); + message_label_ = new views::Label(base::UTF8ToUTF16(message)); message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); message_label_->SetMultiLine(true); diff --git a/ash/system/chromeos/power/power_status.cc b/ash/system/chromeos/power/power_status.cc index a014387b..57210f9 100644 --- a/ash/system/chromeos/power/power_status.cc +++ b/ash/system/chromeos/power/power_status.cc @@ -262,7 +262,7 @@ base::string16 PowerStatus::GetAccessibleNameString() const { int hour = 0, min = 0; PowerStatus::SplitTimeIntoHoursAndMinutes(time, &hour, &min); base::string16 minute = min < 10 ? - ASCIIToUTF16("0") + base::IntToString16(min) : + base::ASCIIToUTF16("0") + base::IntToString16(min) : base::IntToString16(min); battery_time_accessible = l10n_util::GetStringFUTF16( @@ -273,7 +273,7 @@ base::string16 PowerStatus::GetAccessibleNameString() const { } return battery_time_accessible.empty() ? battery_percentage_accessible : - battery_percentage_accessible + ASCIIToUTF16(". ") + + battery_percentage_accessible + base::ASCIIToUTF16(". ") + battery_time_accessible; } diff --git a/ash/system/chromeos/power/power_status_view.cc b/ash/system/chromeos/power/power_status_view.cc index f0fe4b1..24b7fe6 100644 --- a/ash/system/chromeos/power/power_status_view.cc +++ b/ash/system/chromeos/power/power_status_view.cc @@ -130,7 +130,7 @@ void PowerStatusView::UpdateTextForDefaultView() { int hour = 0, min = 0; PowerStatus::SplitTimeIntoHoursAndMinutes(time, &hour, &min); base::string16 minute = min < 10 ? - ASCIIToUTF16("0") + base::IntToString16(min) : + base::ASCIIToUTF16("0") + base::IntToString16(min) : base::IntToString16(min); battery_time_status = l10n_util::GetStringFUTF16( @@ -142,7 +142,7 @@ void PowerStatusView::UpdateTextForDefaultView() { } } battery_percentage = battery_time_status.empty() ? - battery_percentage : battery_percentage + ASCIIToUTF16(" - "); + battery_percentage : battery_percentage + base::ASCIIToUTF16(" - "); } percentage_label_->SetVisible(!battery_percentage.empty()); percentage_label_->SetText(battery_percentage); diff --git a/ash/system/chromeos/settings/tray_settings.cc b/ash/system/chromeos/settings/tray_settings.cc index 8868b7c..432b6aa 100644 --- a/ash/system/chromeos/settings/tray_settings.cc +++ b/ash/system/chromeos/settings/tray_settings.cc @@ -109,7 +109,7 @@ class SettingsDefaultView : public ActionableView, return; base::string16 accessible_name = label_ ? - label_->text() + ASCIIToUTF16(", ") + + label_->text() + base::ASCIIToUTF16(", ") + PowerStatus::Get()->GetAccessibleNameString() : PowerStatus::Get()->GetAccessibleNameString(); SetAccessibleName(accessible_name); diff --git a/ash/system/chromeos/tray_display.cc b/ash/system/chromeos/tray_display.cc index 35627e1..f468adc 100644 --- a/ash/system/chromeos/tray_display.cc +++ b/ash/system/chromeos/tray_display.cc @@ -39,7 +39,8 @@ DisplayManager* GetDisplayManager() { } base::string16 GetDisplayName(int64 display_id) { - return UTF8ToUTF16(GetDisplayManager()->GetDisplayNameForId(display_id)); + return base::UTF8ToUTF16( + GetDisplayManager()->GetDisplayNameForId(display_id)); } base::string16 GetDisplaySize(int64 display_id) { @@ -55,7 +56,7 @@ base::string16 GetDisplaySize(int64 display_id) { return base::string16(); DCHECK(display->is_valid()); - return UTF8ToUTF16(display->size().ToString()); + return base::UTF8ToUTF16(display->size().ToString()); } // Returns 1-line information for the specified display, like @@ -171,7 +172,7 @@ class DisplayView : public internal::ActionableView { if (tray_message.empty() && display_message.empty()) return false; - *tooltip = tray_message + ASCIIToUTF16("\n") + display_message; + *tooltip = tray_message + base::ASCIIToUTF16("\n") + display_message; return true; } diff --git a/ash/system/chromeos/tray_display_unittest.cc b/ash/system/chromeos/tray_display_unittest.cc index 921ff7e..647c519 100644 --- a/ash/system/chromeos/tray_display_unittest.cc +++ b/ash/system/chromeos/tray_display_unittest.cc @@ -36,12 +36,12 @@ base::string16 GetTooltipText(const base::string16& headline, } else { lines.push_back(l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_SINGLE_DISPLAY, - name1, UTF8ToUTF16(data1))); + name1, base::UTF8ToUTF16(data1))); } if (!name2.empty()) { lines.push_back(l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_SINGLE_DISPLAY, - name2, UTF8ToUTF16(data2))); + name2, base::UTF8ToUTF16(data2))); } return JoinString(lines, '\n'); } @@ -54,19 +54,19 @@ base::string16 GetMirroredTooltipText(const base::string16& headline, base::string16 GetFirstDisplayName() { DisplayManager* display_manager = Shell::GetInstance()->display_manager(); - return UTF8ToUTF16(display_manager->GetDisplayNameForId( + return base::UTF8ToUTF16(display_manager->GetDisplayNameForId( display_manager->first_display_id())); } base::string16 GetSecondDisplayName() { - return UTF8ToUTF16( + return base::UTF8ToUTF16( Shell::GetInstance()->display_manager()->GetDisplayNameForId( ScreenAsh::GetSecondaryDisplay().id())); } base::string16 GetMirroredDisplayName() { DisplayManager* display_manager = Shell::GetInstance()->display_manager(); - return UTF8ToUTF16(display_manager->GetDisplayNameForId( + return base::UTF8ToUTF16(display_manager->GetDisplayNameForId( display_manager->mirrored_display_id())); } @@ -232,7 +232,7 @@ TEST_F(TrayDisplayTest, InternalDisplayResized) { EXPECT_TRUE(IsDisplayVisibleInTray()); base::string16 internal_info = l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_SINGLE_DISPLAY, - GetFirstDisplayName(), UTF8ToUTF16("600x600")); + GetFirstDisplayName(), base::UTF8ToUTF16("600x600")); EXPECT_EQ(internal_info, GetTrayDisplayText()); EXPECT_EQ(GetTooltipText(base::string16(), GetFirstDisplayName(), "600x600", base::string16(), std::string()), @@ -295,7 +295,7 @@ TEST_F(TrayDisplayTest, ExternalDisplayResized) { l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATED_NAME, GetSecondDisplayName(), - UTF8ToUTF16(secondary_display.size().ToString()))); + base::UTF8ToUTF16(secondary_display.size().ToString()))); EXPECT_EQ(expected, GetTrayDisplayText()); EXPECT_EQ(GetTooltipText(expected, GetFirstDisplayName(), "400x400", GetSecondDisplayName(), "300x300"), @@ -329,10 +329,10 @@ TEST_F(TrayDisplayTest, OverscanDisplay) { IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATED_NAME, - GetSecondDisplayName(), UTF8ToUTF16("286x286"))); + GetSecondDisplayName(), base::UTF8ToUTF16("286x286"))); std::string second_data = l10n_util::GetStringFUTF8( IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATION, - UTF8ToUTF16("286x286"), overscan); + base::UTF8ToUTF16("286x286"), overscan); EXPECT_EQ(GetTooltipText(headline, GetFirstDisplayName(), "400x400", GetSecondDisplayName(), second_data), GetTrayDisplayTooltipText()); @@ -347,7 +347,7 @@ TEST_F(TrayDisplayTest, OverscanDisplay) { GetSecondDisplayName(), overscan)); second_data = l10n_util::GetStringFUTF8( IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATION, - UTF8ToUTF16("300x300"), overscan); + base::UTF8ToUTF16("300x300"), overscan); EXPECT_EQ(GetTooltipText(headline, GetFirstDisplayName(), "400x400", GetSecondDisplayName(), second_data), GetTrayDisplayTooltipText()); @@ -362,7 +362,7 @@ TEST_F(TrayDisplayTest, UpdateDuringDisplayConfigurationChange) { EXPECT_TRUE(IsDisplayVisibleInTray()); base::string16 internal_info = l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_SINGLE_DISPLAY, - GetFirstDisplayName(), UTF8ToUTF16("600x600")); + GetFirstDisplayName(), base::UTF8ToUTF16("600x600")); EXPECT_EQ(internal_info, GetTrayDisplayText()); EXPECT_EQ(GetTooltipText(base::string16(), GetFirstDisplayName(), "600x600", base::string16(), std::string()), @@ -425,7 +425,7 @@ TEST_F(TrayDisplayTest, DisplayNotifications) { EXPECT_EQ( l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED, - GetFirstDisplayName(), UTF8ToUTF16("600x600")), + GetFirstDisplayName(), base::UTF8ToUTF16("600x600")), GetDisplayNotificationText()); EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty()); @@ -435,7 +435,7 @@ TEST_F(TrayDisplayTest, DisplayNotifications) { EXPECT_EQ( l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED, - GetFirstDisplayName(), UTF8ToUTF16("400x400")), + GetFirstDisplayName(), base::UTF8ToUTF16("400x400")), GetDisplayNotificationText()); EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty()); @@ -479,7 +479,7 @@ TEST_F(TrayDisplayTest, DisplayNotifications) { EXPECT_EQ( l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_DISPLAY_RESOLUTION_CHANGED, - GetFirstDisplayName(), UTF8ToUTF16("600x600")), + GetFirstDisplayName(), base::UTF8ToUTF16("600x600")), GetDisplayNotificationText()); EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty()); diff --git a/ash/system/date/date_view.cc b/ash/system/date/date_view.cc index 63f3af3..5e89f73 100644 --- a/ash/system/date/date_view.cc +++ b/ash/system/date/date_view.cc @@ -158,7 +158,7 @@ void DateView::UpdateTimeFormat() { void DateView::UpdateTextInternal(const base::Time& now) { SetAccessibleName( base::TimeFormatFriendlyDate(now) + - ASCIIToUTF16(", ") + + base::ASCIIToUTF16(", ") + base::TimeFormatTimeOfDayWithHourClockType( now, hour_type_, base::kKeepAmPm)); date_label_->SetText( @@ -223,7 +223,7 @@ void TimeView::UpdateTextInternal(const base::Time& now) { horizontal_label_->SetTooltipText(base::TimeFormatFriendlyDate(now)); // Calculate vertical clock layout labels. - size_t colon_pos = current_time.find(ASCIIToUTF16(":")); + size_t colon_pos = current_time.find(base::ASCIIToUTF16(":")); base::string16 hour = current_time.substr(0, colon_pos); base::string16 minute = current_time.substr(colon_pos + 1); @@ -231,7 +231,7 @@ void TimeView::UpdateTextInternal(const base::Time& now) { if (hour.length() == 1 && hour_type_ == base::k24HourClock && !base::i18n::IsRTL()) - hour = ASCIIToUTF16("0") + hour; + hour = base::ASCIIToUTF16("0") + hour; vertical_label_hours_->SetText(hour); vertical_label_minutes_->SetText(minute); diff --git a/ash/system/drive/tray_drive.cc b/ash/system/drive/tray_drive.cc index b246d52..40a64c3 100644 --- a/ash/system/drive/tray_drive.cc +++ b/ash/system/drive/tray_drive.cc @@ -162,9 +162,11 @@ class DriveDetailedView : public TrayDetailsView, label_container_->SetLayoutManager(new views::BoxLayout( views::BoxLayout::kVertical, 0, 0, kVerticalPadding)); #if defined(OS_POSIX) - base::string16 file_label = UTF8ToUTF16(file_path.BaseName().value()); + base::string16 file_label = + base::UTF8ToUTF16(file_path.BaseName().value()); #elif defined(OS_WIN) - base::string16 file_label = WideToUTF16(file_path.BaseName().value()); + base::string16 file_label = + base::WideToUTF16(file_path.BaseName().value()); #endif views::Label* label = new views::Label(file_label); label->SetHorizontalAlignment(gfx::ALIGN_LEFT); diff --git a/ash/system/ime/tray_ime.cc b/ash/system/ime/tray_ime.cc index c558e27..0a87998 100644 --- a/ash/system/ime/tray_ime.cc +++ b/ash/system/ime/tray_ime.cc @@ -203,7 +203,8 @@ TrayIME::~TrayIME() { void TrayIME::UpdateTrayLabel(const IMEInfo& current, size_t count) { if (tray_label_) { if (current.third_party) { - tray_label_->label()->SetText(current.short_name + UTF8ToUTF16("*")); + tray_label_->label()->SetText( + current.short_name + base::UTF8ToUTF16("*")); } else { tray_label_->label()->SetText(current.short_name); } diff --git a/ash/system/monitor/tray_monitor.cc b/ash/system/monitor/tray_monitor.cc index bc3d532..fc87a3a 100644 --- a/ash/system/monitor/tray_monitor.cc +++ b/ash/system/monitor/tray_monitor.cc @@ -65,11 +65,13 @@ void TrayMonitor::OnGotHandles(const std::list<base::ProcessHandle>& handles) { std::string output; base::string16 free_bytes = ui::FormatBytes(static_cast<int64>(mem_info.free) * 1024); - output = base::StringPrintf("free: %s", UTF16ToUTF8(free_bytes).c_str()); + output = base::StringPrintf("free: %s", + base::UTF16ToUTF8(free_bytes).c_str()); #if defined(OS_CHROMEOS) if (mem_info.gem_size != -1) { base::string16 gem_size = ui::FormatBytes(mem_info.gem_size); - output += base::StringPrintf(" gmem: %s", UTF16ToUTF8(gem_size).c_str()); + output += base::StringPrintf(" gmem: %s", + base::UTF16ToUTF8(gem_size).c_str()); if (mem_info.gem_objects != -1) output += base::StringPrintf(" gobjects: %d", mem_info.gem_objects); } @@ -88,9 +90,9 @@ void TrayMonitor::OnGotHandles(const std::list<base::ProcessHandle>& handles) { base::string16 shared_size = ui::FormatBytes(total_shared_bytes); output += base::StringPrintf("\nGPU private: %s shared: %s", - UTF16ToUTF8(private_size).c_str(), - UTF16ToUTF8(shared_size).c_str()); - label_->SetText(UTF8ToUTF16(output)); + base::UTF16ToUTF8(private_size).c_str(), + base::UTF16ToUTF8(shared_size).c_str()); + label_->SetText(base::UTF8ToUTF16(output)); refresh_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kRefreshTimeoutMs), this, &TrayMonitor::OnTimer); diff --git a/ash/system/session_length_limit/tray_session_length_limit.cc b/ash/system/session_length_limit/tray_session_length_limit.cc index 81425af..43b4030 100644 --- a/ash/system/session_length_limit/tray_session_length_limit.cc +++ b/ash/system/session_length_limit/tray_session_length_limit.cc @@ -63,7 +63,7 @@ base::string16 IntToTwoDigitString(int value) { DCHECK_GE(value, 0); DCHECK_LE(value, 99); if (value < 10) - return ASCIIToUTF16("0") + base::IntToString16(value); + return base::ASCIIToUTF16("0") + base::IntToString16(value); return base::IntToString16(value); } diff --git a/ash/system/tray/system_tray_unittest.cc b/ash/system/tray/system_tray_unittest.cc index 779975a..03ee4e4 100644 --- a/ash/system/tray/system_tray_unittest.cc +++ b/ash/system/tray/system_tray_unittest.cc @@ -46,21 +46,22 @@ class TestItem : public SystemTrayItem { tray_view_ = new views::View; // Add a label so it has non-zero width. tray_view_->SetLayoutManager(new views::FillLayout); - tray_view_->AddChildView(new views::Label(UTF8ToUTF16("Tray"))); + tray_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Tray"))); return tray_view_; } virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE { default_view_ = new views::View; default_view_->SetLayoutManager(new views::FillLayout); - default_view_->AddChildView(new views::Label(UTF8ToUTF16("Default"))); + default_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Default"))); return default_view_; } virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE { detailed_view_ = new views::View; detailed_view_->SetLayoutManager(new views::FillLayout); - detailed_view_->AddChildView(new views::Label(UTF8ToUTF16("Detailed"))); + detailed_view_->AddChildView( + new views::Label(base::UTF8ToUTF16("Detailed"))); return detailed_view_; } diff --git a/ash/system/user/login_status.cc b/ash/system/user/login_status.cc index 93678fd..3172cd7 100644 --- a/ash/system/user/login_status.cc +++ b/ash/system/user/login_status.cc @@ -42,8 +42,9 @@ base::string16 GetLocalizedSignOutStringForStatus(LoginStatus status, // framework does not evaluate escape sequences, the \n need to be explicitly // handled. Depending on the value of |multiline|, actual line breaks or // spaces are substituted. - base::string16 newline = multiline ? ASCIIToUTF16("\n") : ASCIIToUTF16(" "); - ReplaceSubstringsAfterOffset(&message, 0, ASCIIToUTF16("\\n"), newline); + base::string16 newline = multiline ? base::ASCIIToUTF16("\n") + : base::ASCIIToUTF16(" "); + ReplaceSubstringsAfterOffset(&message, 0, base::ASCIIToUTF16("\\n"), newline); return message; } diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc index ff14fe1..3d9e3ae 100644 --- a/ash/system/user/tray_user.cc +++ b/ash/system/user/tray_user.cc @@ -485,7 +485,7 @@ PublicAccountUserDetails::PublicAccountUserDetails(SystemTrayItem* owner, base::RemoveChars(display_name, kDisplayNameMark, &display_name); display_name = kDisplayNameMark[0] + display_name + kDisplayNameMark[0]; // Retrieve the domain managing the device and wrap it with markers. - base::string16 domain = UTF8ToUTF16( + base::string16 domain = base::UTF8ToUTF16( Shell::GetInstance()->system_tray_delegate()->GetEnterpriseDomain()); base::RemoveChars(domain, kDisplayNameMark, &domain); base::i18n::WrapStringWithLTRFormatting(&domain); @@ -553,7 +553,8 @@ void PublicAccountUserDetails::Layout() { // Position the link after the label text, separated by a space. If it does // not fit onto the last line of the text, wrap the link onto its own line. const gfx::Size last_line_size = lines_.back()->GetStringSize(); - const int space_width = gfx::GetStringWidth(ASCIIToUTF16(" "), font_list); + const int space_width = + gfx::GetStringWidth(base::ASCIIToUTF16(" "), font_list); const gfx::Size link_size = learn_more_->GetPreferredSize(); if (contents_area.width() - last_line_size.width() >= space_width + link_size.width()) { @@ -592,7 +593,8 @@ void PublicAccountUserDetails::CalculatePreferredSize(SystemTrayItem* owner, int used_width) { const gfx::FontList font_list; const gfx::Size link_size = learn_more_->GetPreferredSize(); - const int space_width = gfx::GetStringWidth(ASCIIToUTF16(" "), font_list); + const int space_width = + gfx::GetStringWidth(base::ASCIIToUTF16(" "), font_list); const gfx::Insets insets = GetInsets(); views::TrayBubbleView* bubble_view = owner->system_tray()->GetSystemBubble()->bubble_view(); @@ -912,7 +914,7 @@ void UserView::AddUserCard(SystemTrayItem* owner, user::LoginStatus login) { login == user::LOGGED_IN_LOCALLY_MANAGED ? bundle.GetLocalizedString( IDS_ASH_STATUS_TRAY_LOCALLY_MANAGED_LABEL) : - UTF8ToUTF16(delegate->GetUserEmail(multiprofile_index_)); + base::UTF8ToUTF16(delegate->GetUserEmail(multiprofile_index_)); if (!user_email_string.empty()) { additional = new views::Label(user_email_string); additional->SetFontList( diff --git a/ash/system/web_notification/web_notification_tray_unittest.cc b/ash/system/web_notification/web_notification_tray_unittest.cc index b64e2b8..34fe4a5 100644 --- a/ash/system/web_notification/web_notification_tray_unittest.cc +++ b/ash/system/web_notification/web_notification_tray_unittest.cc @@ -77,7 +77,7 @@ class TestItem : public SystemTrayItem { virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE { views::View* default_view = new views::View; default_view->SetLayoutManager(new views::FillLayout); - default_view->AddChildView(new views::Label(UTF8ToUTF16("Default"))); + default_view->AddChildView(new views::Label(base::UTF8ToUTF16("Default"))); return default_view; } @@ -108,10 +108,10 @@ class WebNotificationTrayTest : public test::AshTestBase { notification.reset(new message_center::Notification( message_center::NOTIFICATION_TYPE_SIMPLE, id, - ASCIIToUTF16("Test Web Notification"), - ASCIIToUTF16("Notification message body."), + base::ASCIIToUTF16("Test Web Notification"), + base::ASCIIToUTF16("Notification message body."), gfx::Image(), - ASCIIToUTF16("www.test.org"), + base::ASCIIToUTF16("www.test.org"), message_center::NotifierId(), message_center::RichNotificationData(), NULL /* delegate */)); @@ -124,10 +124,10 @@ class WebNotificationTrayTest : public test::AshTestBase { notification.reset(new message_center::Notification( message_center::NOTIFICATION_TYPE_SIMPLE, new_id, - ASCIIToUTF16("Updated Web Notification"), - ASCIIToUTF16("Updated message body."), + base::ASCIIToUTF16("Updated Web Notification"), + base::ASCIIToUTF16("Updated message body."), gfx::Image(), - ASCIIToUTF16("www.test.org"), + base::ASCIIToUTF16("www.test.org"), message_center::NotifierId(), message_center::RichNotificationData(), NULL /* delegate */)); diff --git a/ash/test/test_session_state_delegate.cc b/ash/test/test_session_state_delegate.cc index a0d8f19..171cd43d 100644 --- a/ash/test/test_session_state_delegate.cc +++ b/ash/test/test_session_state_delegate.cc @@ -115,7 +115,7 @@ void TestSessionStateDelegate::SetUserAddingScreenRunning( const base::string16 TestSessionStateDelegate::GetUserDisplayName( MultiProfileIndex index) const { - return UTF8ToUTF16("Über tray Über tray Über tray Über tray"); + return base::UTF8ToUTF16("Über tray Über tray Über tray Über tray"); } const std::string TestSessionStateDelegate::GetUserEmail( diff --git a/ash/tooltips/tooltip_controller_unittest.cc b/ash/tooltips/tooltip_controller_unittest.cc index 0b02047..25873da 100644 --- a/ash/tooltips/tooltip_controller_unittest.cc +++ b/ash/tooltips/tooltip_controller_unittest.cc @@ -102,14 +102,14 @@ TEST_F(TooltipControllerTest, HideTooltipWhenCursorHidden) { scoped_ptr<views::Widget> widget(CreateNewWidgetOn(0)); TooltipTestView* view = new TooltipTestView; AddViewToWidgetAndResize(widget.get(), view); - view->set_tooltip_text(ASCIIToUTF16("Tooltip Text")); + view->set_tooltip_text(base::ASCIIToUTF16("Tooltip Text")); EXPECT_EQ(base::string16(), helper_->GetTooltipText()); EXPECT_EQ(NULL, helper_->GetTooltipWindow()); aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); generator.MoveMouseRelativeTo(widget->GetNativeView(), view->bounds().CenterPoint()); - base::string16 expected_tooltip = ASCIIToUTF16("Tooltip Text"); + base::string16 expected_tooltip = base::ASCIIToUTF16("Tooltip Text"); // Fire tooltip timer so tooltip becomes visible. helper_->FireTooltipTimer(); @@ -138,14 +138,14 @@ TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) { 0, gfx::Rect(10, 10, 100, 100))); TooltipTestView* view1 = new TooltipTestView; AddViewToWidgetAndResize(widget1.get(), view1); - view1->set_tooltip_text(ASCIIToUTF16("Tooltip Text for view 1")); + view1->set_tooltip_text(base::ASCIIToUTF16("Tooltip Text for view 1")); EXPECT_EQ(widget1->GetNativeView()->GetRootWindow(), root_windows[0]); scoped_ptr<views::Widget> widget2(CreateNewWidgetWithBoundsOn( 1, gfx::Rect(1200, 10, 100, 100))); TooltipTestView* view2 = new TooltipTestView; AddViewToWidgetAndResize(widget2.get(), view2); - view2->set_tooltip_text(ASCIIToUTF16("Tooltip Text for view 2")); + view2->set_tooltip_text(base::ASCIIToUTF16("Tooltip Text for view 2")); EXPECT_EQ(widget2->GetNativeView()->GetRootWindow(), root_windows[1]); // Show tooltip on second display. diff --git a/ash/touch/touch_hud_debug.cc b/ash/touch/touch_hud_debug.cc index ea5d336..4d362c4 100644 --- a/ash/touch/touch_hud_debug.cc +++ b/ash/touch/touch_hud_debug.cc @@ -453,7 +453,7 @@ void TouchHudDebug::UpdateTouchPointLabel(int index) { GetTouchEventLabel(touch_status), touch_position.ToString().c_str(), touch_radius); - touch_labels_[index]->SetText(UTF8ToUTF16(string)); + touch_labels_[index]->SetText(base::UTF8ToUTF16(string)); } void TouchHudDebug::OnTouchEvent(ui::TouchEvent* event) { |