summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/views')
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc12
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc3
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h2
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc15
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h2
-rw-r--r--chrome/browser/ui/views/browser_actions_container.cc2
-rw-r--r--chrome/browser/ui/views/compact_nav/compact_location_bar_view.cc3
-rw-r--r--chrome/browser/ui/views/compact_nav/compact_navigation_bar.cc6
-rw-r--r--chrome/browser/ui/views/compact_nav/compact_options_bar.cc4
-rw-r--r--chrome/browser/ui/views/default_search_view.cc4
-rw-r--r--chrome/browser/ui/views/download/download_item_view.cc8
-rw-r--r--chrome/browser/ui/views/download/download_item_view.h5
-rw-r--r--chrome/browser/ui/views/edit_search_engine_dialog.cc5
-rw-r--r--chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc2
-rw-r--r--chrome/browser/ui/views/find_bar_view.cc8
-rw-r--r--chrome/browser/ui/views/first_run_search_engine_view.cc4
-rw-r--r--chrome/browser/ui/views/location_bar/content_setting_image_view.cc2
-rw-r--r--chrome/browser/ui/views/location_bar/location_icon_view.cc8
-rw-r--r--chrome/browser/ui/views/location_bar/page_action_image_view.cc2
-rw-r--r--chrome/browser/ui/views/location_bar/star_view.cc6
-rw-r--r--chrome/browser/ui/views/location_bar/star_view.h3
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view.cc4
-rw-r--r--chrome/browser/ui/views/reload_button.cc4
-rw-r--r--chrome/browser/ui/views/reload_button.h3
-rw-r--r--chrome/browser/ui/views/tabs/base_tab.cc6
-rw-r--r--chrome/browser/ui/views/tabs/base_tab.h3
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc20
-rw-r--r--chrome/browser/ui/views/wrench_menu.cc4
-rw-r--r--chrome/browser/ui/views/wrench_menu.h2
29 files changed, 68 insertions, 84 deletions
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 2722199..22c4bf7 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -148,11 +148,11 @@ class BookmarkButton : public views::TextButton {
}
virtual bool GetTooltipText(const gfx::Point& p,
- std::wstring* tooltip) OVERRIDE {
+ string16* tooltip) OVERRIDE {
gfx::Point location(p);
ConvertPointToScreen(this, &location);
- *tooltip = BookmarkBarView::CreateToolTipForURLAndTitle(location, url_,
- text(), profile_);
+ *tooltip = WideToUTF16Hack(BookmarkBarView::CreateToolTipForURLAndTitle(
+ location, url_, text(), profile_));
return !tooltip->empty();
}
@@ -198,9 +198,9 @@ class BookmarkFolderButton : public views::MenuButton {
}
virtual bool GetTooltipText(const gfx::Point& p,
- std::wstring* tooltip) OVERRIDE {
+ string16* tooltip) OVERRIDE {
if (text_size_.width() > GetTextBounds().width())
- *tooltip = UTF16ToWide(text_);
+ *tooltip = text_;
return !tooltip->empty();
}
@@ -1250,7 +1250,7 @@ views::TextButton* BookmarkBarView::CreateSyncErrorButton() {
// The tooltip is the only way we have to display text explaining the error
// to the user.
sync_error_button->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)));
+ l10n_util::GetStringUTF16(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC));
sync_error_button->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ACCNAME_SYNC_ERROR_BUTTON));
sync_error_button->SetIcon(
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
index 5658705..6832c7e 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc
@@ -83,8 +83,7 @@ void BookmarkMenuController::SetPageNavigator(PageNavigator* navigator) {
menu_delegate_->SetPageNavigator(navigator);
}
-std::wstring BookmarkMenuController::GetTooltipText(int id,
- const gfx::Point& p) {
+string16 BookmarkMenuController::GetTooltipText(int id, const gfx::Point& p) {
return menu_delegate_->GetTooltipText(id, p);
}
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
index 4cfda5c..3f0591f 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h
@@ -77,7 +77,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver,
void set_observer(Observer* observer) { observer_ = observer; }
// MenuDelegate methods.
- virtual std::wstring GetTooltipText(int id, const gfx::Point& p);
+ virtual string16 GetTooltipText(int id, const gfx::Point& p) OVERRIDE;
virtual bool IsTriggerableEvent(views::MenuItemView* view,
const views::MouseEvent& e);
virtual void ExecuteCommand(int id, int mouse_event_flags);
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
index 35073ff..1ec41f4 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
@@ -95,16 +95,17 @@ void BookmarkMenuDelegate::SetActiveMenu(const BookmarkNode* node,
menu_ = node_to_menu_map_[node];
}
-std::wstring BookmarkMenuDelegate::GetTooltipText(
- int id,
- const gfx::Point& screen_loc) {
+string16 BookmarkMenuDelegate::GetTooltipText(int id,
+ const gfx::Point& screen_loc) {
DCHECK(menu_id_to_node_map_.find(id) != menu_id_to_node_map_.end());
const BookmarkNode* node = menu_id_to_node_map_[id];
- if (node->is_url())
- return BookmarkBarView::CreateToolTipForURLAndTitle(
- screen_loc, node->url(), UTF16ToWide(node->GetTitle()), profile_);
- return std::wstring();
+ if (node->is_url()) {
+ return WideToUTF16Hack(BookmarkBarView::CreateToolTipForURLAndTitle(
+ screen_loc, node->url(),
+ UTF16ToWide(node->GetTitle()), profile_));
+ }
+ return string16();
}
bool BookmarkMenuDelegate::IsTriggerableEvent(views::MenuItemView* menu,
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
index 134cf29..ef4330d 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
@@ -85,7 +85,7 @@ class BookmarkMenuDelegate : public BaseBookmarkModelObserver,
bool is_mutating_model() const { return is_mutating_model_; }
// MenuDelegate like methods (see class description for details).
- std::wstring GetTooltipText(int id, const gfx::Point& p);
+ string16 GetTooltipText(int id, const gfx::Point& p);
bool IsTriggerableEvent(views::MenuItemView* menu,
const views::MouseEvent& e);
void ExecuteCommand(int id, int mouse_event_flags);
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc
index f49cb4c..db456de 100644
--- a/chrome/browser/ui/views/browser_actions_container.cc
+++ b/chrome/browser/ui/views/browser_actions_container.cc
@@ -172,7 +172,7 @@ void BrowserActionButton::UpdateState() {
string16 name = UTF8ToUTF16(browser_action()->GetTitle(tab_id));
if (name.empty())
name = UTF8ToUTF16(extension()->name());
- SetTooltipText(UTF16ToWideHack(name));
+ SetTooltipText(name);
SetAccessibleName(name);
parent()->SchedulePaint();
}
diff --git a/chrome/browser/ui/views/compact_nav/compact_location_bar_view.cc b/chrome/browser/ui/views/compact_nav/compact_location_bar_view.cc
index 98185e8..31aca7f 100644
--- a/chrome/browser/ui/views/compact_nav/compact_location_bar_view.cc
+++ b/chrome/browser/ui/views/compact_nav/compact_location_bar_view.cc
@@ -120,8 +120,7 @@ void CompactLocationBarView::Init() {
reload_button_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN |
ui::EF_MIDDLE_BUTTON_DOWN);
reload_button_->set_tag(IDC_RELOAD);
- reload_button_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD)));
+ reload_button_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD));
reload_button_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD));
reload_button_->set_id(VIEW_ID_RELOAD_BUTTON);
diff --git a/chrome/browser/ui/views/compact_nav/compact_navigation_bar.cc b/chrome/browser/ui/views/compact_nav/compact_navigation_bar.cc
index b161300..adec663 100644
--- a/chrome/browser/ui/views/compact_nav/compact_navigation_bar.cc
+++ b/chrome/browser/ui/views/compact_nav/compact_navigation_bar.cc
@@ -79,8 +79,7 @@ void CompactNavigationBar::Init() {
back_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN |
ui::EF_MIDDLE_BUTTON_DOWN);
back_->set_tag(IDC_BACK);
- back_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_BACK)));
+ back_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_BACK));
back_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK));
back_->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
views::ImageButton::ALIGN_MIDDLE);
@@ -95,8 +94,7 @@ void CompactNavigationBar::Init() {
forward_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN |
ui::EF_MIDDLE_BUTTON_DOWN);
forward_->set_tag(IDC_FORWARD);
- forward_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD)));
+ forward_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD));
forward_->SetAccessibleName(l10n_util::GetStringUTF16((IDS_ACCNAME_FORWARD)));
forward_->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
views::ImageButton::ALIGN_MIDDLE);
diff --git a/chrome/browser/ui/views/compact_nav/compact_options_bar.cc b/chrome/browser/ui/views/compact_nav/compact_options_bar.cc
index 5ba008f..1e2548b 100644
--- a/chrome/browser/ui/views/compact_nav/compact_options_bar.cc
+++ b/chrome/browser/ui/views/compact_nav/compact_options_bar.cc
@@ -46,9 +46,9 @@ void CompactOptionsBar::Init() {
app_menu_->set_border(NULL);
app_menu_->EnableCanvasFlippingForRTLUI(true);
app_menu_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_APP));
- app_menu_->SetTooltipText(UTF16ToWide(l10n_util::GetStringFUTF16(
+ app_menu_->SetTooltipText(l10n_util::GetStringFUTF16(
IDS_APPMENU_TOOLTIP,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))));
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
app_menu_->set_id(VIEW_ID_APP_MENU);
AddChildView(app_menu_);
diff --git a/chrome/browser/ui/views/default_search_view.cc b/chrome/browser/ui/views/default_search_view.cc
index e54c10d..6f7e30c 100644
--- a/chrome/browser/ui/views/default_search_view.cc
+++ b/chrome/browser/ui/views/default_search_view.cc
@@ -83,7 +83,7 @@ views::View* CreateProviderLogo(
SkBitmap* logo_bmp =
ResourceBundle::GetSharedInstance().GetBitmapNamed(logo_id);
logo_image->SetImage(logo_bmp);
- logo_image->SetTooltipText(short_name);
+ logo_image->SetTooltipText(WideToUTF16Hack(short_name));
logo_view = logo_image;
} else {
// No logo -- show a text label.
@@ -92,7 +92,7 @@ views::View* CreateProviderLogo(
logo_label->SetFont(logo_label->font().DeriveFont(3, gfx::Font::BOLD));
logo_label->SetHorizontalAlignment(views::Label::ALIGN_CENTER);
// Tooltip text provides accessibility for low-vision users.
- logo_label->SetTooltipText(short_name);
+ logo_label->SetTooltipText(WideToUTF16Hack(short_name));
logo_view = logo_label;
}
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 58c42d3..02010f7 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -180,8 +180,7 @@ DownloadItemView::DownloadItemView(DownloadItem* download,
dangerous_mode_body_image_set_ = dangerous_mode_body_image_set;
LoadIcon();
- tooltip_text_ =
- UTF16ToWide(download_->GetFileNameToReportUser().LossyDisplayName());
+ tooltip_text_ = download_->GetFileNameToReportUser().LossyDisplayName();
font_ = ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont);
box_height_ = std::max<int>(2 * kVerticalPadding + font_.GetHeight() +
@@ -581,7 +580,7 @@ bool DownloadItemView::OnKeyPressed(const views::KeyEvent& event) {
}
bool DownloadItemView::GetTooltipText(const gfx::Point& p,
- std::wstring* tooltip) {
+ string16* tooltip) {
if (tooltip_text_.empty())
return false;
@@ -997,8 +996,7 @@ void DownloadItemView::ClearDangerousMode() {
// We need to load the icon now that the download_ has the real path.
LoadIcon();
- tooltip_text_ =
- UTF16ToWide(download_->GetFileNameToReportUser().LossyDisplayName());
+ tooltip_text_ = download_->GetFileNameToReportUser().LossyDisplayName();
// Force the shelf to layout again as our size has changed.
parent_->Layout();
diff --git a/chrome/browser/ui/views/download/download_item_view.h b/chrome/browser/ui/views/download/download_item_view.h
index f518b12..43c999c 100644
--- a/chrome/browser/ui/views/download/download_item_view.h
+++ b/chrome/browser/ui/views/download/download_item_view.h
@@ -87,8 +87,7 @@ class DownloadItemView : public views::ButtonListener,
virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE;
virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
- virtual bool GetTooltipText(const gfx::Point& p,
- std::wstring* tooltip) OVERRIDE;
+ virtual bool GetTooltipText(const gfx::Point& p, string16* tooltip) OVERRIDE;
virtual void ShowContextMenu(const gfx::Point& p,
bool is_mouse_gesture) OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
@@ -204,7 +203,7 @@ class DownloadItemView : public views::ButtonListener,
gfx::Font font_;
// The tooltip.
- std::wstring tooltip_text_;
+ string16 tooltip_text_;
// The current state (normal, hot or pushed) of the body and drop-down.
State body_state_;
diff --git a/chrome/browser/ui/views/edit_search_engine_dialog.cc b/chrome/browser/ui/views/edit_search_engine_dialog.cc
index 81cdeb2cf..13e596c 100644
--- a/chrome/browser/ui/views/edit_search_engine_dialog.cc
+++ b/chrome/browser/ui/views/edit_search_engine_dialog.cc
@@ -255,13 +255,12 @@ void EditSearchEngineDialog::UpdateImageView(ImageView* image_view,
bool is_valid,
int invalid_message_id) {
if (is_valid) {
- image_view->SetTooltipText(std::wstring());
+ image_view->SetTooltipText(string16());
image_view->SetImage(
ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_INPUT_GOOD));
} else {
- image_view->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(invalid_message_id)));
+ image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)) ;
image_view->SetImage(
ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_INPUT_ALERT));
diff --git a/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc b/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc
index b1472cf..3cd1a56 100644
--- a/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc
+++ b/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc
@@ -45,7 +45,7 @@ BrowserActionOverflowMenuController::BrowserActionOverflowMenuController(
canvas->AsCanvasSkia()->ExtractBitmap());
// Set the tooltip for this item.
- std::wstring tooltip = UTF8ToWide(
+ string16 tooltip = UTF8ToUTF16(
view->button()->extension()->browser_action()->GetTitle(
owner_->GetCurrentTabId()));
menu_->SetTooltip(tooltip, command_id);
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 150b218..aba1533 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -106,8 +106,8 @@ FindBarView::FindBarView(FindBarHost* host)
rb.GetBitmapNamed(IDR_FINDINPAGE_PREV_H));
find_previous_button_->SetImage(views::CustomButton::BS_DISABLED,
rb.GetBitmapNamed(IDR_FINDINPAGE_PREV_P));
- find_previous_button_->SetTooltipText(UTF16ToWide(
- l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP)));
+ find_previous_button_->SetTooltipText(
+ l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP));
find_previous_button_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ACCNAME_PREVIOUS));
AddChildView(find_previous_button_);
@@ -122,7 +122,7 @@ FindBarView::FindBarView(FindBarHost* host)
find_next_button_->SetImage(views::CustomButton::BS_DISABLED,
rb.GetBitmapNamed(IDR_FINDINPAGE_NEXT_P));
find_next_button_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_NEXT_TOOLTIP)));
+ l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_NEXT_TOOLTIP));
find_next_button_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ACCNAME_NEXT));
AddChildView(find_next_button_);
@@ -137,7 +137,7 @@ FindBarView::FindBarView(FindBarHost* host)
close_button_->SetImage(views::CustomButton::BS_PUSHED,
rb.GetBitmapNamed(IDR_CLOSE_BAR_P));
close_button_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)));
+ l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP));
close_button_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
AddChildView(close_button_);
diff --git a/chrome/browser/ui/views/first_run_search_engine_view.cc b/chrome/browser/ui/views/first_run_search_engine_view.cc
index 7163e67..7112f4b 100644
--- a/chrome/browser/ui/views/first_run_search_engine_view.cc
+++ b/chrome/browser/ui/views/first_run_search_engine_view.cc
@@ -100,7 +100,7 @@ SearchEngineChoice::SearchEngineChoice(views::ButtonListener* listener,
if (use_small_logos)
logo_image->SetImageSize(gfx::Size(kSmallLogoWidth, kSmallLogoHeight));
// Tooltip text provides accessibility for low-vision users.
- logo_image->SetTooltipText(search_engine_->short_name());
+ logo_image->SetTooltipText(WideToUTF16Hack(search_engine_->short_name()));
choice_view_ = logo_image;
} else {
// No logo -- we must show a text label.
@@ -108,7 +108,7 @@ SearchEngineChoice::SearchEngineChoice(views::ButtonListener* listener,
logo_label->SetColor(SK_ColorDKGRAY);
logo_label->SetFont(logo_label->font().DeriveFont(3, gfx::Font::BOLD));
logo_label->SetHorizontalAlignment(views::Label::ALIGN_CENTER);
- logo_label->SetTooltipText(search_engine_->short_name());
+ logo_label->SetTooltipText(WideToUTF16Hack(search_engine_->short_name()));
logo_label->SetMultiLine(true);
logo_label->SizeToFit(kSmallLogoWidth);
choice_view_ = logo_label;
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
index 990323f..4eca62a 100644
--- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
@@ -72,7 +72,7 @@ void ContentSettingImageView::UpdateFromTabContents(TabContents* tab_contents) {
}
SetImage(ResourceBundle::GetSharedInstance().GetBitmapNamed(
content_setting_image_model_->get_icon()));
- SetTooltipText(UTF8ToWide(content_setting_image_model_->get_tooltip()));
+ SetTooltipText(UTF8ToUTF16(content_setting_image_model_->get_tooltip()));
SetVisible(true);
TabSpecificContentSettings* content_settings = NULL;
diff --git a/chrome/browser/ui/views/location_bar/location_icon_view.cc b/chrome/browser/ui/views/location_bar/location_icon_view.cc
index 2846337..2755501 100644
--- a/chrome/browser/ui/views/location_bar/location_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc
@@ -10,8 +10,7 @@
LocationIconView::LocationIconView(LocationBarView* location_bar)
: ALLOW_THIS_IN_INITIALIZER_LIST(click_handler_(this, location_bar)) {
- SetTooltipText(UTF16ToWide(l10n_util::GetStringUTF16(
- IDS_TOOLTIP_LOCATION_ICON)));
+ SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON));
}
LocationIconView::~LocationIconView() {
@@ -29,9 +28,8 @@ void LocationIconView::OnMouseReleased(const views::MouseEvent& event) {
void LocationIconView::ShowTooltip(bool show) {
if (show) {
- SetTooltipText(UTF16ToWide(l10n_util::GetStringUTF16(
- IDS_TOOLTIP_LOCATION_ICON)));
+ SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON));
} else {
- SetTooltipText(L"");
+ SetTooltipText(string16());
}
}
diff --git a/chrome/browser/ui/views/location_bar/page_action_image_view.cc b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
index 0638fa6..a7fa6f0 100644
--- a/chrome/browser/ui/views/location_bar/page_action_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
@@ -193,7 +193,7 @@ void PageActionImageView::UpdateVisibility(TabContents* contents,
// Set the tooltip.
tooltip_ = page_action_->GetTitle(current_tab_id_);
- SetTooltipText(UTF8ToWide(tooltip_));
+ SetTooltipText(UTF8ToUTF16(tooltip_));
// Set the image.
// It can come from three places. In descending order of priority:
diff --git a/chrome/browser/ui/views/location_bar/star_view.cc b/chrome/browser/ui/views/location_bar/star_view.cc
index 6e1b91e..8d4c0c0 100644
--- a/chrome/browser/ui/views/location_bar/star_view.cc
+++ b/chrome/browser/ui/views/location_bar/star_view.cc
@@ -27,8 +27,8 @@ StarView::~StarView() {
}
void StarView::SetToggled(bool on) {
- SetTooltipText(UTF16ToWide(l10n_util::GetStringUTF16(
- on ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR)));
+ SetTooltipText(l10n_util::GetStringUTF16(
+ on ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR));
SetImage(ResourceBundle::GetSharedInstance().GetBitmapNamed(
on ? IDR_STAR_LIT : IDR_STAR));
}
@@ -38,7 +38,7 @@ void StarView::GetAccessibleState(ui::AccessibleViewState* state) {
state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
}
-bool StarView::GetTooltipText(const gfx::Point& p, std::wstring* tooltip) {
+bool StarView::GetTooltipText(const gfx::Point& p, string16* tooltip) {
// Don't show tooltip to distract user if BookmarkBubbleView is showing.
if (browser::IsBookmarkBubbleViewShowing())
return false;
diff --git a/chrome/browser/ui/views/location_bar/star_view.h b/chrome/browser/ui/views/location_bar/star_view.h
index 0ef704d..319936e 100644
--- a/chrome/browser/ui/views/location_bar/star_view.h
+++ b/chrome/browser/ui/views/location_bar/star_view.h
@@ -28,8 +28,7 @@ class StarView : public views::ImageView, public BubbleDelegate {
private:
// views::ImageView overrides:
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
- virtual bool GetTooltipText(const gfx::Point& p,
- std::wstring* tooltip) OVERRIDE;
+ virtual bool GetTooltipText(const gfx::Point& p, string16* tooltip) OVERRIDE;
virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc
index 6067b42..62f3f31 100644
--- a/chrome/browser/ui/views/notifications/balloon_view.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view.cc
@@ -290,8 +290,8 @@ void BalloonViewImpl::Show(Balloon* balloon) {
options_menu_button_ = new views::MenuButton(NULL, L"", this, false);
AddChildView(options_menu_button_);
close_button_ = new views::ImageButton(this);
- close_button_->SetTooltipText(UTF16ToWide(l10n_util::GetStringUTF16(
- IDS_NOTIFICATION_BALLOON_DISMISS_LABEL)));
+ close_button_->SetTooltipText(l10n_util::GetStringUTF16(
+ IDS_NOTIFICATION_BALLOON_DISMISS_LABEL));
AddChildView(close_button_);
// We have to create two windows: one for the contents and one for the
diff --git a/chrome/browser/ui/views/reload_button.cc b/chrome/browser/ui/views/reload_button.cc
index db95490..1fb81f4 100644
--- a/chrome/browser/ui/views/reload_button.cc
+++ b/chrome/browser/ui/views/reload_button.cc
@@ -124,10 +124,10 @@ void ReloadButton::OnMouseExited(const views::MouseEvent& event) {
SetState(BS_NORMAL);
}
-bool ReloadButton::GetTooltipText(const gfx::Point& p, std::wstring* tooltip) {
+bool ReloadButton::GetTooltipText(const gfx::Point& p, string16* tooltip) {
int text_id = visible_mode_ == MODE_RELOAD ? IDS_TOOLTIP_RELOAD
: IDS_TOOLTIP_STOP;
- tooltip->assign(UTF16ToWide(l10n_util::GetStringUTF16(text_id)));
+ tooltip->assign(l10n_util::GetStringUTF16(text_id));
return true;
}
diff --git a/chrome/browser/ui/views/reload_button.h b/chrome/browser/ui/views/reload_button.h
index e7cd856..4b0cdc2 100644
--- a/chrome/browser/ui/views/reload_button.h
+++ b/chrome/browser/ui/views/reload_button.h
@@ -46,8 +46,7 @@ class ReloadButton : public views::ToggleImageButton,
// Overridden from views::View:
virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
- virtual bool GetTooltipText(const gfx::Point& p,
- std::wstring* tooltip) OVERRIDE;
+ virtual bool GetTooltipText(const gfx::Point& p, string16* tooltip) OVERRIDE;
virtual std::string GetClassName() const OVERRIDE;
private:
diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc
index cd5f249..4be5f54 100644
--- a/chrome/browser/ui/views/tabs/base_tab.cc
+++ b/chrome/browser/ui/views/tabs/base_tab.cc
@@ -165,7 +165,7 @@ BaseTab::BaseTab(TabController* controller)
close_button_->SetImage(views::CustomButton::BS_PUSHED,
rb.GetBitmapNamed(IDR_TAB_CLOSE_P));
close_button_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_CLOSE_TAB)));
+ l10n_util::GetStringUTF16(IDS_TOOLTIP_CLOSE_TAB));
close_button_->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
// Disable animation so that the red danger sign shows up immediately
@@ -370,13 +370,13 @@ void BaseTab::OnMouseExited(const views::MouseEvent& event) {
hover_animation_->Hide();
}
-bool BaseTab::GetTooltipText(const gfx::Point& p, std::wstring* tooltip) {
+bool BaseTab::GetTooltipText(const gfx::Point& p, string16* tooltip) {
if (data_.title.empty())
return false;
// Only show the tooltip if the title is truncated.
if (font_->GetStringWidth(data_.title) > GetTitleBounds().width()) {
- *tooltip = UTF16ToWide(data_.title);
+ *tooltip = data_.title;
return true;
}
return false;
diff --git a/chrome/browser/ui/views/tabs/base_tab.h b/chrome/browser/ui/views/tabs/base_tab.h
index 42a00ad..5157eb6 100644
--- a/chrome/browser/ui/views/tabs/base_tab.h
+++ b/chrome/browser/ui/views/tabs/base_tab.h
@@ -91,8 +91,7 @@ class BaseTab : public ui::AnimationDelegate,
virtual void OnMouseCaptureLost() OVERRIDE;
virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE;
virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
- virtual bool GetTooltipText(const gfx::Point& p,
- std::wstring* tooltip) OVERRIDE;
+ virtual bool GetTooltipText(const gfx::Point& p, string16* tooltip) OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
protected:
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 2d62750..ba30929 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -132,8 +132,7 @@ void ToolbarView::Init() {
back_->set_tag(IDC_BACK);
back_->SetImageAlignment(views::ImageButton::ALIGN_RIGHT,
views::ImageButton::ALIGN_TOP);
- back_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_BACK)));
+ back_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_BACK));
back_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK));
back_->set_id(VIEW_ID_BACK_BUTTON);
@@ -141,8 +140,7 @@ void ToolbarView::Init() {
forward_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN |
ui::EF_MIDDLE_BUTTON_DOWN);
forward_->set_tag(IDC_FORWARD);
- forward_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD)));
+ forward_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD));
forward_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD));
forward_->set_id(VIEW_ID_FORWARD_BUTTON);
@@ -155,8 +153,7 @@ void ToolbarView::Init() {
reload_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN |
ui::EF_MIDDLE_BUTTON_DOWN);
reload_->set_tag(IDC_RELOAD);
- reload_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD)));
+ reload_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD));
reload_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD));
reload_->set_id(VIEW_ID_RELOAD_BUTTON);
@@ -164,8 +161,7 @@ void ToolbarView::Init() {
home_->set_triggerable_event_flags(ui::EF_LEFT_BUTTON_DOWN |
ui::EF_MIDDLE_BUTTON_DOWN);
home_->set_tag(IDC_HOME);
- home_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_HOME)));
+ home_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_HOME));
home_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME));
home_->set_id(VIEW_ID_HOME_BUTTON);
@@ -179,9 +175,9 @@ void ToolbarView::Init() {
app_menu_->set_border(NULL);
app_menu_->EnableCanvasFlippingForRTLUI(true);
app_menu_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_APP));
- app_menu_->SetTooltipText(UTF16ToWide(l10n_util::GetStringFUTF16(
+ app_menu_->SetTooltipText(l10n_util::GetStringFUTF16(
IDS_APPMENU_TOOLTIP,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))));
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
app_menu_->set_id(VIEW_ID_APP_MENU);
// Add any necessary badges to the menu item based on the system state.
@@ -207,9 +203,9 @@ void ToolbarView::Init() {
// Accessibility specific tooltip text.
if (BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) {
back_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_BACK)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_BACK));
forward_->SetTooltipText(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_FORWARD)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_FORWARD));
}
}
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index f688d40..3c3c20c 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -607,10 +607,10 @@ void WrenchMenu::RunMenu(views::MenuButton* host) {
selected_menu_model_->ActivatedAt(selected_index_);
}
-std::wstring WrenchMenu::GetTooltipText(int id,
+string16 WrenchMenu::GetTooltipText(int id,
const gfx::Point& p) {
return is_bookmark_command(id) ?
- bookmark_menu_delegate_->GetTooltipText(id, p) : std::wstring();
+ bookmark_menu_delegate_->GetTooltipText(id, p) : string16();
}
bool WrenchMenu::IsTriggerableEvent(views::MenuItemView* menu,
diff --git a/chrome/browser/ui/views/wrench_menu.h b/chrome/browser/ui/views/wrench_menu.h
index c18c5f0..231f379 100644
--- a/chrome/browser/ui/views/wrench_menu.h
+++ b/chrome/browser/ui/views/wrench_menu.h
@@ -37,7 +37,7 @@ class WrenchMenu : public views::MenuDelegate,
void RunMenu(views::MenuButton* host);
// MenuDelegate overrides:
- virtual std::wstring GetTooltipText(int id, const gfx::Point& p) OVERRIDE;
+ virtual string16 GetTooltipText(int id, const gfx::Point& p) OVERRIDE;
virtual bool IsTriggerableEvent(views::MenuItemView* menu,
const views::MouseEvent& e) OVERRIDE;
virtual bool GetDropFormats(