summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-14 18:34:56 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-14 18:34:56 +0000
commit001f08ab3184a370fdd1e8cf4cef05fa15174bd9 (patch)
tree2d808b05a8f8294af7346c0e7f8af472266023e1 /chrome/browser
parent6784252af99d1da6c63871374d9409998c64ef5b (diff)
downloadchromium_src-001f08ab3184a370fdd1e8cf4cef05fa15174bd9.zip
chromium_src-001f08ab3184a370fdd1e8cf4cef05fa15174bd9.tar.gz
chromium_src-001f08ab3184a370fdd1e8cf4cef05fa15174bd9.tar.bz2
Remove wstring from views. Part 3: Switch accessibility strings to string16.
BUG=68267 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6192007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/login/new_user_view.cc2
-rw-r--r--chrome/browser/ui/views/accessibility_event_router_views.cc4
-rw-r--r--chrome/browser/ui/views/bookmark_bar_view.cc10
-rw-r--r--chrome/browser/ui/views/bookmark_bubble_view.cc3
-rw-r--r--chrome/browser/ui/views/bookmark_editor_view.cc4
-rw-r--r--chrome/browser/ui/views/browser_actions_container.cc17
-rw-r--r--chrome/browser/ui/views/clear_browsing_data.cc3
-rw-r--r--chrome/browser/ui/views/clear_browsing_data_view.cc3
-rw-r--r--chrome/browser/ui/views/clear_data_view.cc6
-rw-r--r--chrome/browser/ui/views/download_item_view.cc10
-rw-r--r--chrome/browser/ui/views/download_shelf_view.cc2
-rw-r--r--chrome/browser/ui/views/find_bar_view.cc9
-rw-r--r--chrome/browser/ui/views/first_run_search_engine_view.cc2
-rw-r--r--chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_root_view.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc16
-rw-r--r--chrome/browser/ui/views/frame/opaque_browser_frame_view.cc8
-rw-r--r--chrome/browser/ui/views/importer_view.cc3
-rw-r--r--chrome/browser/ui/views/infobars/infobar_container.cc2
-rw-r--r--chrome/browser/ui/views/infobars/infobars.cc14
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc5
-rw-r--r--chrome/browser/ui/views/location_bar/star_view.cc2
-rw-r--r--chrome/browser/ui/views/options/options_group_view.cc5
-rw-r--r--chrome/browser/ui/views/options/options_window_view.cc6
-rw-r--r--chrome/browser/ui/views/tabs/base_tab.cc4
-rw-r--r--chrome/browser/ui/views/tabs/tab_strip.cc2
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc15
-rw-r--r--chrome/browser/ui/views/wrench_menu.cc11
28 files changed, 83 insertions, 89 deletions
diff --git a/chrome/browser/chromeos/login/new_user_view.cc b/chrome/browser/chromeos/login/new_user_view.cc
index 6a40795..69fd79f 100644
--- a/chrome/browser/chromeos/login/new_user_view.cc
+++ b/chrome/browser/chromeos/login/new_user_view.cc
@@ -168,7 +168,7 @@ void NewUserView::Init() {
username_field_ = new UsernameField(this);
username_field_->set_background(new CopyBackground(this));
username_field_->SetAccessibleName(
- ASCIIToWide(l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_USERNAME_LABEL)));
+ l10n_util::GetStringUTF16(IDS_CHROMEOS_ACC_USERNAME_LABEL));
AddChildView(username_field_);
password_field_ = new TextfieldWithMargin(views::Textfield::STYLE_PASSWORD);
diff --git a/chrome/browser/ui/views/accessibility_event_router_views.cc b/chrome/browser/ui/views/accessibility_event_router_views.cc
index d088849..68c7fcb 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views.cc
+++ b/chrome/browser/ui/views/accessibility_event_router_views.cc
@@ -153,9 +153,9 @@ std::string AccessibilityEventRouterViews::GetViewName(views::View* view) {
// Otherwise ask the view for its accessible name.
if (name.empty()) {
- std::wstring wname;
+ string16 wname;
view->GetAccessibleName(&wname);
- name = WideToUTF8(wname);
+ name = UTF16ToUTF8(wname);
}
return name;
diff --git a/chrome/browser/ui/views/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmark_bar_view.cc
index 0631169..f672ceb 100644
--- a/chrome/browser/ui/views/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmark_bar_view.cc
@@ -915,7 +915,7 @@ void BookmarkBarView::Init() {
bookmarks_separator_view_ = new ButtonSeparatorView();
bookmarks_separator_view_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_SEPARATOR)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_SEPARATOR));
AddChildView(bookmarks_separator_view_);
instructions_ = new BookmarkBarInstructionsView(this);
@@ -937,7 +937,7 @@ MenuButton* BookmarkBarView::CreateOtherBookmarkedButton() {
button->SetContextMenuController(this);
button->set_tag(kOtherFolderButtonTag);
button->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OTHER_BOOKMARKED)));
+ l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OTHER_BOOKMARKED));
return button;
}
@@ -959,7 +959,7 @@ MenuButton* BookmarkBarView::CreateOverflowButton() {
button->SetVisible(false);
// Set accessibility name.
button->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS_CHEVRON)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS_CHEVRON));
return button;
}
@@ -1288,7 +1288,7 @@ views::View* BookmarkBarView::CreateBookmarkButton(const BookmarkNode* node) {
void BookmarkBarView::ConfigureButton(const BookmarkNode* node,
views::TextButton* button) {
button->SetText(UTF16ToWide(node->GetTitle()));
- button->SetAccessibleName(UTF16ToWide(node->GetTitle()));
+ button->SetAccessibleName(node->GetTitle());
button->SetID(VIEW_ID_BOOKMARK_BAR_ELEMENT);
// We don't always have a theme provider (ui tests, for example).
if (GetThemeProvider()) {
@@ -1736,7 +1736,7 @@ views::TextButton* BookmarkBarView::CreateSyncErrorButton() {
sync_error_button->SetTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)));
sync_error_button->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_SYNC_ERROR_BUTTON)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_SYNC_ERROR_BUTTON));
sync_error_button->SetIcon(
*ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING));
return sync_error_button;
diff --git a/chrome/browser/ui/views/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmark_bubble_view.cc
index 1a6e3b6..0f55895 100644
--- a/chrome/browser/ui/views/bookmark_bubble_view.cc
+++ b/chrome/browser/ui/views/bookmark_bubble_view.cc
@@ -206,7 +206,8 @@ void BookmarkBubbleView::Init() {
parent_combobox_ = new Combobox(&parent_model_);
parent_combobox_->SetSelectedItem(parent_model_.node_parent_index());
parent_combobox_->set_listener(this);
- parent_combobox_->SetAccessibleName(combobox_label->GetText());
+ parent_combobox_->SetAccessibleName(
+ WideToUTF16Hack(combobox_label->GetText()));
Label* title_label = new Label(UTF16ToWide(l10n_util::GetStringUTF16(
newly_bookmarked_ ? IDS_BOOMARK_BUBBLE_PAGE_BOOKMARKED :
diff --git a/chrome/browser/ui/views/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmark_editor_view.cc
index d0c3e69..ff46b7b 100644
--- a/chrome/browser/ui/views/bookmark_editor_view.cc
+++ b/chrome/browser/ui/views/bookmark_editor_view.cc
@@ -278,7 +278,7 @@ void BookmarkEditorView::Init() {
title_label_ = new views::Label(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOMARK_EDITOR_NAME_LABEL)));
- title_tf_.SetAccessibleName(title_label_->GetText());
+ title_tf_.SetAccessibleName(WideToUTF16Hack(title_label_->GetText()));
string16 url_text;
if (details_.type == EditDetails::EXISTING_NODE) {
@@ -297,7 +297,7 @@ void BookmarkEditorView::Init() {
url_label_ = new views::Label(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOMARK_EDITOR_URL_LABEL)));
- url_tf_.SetAccessibleName(url_label_->GetText());
+ url_tf_.SetAccessibleName(WideToUTF16Hack(url_label_->GetText()));
if (show_tree_) {
tree_view_ = new views::TreeView();
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc
index 0ebfac4..3ac3bcf 100644
--- a/chrome/browser/ui/views/browser_actions_container.cc
+++ b/chrome/browser/ui/views/browser_actions_container.cc
@@ -165,10 +165,10 @@ void BrowserActionButton::UpdateState() {
}
// If the browser action name is empty, show the extension name instead.
- std::wstring name = UTF8ToWide(browser_action()->GetTitle(tab_id));
+ string16 name = UTF8ToUTF16(browser_action()->GetTitle(tab_id));
if (name.empty())
- name = UTF8ToWide(extension()->name());
- SetTooltipText(name);
+ name = UTF8ToUTF16(extension()->name());
+ SetTooltipText(UTF16ToWideHack(name));
SetAccessibleName(name);
GetParent()->SchedulePaint();
}
@@ -288,8 +288,8 @@ BrowserActionView::BrowserActionView(const Extension* extension,
button_->SetDragController(panel_);
AddChildView(button_);
button_->UpdateState();
- SetAccessibleName(UTF16ToWide(
- l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS_BROWSER_ACTION)));
+ SetAccessibleName(
+ l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS_BROWSER_ACTION));
}
BrowserActionView::~BrowserActionView() {
@@ -369,19 +369,18 @@ BrowserActionsContainer::BrowserActionsContainer(Browser* browser,
resize_animation_.reset(new ui::SlideAnimation(this));
resize_area_ = new views::ResizeArea(this);
resize_area_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_SEPARATOR)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_SEPARATOR));
AddChildView(resize_area_);
chevron_ = new views::MenuButton(NULL, std::wstring(), this, false);
chevron_->set_border(NULL);
chevron_->EnableCanvasFlippingForRTLUI(true);
chevron_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS_CHEVRON)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS_CHEVRON));
chevron_->SetVisible(false);
AddChildView(chevron_);
- SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS)));
+ SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS));
}
BrowserActionsContainer::~BrowserActionsContainer() {
diff --git a/chrome/browser/ui/views/clear_browsing_data.cc b/chrome/browser/ui/views/clear_browsing_data.cc
index 36ff285..2ba602c 100644
--- a/chrome/browser/ui/views/clear_browsing_data.cc
+++ b/chrome/browser/ui/views/clear_browsing_data.cc
@@ -135,7 +135,8 @@ void ClearBrowsingDataView::Init() {
time_period_combobox_->SetSelectedItem(profile_->GetPrefs()->GetInteger(
prefs::kDeleteTimePeriod));
time_period_combobox_->set_listener(this);
- time_period_combobox_->SetAccessibleName(time_period_label_->GetText());
+ time_period_combobox_->SetAccessibleName(
+ WideToUTF16Hack(time_period_label_->GetText()));
AddChildView(time_period_combobox_);
// Create the throbber and related views. The throbber and status link are
diff --git a/chrome/browser/ui/views/clear_browsing_data_view.cc b/chrome/browser/ui/views/clear_browsing_data_view.cc
index be60f09..1135bf4 100644
--- a/chrome/browser/ui/views/clear_browsing_data_view.cc
+++ b/chrome/browser/ui/views/clear_browsing_data_view.cc
@@ -128,7 +128,8 @@ void ClearBrowsingDataView2::Init() {
time_period_combobox_->SetSelectedItem(profile_->GetPrefs()->GetInteger(
prefs::kDeleteTimePeriod));
time_period_combobox_->set_listener(this);
- time_period_combobox_->SetAccessibleName(time_period_label_->GetText());
+ time_period_combobox_->SetAccessibleName(
+ WideToUTF16Hack(time_period_label_->GetText()));
// Create the throbber and related views. The throbber and status link are
// contained in throbber_view_, which is positioned by DialogClientView right
diff --git a/chrome/browser/ui/views/clear_data_view.cc b/chrome/browser/ui/views/clear_data_view.cc
index 534e6ca..8f127ae 100644
--- a/chrome/browser/ui/views/clear_data_view.cc
+++ b/chrome/browser/ui/views/clear_data_view.cc
@@ -51,9 +51,9 @@ ClearDataView::ClearDataView(Profile* profile)
void ClearDataView::Init() {
tabs_ = new views::TabbedPane;
- tabs_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringFUTF16(IDS_OPTIONS_DIALOG_TITLE,
- l10n_util::GetStringUTF16(IDS_OPTIONS_DIALOG_TITLE))));
+ tabs_->SetAccessibleName(l10n_util::GetStringFUTF16(
+ IDS_OPTIONS_DIALOG_TITLE,
+ l10n_util::GetStringUTF16(IDS_OPTIONS_DIALOG_TITLE)));
AddChildView(tabs_);
int tab_index = 0;
diff --git a/chrome/browser/ui/views/download_item_view.cc b/chrome/browser/ui/views/download_item_view.cc
index f09cb48..f398941 100644
--- a/chrome/browser/ui/views/download_item_view.cc
+++ b/chrome/browser/ui/views/download_item_view.cc
@@ -1061,15 +1061,15 @@ bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) {
}
void DownloadItemView::UpdateAccessibleName() {
- std::wstring current_name;
+ string16 current_name;
GetAccessibleName(&current_name);
- std::wstring new_name;
+ string16 new_name;
if (download_->safety_state() == DownloadItem::DANGEROUS) {
- new_name = dangerous_download_label_->GetText();
+ new_name = WideToUTF16Hack(dangerous_download_label_->GetText());
} else {
- new_name = status_text_ + L" " +
- download_->GetFileNameToReportUser().ToWStringHack();
+ new_name = WideToUTF16Hack(status_text_) + char16(' ') +
+ WideToUTF16Hack(download_->GetFileNameToReportUser().ToWStringHack());
}
// If the name has changed, call SetAccessibleName and notify
diff --git a/chrome/browser/ui/views/download_shelf_view.cc b/chrome/browser/ui/views/download_shelf_view.cc
index 663b612..9701df5 100644
--- a/chrome/browser/ui/views/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download_shelf_view.cc
@@ -116,7 +116,7 @@ void DownloadShelfView::Init() {
close_button_->SetImage(views::CustomButton::BS_PUSHED,
rb.GetBitmapNamed(IDR_CLOSE_BAR_P));
close_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
UpdateButtonColors();
AddChildView(close_button_);
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 4272634..db9af17d 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -102,8 +102,7 @@ FindBarView::FindBarView(FindBarHost* host)
find_text_->SetFont(rb.GetFont(ResourceBundle::BaseFont));
find_text_->set_default_width_in_chars(kDefaultCharWidth);
find_text_->SetController(this);
- find_text_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_FIND)));
+ find_text_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FIND));
AddChildView(find_text_);
match_count_text_ = new views::Label();
@@ -128,7 +127,7 @@ FindBarView::FindBarView(FindBarHost* host)
find_previous_button_->SetTooltipText(UTF16ToWide(
l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP)));
find_previous_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_PREVIOUS)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_PREVIOUS));
AddChildView(find_previous_button_);
find_next_button_ = new views::ImageButton(this);
@@ -143,7 +142,7 @@ FindBarView::FindBarView(FindBarHost* host)
find_next_button_->SetTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_NEXT_TOOLTIP)));
find_next_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_NEXT)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_NEXT));
AddChildView(find_next_button_);
close_button_ = new views::ImageButton(this);
@@ -158,7 +157,7 @@ FindBarView::FindBarView(FindBarHost* host)
close_button_->SetTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)));
close_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
AddChildView(close_button_);
if (kDialog_left == NULL) {
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 0cc0060..275b891 100644
--- a/chrome/browser/ui/views/first_run_search_engine_view.cc
+++ b/chrome/browser/ui/views/first_run_search_engine_view.cc
@@ -92,7 +92,7 @@ SearchEngineChoice::SearchEngineChoice(views::ButtonListener* listener,
// screenreaders. It uses the browser name rather than the text of the
// button "Choose", since it's not obvious to a screenreader user which
// browser each button corresponds to.
- SetAccessibleName(search_engine_->short_name());
+ SetAccessibleName(WideToUTF16Hack(search_engine_->short_name()));
}
int SearchEngineChoice::GetChoiceViewWidth() {
diff --git a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc
index a349dfb..8838a8d 100644
--- a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc
@@ -73,7 +73,7 @@ AppPanelBrowserFrameView::AppPanelBrowserFrameView(BrowserFrame* frame,
close_button_->SetImage(views::CustomButton::BS_PUSHED,
rb.GetBitmapNamed(IDR_CLOSE_BAR_P));
close_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
AddChildView(close_button_);
window_icon_ = new TabIconView(this);
diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc
index 97d1a45..6a84344 100644
--- a/chrome/browser/ui/views/frame/browser_root_view.cc
+++ b/chrome/browser/ui/views/frame/browser_root_view.cc
@@ -23,7 +23,7 @@ BrowserRootView::BrowserRootView(BrowserView* browser_view,
: views::RootView(widget),
browser_view_(browser_view),
forwarding_to_tab_strip_(false) {
- SetAccessibleName(UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
+ SetAccessibleName(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
}
bool BrowserRootView::GetDropFormats(
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index d0aebca..fed8404 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1850,8 +1850,7 @@ void BrowserView::InitTabStrip(TabStripModel* model) {
else
tabstrip_ = new TabStrip(tabstrip_controller);
- tabstrip_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TABSTRIP)));
+ tabstrip_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_TABSTRIP));
AddChildView(tabstrip_);
tabstrip_controller->InitFromModel(tabstrip_);
@@ -1877,15 +1876,14 @@ void BrowserView::Init() {
}
LoadAccelerators();
- SetAccessibleName(UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
+ SetAccessibleName(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
InitTabStrip(browser_->tabstrip_model());
toolbar_ = new ToolbarView(browser_.get());
AddChildView(toolbar_);
toolbar_->Init(browser_->profile());
- toolbar_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR)));
+ toolbar_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLBAR));
infobar_container_ = new InfoBarContainer(this);
AddChildView(infobar_container_);
@@ -1909,7 +1907,7 @@ void BrowserView::Init() {
this);
sidebar_split_->SetID(VIEW_ID_SIDE_BAR_SPLIT);
sidebar_split_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_SIDE_BAR)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_SIDE_BAR));
sidebar_split_->set_background(
views::Background::CreateSolidBackground(bg_color));
}
@@ -1929,7 +1927,7 @@ void BrowserView::Init() {
this);
contents_split_->SetID(VIEW_ID_CONTENTS_SPLIT);
contents_split_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_WEB_CONTENTS)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_WEB_CONTENTS));
contents_split_->set_background(
views::Background::CreateSolidBackground(bg_color));
AddChildView(contents_split_);
@@ -2008,7 +2006,7 @@ bool BrowserView::MaybeShowBookmarkBar(TabContentsWrapper* contents) {
}
bookmark_bar_view_->SetPageNavigator(contents->tab_contents());
bookmark_bar_view_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_BOOKMARKS));
new_bookmark_bar_view = bookmark_bar_view_.get();
}
return UpdateChildViewAndLayout(new_bookmark_bar_view, &active_bookmark_bar_);
@@ -2552,7 +2550,7 @@ BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
BrowserFrame::Create(view, browser->profile());
view->GetWindow()->GetNonClientView()->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
return view;
}
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index 0a9cb38..30b6084 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -122,7 +122,7 @@ OpaqueBrowserFrameView::OpaqueBrowserFrameView(BrowserFrame* frame,
tp->GetBitmapNamed(IDR_MINIMIZE_BUTTON_MASK));
}
minimize_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_MINIMIZE)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_MINIMIZE));
AddChildView(minimize_button_);
maximize_button_->SetImage(views::CustomButton::BS_NORMAL,
@@ -136,7 +136,7 @@ OpaqueBrowserFrameView::OpaqueBrowserFrameView(BrowserFrame* frame,
tp->GetBitmapNamed(IDR_MAXIMIZE_BUTTON_MASK));
}
maximize_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_MAXIMIZE)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_MAXIMIZE));
AddChildView(maximize_button_);
restore_button_->SetImage(views::CustomButton::BS_NORMAL,
@@ -150,7 +150,7 @@ OpaqueBrowserFrameView::OpaqueBrowserFrameView(BrowserFrame* frame,
tp->GetBitmapNamed(IDR_RESTORE_BUTTON_MASK));
}
restore_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_RESTORE)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_RESTORE));
AddChildView(restore_button_);
close_button_->SetImage(views::CustomButton::BS_NORMAL,
@@ -164,7 +164,7 @@ OpaqueBrowserFrameView::OpaqueBrowserFrameView(BrowserFrame* frame,
tp->GetBitmapNamed(IDR_CLOSE_BUTTON_MASK));
}
close_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
AddChildView(close_button_);
// Initializing the TabIconView is expensive, so only do it if we need to.
diff --git a/chrome/browser/ui/views/importer_view.cc b/chrome/browser/ui/views/importer_view.cc
index 31d29d9..05e7f72 100644
--- a/chrome/browser/ui/views/importer_view.cc
+++ b/chrome/browser/ui/views/importer_view.cc
@@ -58,7 +58,8 @@ void ImporterView::SetupControl() {
profile_combobox_ = new views::Combobox(this);
profile_combobox_->set_listener(this);
- profile_combobox_->SetAccessibleName(import_from_label_->GetText());
+ profile_combobox_->SetAccessibleName(
+ WideToUTF16Hack(import_from_label_->GetText()));
import_items_label_ = new views::Label(UTF16ToWide(
l10n_util::GetStringUTF16(IDS_IMPORT_ITEMS_LABEL)));
diff --git a/chrome/browser/ui/views/infobars/infobar_container.cc b/chrome/browser/ui/views/infobars/infobar_container.cc
index 1b7dd33..5f62201 100644
--- a/chrome/browser/ui/views/infobars/infobar_container.cc
+++ b/chrome/browser/ui/views/infobars/infobar_container.cc
@@ -21,7 +21,7 @@ InfoBarContainer::InfoBarContainer(Delegate* delegate)
tab_contents_(NULL) {
SetID(VIEW_ID_INFO_BAR_CONTAINER);
SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_CONTAINER)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_CONTAINER));
}
InfoBarContainer::~InfoBarContainer() {
diff --git a/chrome/browser/ui/views/infobars/infobars.cc b/chrome/browser/ui/views/infobars/infobars.cc
index f5e7604..9698b51 100644
--- a/chrome/browser/ui/views/infobars/infobars.cc
+++ b/chrome/browser/ui/views/infobars/infobars.cc
@@ -97,12 +97,12 @@ InfoBar::InfoBar(InfoBarDelegate* delegate)
switch (delegate->GetInfoBarType()) {
case InfoBarDelegate::WARNING_TYPE:
- SetAccessibleName(UTF16ToWide(
- l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_WARNING)));
+ SetAccessibleName(
+ l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_WARNING));
break;
case InfoBarDelegate::PAGE_ACTION_TYPE:
- SetAccessibleName(UTF16ToWide(
- l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_PAGE_ACTION)));
+ SetAccessibleName(
+ l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_PAGE_ACTION));
break;
default:
NOTREACHED();
@@ -117,7 +117,7 @@ InfoBar::InfoBar(InfoBarDelegate* delegate)
close_button_->SetImage(views::CustomButton::BS_PUSHED,
rb.GetBitmapNamed(IDR_CLOSE_BAR_P));
close_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
AddChildView(close_button_);
animation_.reset(new ui::SlideAnimation(this));
@@ -472,10 +472,10 @@ ConfirmInfoBar::ConfirmInfoBar(ConfirmInfoBarDelegate* delegate)
initialized_(false) {
ok_button_ = InfoBarTextButton::Create(this,
delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK));
- ok_button_->SetAccessibleName(ok_button_->text());
+ ok_button_->SetAccessibleName(WideToUTF16Hack(ok_button_->text()));
cancel_button_ = InfoBarTextButton::Create(this,
delegate->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_CANCEL));
- cancel_button_->SetAccessibleName(cancel_button_->text());
+ cancel_button_->SetAccessibleName(WideToUTF16Hack(cancel_button_->text()));
// Set up the link.
link_ = new views::Link;
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index e7906c7..8a40202 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -173,7 +173,7 @@ void LocationBarView::Init() {
location_entry_view_ = location_entry_->AddToView(this);
location_entry_view_->SetID(VIEW_ID_AUTOCOMPLETE);
location_entry_view_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_LOCATION)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_LOCATION));
selected_keyword_view_ = new SelectedKeywordView(
kSelectedKeywordBackgroundImages, IDR_KEYWORD_SEARCH_MAGNIFIER,
@@ -209,8 +209,7 @@ void LocationBarView::Init() {
// AutocompleteEditView to close its popup.
SetNotifyWhenVisibleBoundsInRootChanges(true);
- SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_LOCATION)));
+ SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_LOCATION));
// Initialize the location entry. We do this to avoid a black flash which is
// visible when the location entry has just been initialized.
diff --git a/chrome/browser/ui/views/location_bar/star_view.cc b/chrome/browser/ui/views/location_bar/star_view.cc
index 2272810..2d281e6 100644
--- a/chrome/browser/ui/views/location_bar/star_view.cc
+++ b/chrome/browser/ui/views/location_bar/star_view.cc
@@ -30,7 +30,7 @@ void StarView::SetToggled(bool on) {
// Since StarView is an ImageView, the SetTooltipText changes the accessible
// name. To keep the accessible name unchanged, we need to set the accessible
// name right after we modify the tooltip text for this view.
- SetAccessibleName(UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_STAR)));
+ SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_STAR));
SetImage(ResourceBundle::GetSharedInstance().GetBitmapNamed(
on ? IDR_STAR_LIT : IDR_STAR));
}
diff --git a/chrome/browser/ui/views/options/options_group_view.cc b/chrome/browser/ui/views/options/options_group_view.cc
index 205f5da..ef3583f 100644
--- a/chrome/browser/ui/views/options/options_group_view.cc
+++ b/chrome/browser/ui/views/options/options_group_view.cc
@@ -10,6 +10,7 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/string_number_conversions.h"
+#include "base/utf_string_conversions.h"
#include "gfx/canvas.h"
#include "gfx/font.h"
#include "gfx/native_theme_win.h"
@@ -50,8 +51,8 @@ OptionsGroupView::OptionsGroupView(views::View* contents,
description_label_->SetMultiLine(true);
description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
- SetAccessibleName(title);
- contents->SetAccessibleName(title);
+ SetAccessibleName(WideToUTF16Hack(title));
+ contents->SetAccessibleName(WideToUTF16Hack(title));
}
OptionsGroupView::~OptionsGroupView() {
diff --git a/chrome/browser/ui/views/options/options_window_view.cc b/chrome/browser/ui/views/options/options_window_view.cc
index e2940d6..2ccf186 100644
--- a/chrome/browser/ui/views/options/options_window_view.cc
+++ b/chrome/browser/ui/views/options/options_window_view.cc
@@ -197,9 +197,9 @@ void OptionsWindowView::ViewHierarchyChanged(bool is_add,
void OptionsWindowView::Init() {
tabs_ = new views::TabbedPane;
- tabs_->SetAccessibleName(UTF16ToWide(
- l10n_util::GetStringFUTF16(IDS_OPTIONS_DIALOG_TITLE,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))));
+ tabs_->SetAccessibleName(l10n_util::GetStringFUTF16(
+ IDS_OPTIONS_DIALOG_TITLE,
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
tabs_->SetListener(this);
AddChildView(tabs_);
diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc
index 9e1207c..5e00eb9 100644
--- a/chrome/browser/ui/views/tabs/base_tab.cc
+++ b/chrome/browser/ui/views/tabs/base_tab.cc
@@ -141,7 +141,7 @@ BaseTab::BaseTab(TabController* controller)
close_button_->SetTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_CLOSE_TAB)));
close_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
// Disable animation so that the red danger sign shows up immediately
// to help avoid mis-clicks.
close_button_->SetAnimationDuration(0);
@@ -167,7 +167,7 @@ void BaseTab::SetData(const TabRendererData& data) {
}
// Sets the accessible name for the tab.
- SetAccessibleName(UTF16ToWide(data_.title));
+ SetAccessibleName(data_.title);
DataChanged(old);
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 7d02fbd..7bc49de 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -149,7 +149,7 @@ void TabStrip::InitTabStripButtons() {
}
LoadNewTabButtonImage();
newtab_button_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_NEWTAB)));
+ l10n_util::GetStringUTF16(IDS_ACCNAME_NEWTAB));
AddChildView(newtab_button_);
}
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 4545630..e396d37 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -153,8 +153,7 @@ void ToolbarView::Init(Profile* profile) {
views::ImageButton::ALIGN_TOP);
back_->SetTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_BACK)));
- back_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK)));
+ back_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_BACK));
back_->SetID(VIEW_ID_BACK_BUTTON);
forward_ = new views::ButtonDropDown(this, forward_menu_model_.get());
@@ -163,8 +162,7 @@ void ToolbarView::Init(Profile* profile) {
forward_->set_tag(IDC_FORWARD);
forward_->SetTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD)));
- forward_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)));
+ forward_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD));
forward_->SetID(VIEW_ID_FORWARD_BUTTON);
// Have to create this before |reload_| as |reload_|'s constructor needs it.
@@ -178,8 +176,7 @@ void ToolbarView::Init(Profile* profile) {
reload_->set_tag(IDC_RELOAD);
reload_->SetTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD)));
- reload_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)));
+ reload_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD));
reload_->SetID(VIEW_ID_RELOAD_BUTTON);
#if defined(OS_CHROMEOS)
@@ -199,8 +196,7 @@ void ToolbarView::Init(Profile* profile) {
home_->set_tag(IDC_HOME);
home_->SetTooltipText(
UTF16ToWide(l10n_util::GetStringUTF16(IDS_TOOLTIP_HOME)));
- home_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)));
+ home_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME));
home_->SetID(VIEW_ID_HOME_BUTTON);
browser_actions_ = new BrowserActionsContainer(browser_, this);
@@ -208,8 +204,7 @@ void ToolbarView::Init(Profile* profile) {
app_menu_ = new views::MenuButton(NULL, std::wstring(), this, false);
app_menu_->set_border(NULL);
app_menu_->EnableCanvasFlippingForRTLUI(true);
- app_menu_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)));
+ app_menu_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_APP));
app_menu_->SetTooltipText(UTF16ToWide(l10n_util::GetStringFUTF16(
IDS_APPMENU_TOOLTIP,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))));
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index 37b34d5..896ec8a 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -282,8 +282,8 @@ class WrenchMenuView : public ScheduleAllView, public views::ButtonListener {
int acc_string_id) {
TextButton* button =
new TextButton(this, UTF16ToWide(l10n_util::GetStringUTF16(string_id)));
- button->SetAccessibleName(UTF16ToWide(
- GetAccessibleNameForWrenchMenuItem(menu_model_, index, acc_string_id)));
+ button->SetAccessibleName(
+ GetAccessibleNameForWrenchMenuItem(menu_model_, index, acc_string_id));
button->SetFocusable(true);
button->set_request_focus_on_press(false);
button->set_tag(index);
@@ -430,9 +430,9 @@ class WrenchMenu::ZoomView : public WrenchMenuView,
0, kHorizontalPadding, 0, kHorizontalPadding));
fullscreen_button_->set_background(
new MenuButtonBackground(MenuButtonBackground::SINGLE_BUTTON));
- fullscreen_button_->SetAccessibleName(UTF16ToWide(
+ fullscreen_button_->SetAccessibleName(
GetAccessibleNameForWrenchMenuItem(
- menu_model, fullscreen_index, IDS_ACCNAME_FULLSCREEN)));
+ menu_model, fullscreen_index, IDS_ACCNAME_FULLSCREEN));
AddChildView(fullscreen_button_);
UpdateZoomControls();
@@ -572,8 +572,7 @@ WrenchMenu::WrenchMenu(Browser* browser)
void WrenchMenu::Init(ui::MenuModel* model) {
DCHECK(!root_.get());
root_.reset(new MenuItemView(this));
- root_->SetAccessibleName(
- UTF16ToWide(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)));
+ root_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_APP));
root_->set_has_icons(true); // We have checks, radios and icons, set this
// so we get the taller menu style.
int next_id = 1;