diff options
53 files changed, 149 insertions, 152 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(¤t_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; diff --git a/views/accessibility/view_accessibility.cc b/views/accessibility/view_accessibility.cc index 5d51d814..1364157 100644 --- a/views/accessibility/view_accessibility.cc +++ b/views/accessibility/view_accessibility.cc @@ -282,7 +282,7 @@ STDMETHODIMP ViewAccessibility::get_accDefaultAction( if (!view_) return E_FAIL; - std::wstring temp_action = view_->GetAccessibleDefaultAction(); + string16 temp_action = view_->GetAccessibleDefaultAction(); if (!temp_action.empty()) { *def_action = SysAllocString(temp_action.c_str()); @@ -347,7 +347,7 @@ STDMETHODIMP ViewAccessibility::get_accKeyboardShortcut( if (!view_) return E_FAIL; - std::wstring temp_key = view_->GetAccessibleKeyboardShortcut(); + string16 temp_key = view_->GetAccessibleKeyboardShortcut(); if (!temp_key.empty()) { *acc_key = SysAllocString(temp_key.c_str()); @@ -365,7 +365,7 @@ STDMETHODIMP ViewAccessibility::get_accName(VARIANT var_id, BSTR* name) { if (!view_) return E_FAIL; - std::wstring temp_name; + string16 temp_name; // Retrieve the current view's name. view_->GetAccessibleName(&temp_name); @@ -457,7 +457,7 @@ STDMETHODIMP ViewAccessibility::get_accValue(VARIANT var_id, BSTR* value) { return E_FAIL; // Retrieve the current view's value. - std::wstring temp_value = view_->GetAccessibleValue(); + string16 temp_value = view_->GetAccessibleValue(); if (!temp_value.empty()) { // Return value retrieved. diff --git a/views/controls/button/button.cc b/views/controls/button/button.cc index a80902d..b59fd89 100644 --- a/views/controls/button/button.cc +++ b/views/controls/button/button.cc @@ -33,8 +33,8 @@ bool Button::GetTooltipText(const gfx::Point& p, std::wstring* tooltip) { return true; } -std::wstring Button::GetAccessibleKeyboardShortcut() { - return UTF16ToWideHack(accessible_shortcut_); +string16 Button::GetAccessibleKeyboardShortcut() { + return accessible_shortcut_; } AccessibilityTypes::Role Button::GetAccessibleRole() { diff --git a/views/controls/button/button.h b/views/controls/button/button.h index 0f9eb9d..263e45f 100644 --- a/views/controls/button/button.h +++ b/views/controls/button/button.h @@ -39,9 +39,10 @@ class Button : public View { void SetAccessibleKeyboardShortcut(const std::wstring& shortcut); // Overridden from View: - virtual bool GetTooltipText(const gfx::Point& p, std::wstring* tooltip); - virtual std::wstring GetAccessibleKeyboardShortcut(); - virtual AccessibilityTypes::Role GetAccessibleRole(); + virtual bool GetTooltipText(const gfx::Point& p, + std::wstring* tooltip) OVERRIDE; + virtual string16 GetAccessibleKeyboardShortcut() OVERRIDE; + virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; protected: // Construct the Button with a Listener. The listener can be NULL. This can be diff --git a/views/controls/button/button_dropdown.cc b/views/controls/button/button_dropdown.cc index d8625d9..74e598e 100644 --- a/views/controls/button/button_dropdown.cc +++ b/views/controls/button/button_dropdown.cc @@ -165,8 +165,8 @@ void ButtonDropDown::ShowDropDownMenu(gfx::NativeView window) { // //////////////////////////////////////////////////////////////////////////////// -std::wstring ButtonDropDown::GetAccessibleDefaultAction() { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_ACCACTION_PRESS)); +string16 ButtonDropDown::GetAccessibleDefaultAction() { + return l10n_util::GetStringUTF16(IDS_APP_ACCACTION_PRESS); } AccessibilityTypes::Role ButtonDropDown::GetAccessibleRole() { diff --git a/views/controls/button/button_dropdown.h b/views/controls/button/button_dropdown.h index e2c372e04..07b8276 100644 --- a/views/controls/button/button_dropdown.h +++ b/views/controls/button/button_dropdown.h @@ -26,9 +26,9 @@ class ButtonDropDown : public ImageButton { virtual ~ButtonDropDown(); // Accessibility accessors, overridden from View. - virtual std::wstring GetAccessibleDefaultAction(); - virtual AccessibilityTypes::Role GetAccessibleRole(); - virtual AccessibilityTypes::State GetAccessibleState(); + virtual string16 GetAccessibleDefaultAction() OVERRIDE; + virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; + virtual AccessibilityTypes::State GetAccessibleState() OVERRIDE; private: // Overridden from CustomButton diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc index ad51681..1f2ca9f 100644 --- a/views/controls/button/menu_button.cc +++ b/views/controls/button/menu_button.cc @@ -256,8 +256,8 @@ void MenuButton::OnMouseExited(const MouseEvent& event) { // //////////////////////////////////////////////////////////////////////////////// -std::wstring MenuButton::GetAccessibleDefaultAction() { - return UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_ACCACTION_PRESS)); +string16 MenuButton::GetAccessibleDefaultAction() { + return l10n_util::GetStringUTF16(IDS_APP_ACCACTION_PRESS); } AccessibilityTypes::Role MenuButton::GetAccessibleRole() { diff --git a/views/controls/button/menu_button.h b/views/controls/button/menu_button.h index 1e78a9c..75489f6 100644 --- a/views/controls/button/menu_button.h +++ b/views/controls/button/menu_button.h @@ -58,9 +58,9 @@ class MenuButton : public TextButton { virtual bool OnKeyReleased(const KeyEvent& e); // Accessibility accessors, overridden from View. - virtual std::wstring GetAccessibleDefaultAction(); - virtual AccessibilityTypes::Role GetAccessibleRole(); - virtual AccessibilityTypes::State GetAccessibleState(); + virtual string16 GetAccessibleDefaultAction() OVERRIDE; + virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; + virtual AccessibilityTypes::State GetAccessibleState() OVERRIDE; // Returns views/MenuButton. virtual std::string GetClassName() const; diff --git a/views/controls/button/native_button.cc b/views/controls/button/native_button.cc index 71a6b5a4..0b8da4f 100644 --- a/views/controls/button/native_button.cc +++ b/views/controls/button/native_button.cc @@ -80,7 +80,7 @@ void NativeButton::SetLabel(const std::wstring& label) { native_wrapper_->UpdateLabel(); // Update the accessible name whenever the label changes. - SetAccessibleName(label); + SetAccessibleName(WideToUTF16Hack(label)); PreferredSizeChanged(); } diff --git a/views/controls/button/native_button_win.cc b/views/controls/button/native_button_win.cc index f0b1b36..c0b2681 100644 --- a/views/controls/button/native_button_win.cc +++ b/views/controls/button/native_button_win.cc @@ -71,7 +71,7 @@ void NativeButtonWin::UpdateDefault() { } void NativeButtonWin::UpdateAccessibleName() { - std::wstring name; + string16 name; if (native_button_->GetAccessibleName(&name)) { base::win::ScopedComPtr<IAccPropServices> pAccPropServices; HRESULT hr = CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, diff --git a/views/controls/button/text_button.cc b/views/controls/button/text_button.cc index 470d97c..1216be0 100644 --- a/views/controls/button/text_button.cc +++ b/views/controls/button/text_button.cc @@ -211,7 +211,7 @@ TextButton::~TextButton() { void TextButton::SetText(const std::wstring& text) { text_ = WideToUTF16Hack(text); - SetAccessibleName(text); + SetAccessibleName(WideToUTF16Hack(text)); UpdateTextSize(); } diff --git a/views/controls/combobox/combobox.cc b/views/controls/combobox/combobox.cc index 6eb32ba..0c7f293 100644 --- a/views/controls/combobox/combobox.cc +++ b/views/controls/combobox/combobox.cc @@ -93,8 +93,8 @@ AccessibilityTypes::Role Combobox::GetAccessibleRole() { return AccessibilityTypes::ROLE_COMBOBOX; } -std::wstring Combobox::GetAccessibleValue() { - return UTF16ToWideHack(model_->GetItemAt(selected_item_)); +string16 Combobox::GetAccessibleValue() { + return model_->GetItemAt(selected_item_); } void Combobox::Focus() { diff --git a/views/controls/combobox/combobox.h b/views/controls/combobox/combobox.h index d306761..4d48ec1 100644 --- a/views/controls/combobox/combobox.h +++ b/views/controls/combobox/combobox.h @@ -64,8 +64,8 @@ class Combobox : public View { virtual void SetEnabled(bool enabled); virtual bool SkipDefaultKeyEventProcessing(const KeyEvent& e); virtual void PaintFocusBorder(gfx::Canvas* canvas); - virtual AccessibilityTypes::Role GetAccessibleRole(); - virtual std::wstring GetAccessibleValue(); + virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; + virtual string16 GetAccessibleValue() OVERRIDE; protected: virtual void Focus(); diff --git a/views/controls/image_view.cc b/views/controls/image_view.cc index 68b7b9d..e3fe5a3c 100644 --- a/views/controls/image_view.cc +++ b/views/controls/image_view.cc @@ -154,7 +154,7 @@ ImageView::Alignment ImageView::GetVerticalAlignment() { void ImageView::SetTooltipText(const std::wstring& tooltip) { tooltip_text_ = WideToUTF16Hack(tooltip); - SetAccessibleName(tooltip); + SetAccessibleName(WideToUTF16Hack(tooltip)); } std::wstring ImageView::GetTooltipText() { diff --git a/views/controls/label.cc b/views/controls/label.cc index 8692622..62a9198 100644 --- a/views/controls/label.cc +++ b/views/controls/label.cc @@ -107,7 +107,7 @@ void Label::SetText(const std::wstring& text) { text_ = WideToUTF16Hack(text); url_set_ = false; text_size_valid_ = false; - SetAccessibleName(text); + SetAccessibleName(WideToUTF16Hack(text)); PreferredSizeChanged(); SchedulePaint(); } diff --git a/views/controls/label_unittest.cc b/views/controls/label_unittest.cc index 504861e..44d101b 100644 --- a/views/controls/label_unittest.cc +++ b/views/controls/label_unittest.cc @@ -156,12 +156,12 @@ TEST(LabelTest, TooltipProperty) { TEST(LabelTest, Accessibility) { Label label; - std::wstring test_text(L"My special text."); - label.SetText(test_text); + string16 test_text(ASCIIToUTF16("My special text.")); + label.SetText(UTF16ToWideHack(test_text)); EXPECT_EQ(AccessibilityTypes::ROLE_STATICTEXT, label.GetAccessibleRole()); - std::wstring name; + string16 name; EXPECT_TRUE(label.GetAccessibleName(&name)); EXPECT_EQ(test_text, name); diff --git a/views/controls/menu/menu_item_view.cc b/views/controls/menu/menu_item_view.cc index ee60c79..b5c1ced 100644 --- a/views/controls/menu/menu_item_view.cc +++ b/views/controls/menu/menu_item_view.cc @@ -306,8 +306,7 @@ SubmenuView* MenuItemView::CreateSubmenu() { void MenuItemView::SetTitle(const std::wstring& title) { title_ = WideToUTF16Hack(title); - SetAccessibleName(UTF16ToWideHack( - GetAccessibleNameForMenuItem(title_, GetAcceleratorText()))); + SetAccessibleName(GetAccessibleNameForMenuItem(title_, GetAcceleratorText())); } void MenuItemView::SetSelected(bool selected) { diff --git a/views/controls/menu/submenu_view.cc b/views/controls/menu/submenu_view.cc index 053b804..63a4613 100644 --- a/views/controls/menu/submenu_view.cc +++ b/views/controls/menu/submenu_view.cc @@ -312,7 +312,7 @@ MenuScrollViewContainer* SubmenuView::GetScrollViewContainer() { scroll_view_container_->set_parent_owned(false); // Use the parent menu item accessible name for the menu view. - std::wstring accessible_name; + string16 accessible_name; GetMenuItem()->GetAccessibleName(&accessible_name); scroll_view_container_->SetAccessibleName(accessible_name); SetAccessibleName(accessible_name); diff --git a/views/controls/progress_bar_unittest.cc b/views/controls/progress_bar_unittest.cc index 362f48f..55acfd4 100644 --- a/views/controls/progress_bar_unittest.cc +++ b/views/controls/progress_bar_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/string_util.h" +#include "base/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" #include "views/controls/progress_bar.h" @@ -49,10 +50,10 @@ TEST(ProgressBarTest, Accessibility) { EXPECT_EQ(AccessibilityTypes::ROLE_PROGRESSBAR, bar.GetAccessibleRole()); - std::wstring name; + string16 name; EXPECT_FALSE(bar.GetAccessibleName(&name)); - EXPECT_EQ(std::wstring(), name); - std::wstring accessible_name = L"My progress bar"; + EXPECT_EQ(string16(), name); + string16 accessible_name = ASCIIToUTF16("My progress bar"); bar.SetAccessibleName(accessible_name); EXPECT_TRUE(bar.GetAccessibleName(&name)); EXPECT_EQ(accessible_name, name); diff --git a/views/controls/tabbed_pane/tabbed_pane.cc b/views/controls/tabbed_pane/tabbed_pane.cc index 6fb07ea..07a2d8d 100644 --- a/views/controls/tabbed_pane/tabbed_pane.cc +++ b/views/controls/tabbed_pane/tabbed_pane.cc @@ -5,6 +5,8 @@ #include "views/controls/tabbed_pane/tabbed_pane.h" #include "base/logging.h" +// TODO(avi): remove when not needed +#include "base/utf_string_conversions.h" #include "ui/base/keycodes/keyboard_codes.h" #include "views/controls/native/native_view_host.h" #include "views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" @@ -36,7 +38,7 @@ void TabbedPane::AddTabAtIndex(int index, bool select_if_first_tab) { native_tabbed_pane_->AddTabAtIndex(index, title, contents, select_if_first_tab); - contents->SetAccessibleName(title); + contents->SetAccessibleName(WideToUTF16Hack(title)); PreferredSizeChanged(); } diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc index 63e3082..9b5595b 100644 --- a/views/controls/textfield/native_textfield_win.cc +++ b/views/controls/textfield/native_textfield_win.cc @@ -395,13 +395,13 @@ void NativeTextfieldWin::InitializeAccessibilityInfo() { // Set the accessible name by getting the label text. View* parent = textfield_->GetParent(); int label_index = parent->GetChildIndex(textfield_) - 1; - if (label_index >= 0) { + if (label_index >= 0) { // Try to find the name of this text field. // We expect it to be a Label preceeding this view (if it exists). - std::wstring name; - View* label_view = parent->GetChildViewAt(label_index ); - if (label_view ->GetClassName() == Label::kViewClassName && - label_view ->GetAccessibleName(&name)) { + string16 name; + View* label_view = parent->GetChildViewAt(label_index); + if (label_view->GetClassName() == Label::kViewClassName && + label_view->GetAccessibleName(&name)) { hr = pAccPropServices->SetHwndPropStr(m_hWnd, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_NAME, name.c_str()); } diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc index 66f7489..50e6b94 100644 --- a/views/controls/textfield/textfield.cc +++ b/views/controls/textfield/textfield.cc @@ -327,10 +327,10 @@ AccessibilityTypes::State Textfield::GetAccessibleState() { return state; } -std::wstring Textfield::GetAccessibleValue() { +string16 Textfield::GetAccessibleValue() { if (!text_.empty()) - return UTF16ToWide(text_); - return std::wstring(); + return text_; + return string16(); } void Textfield::SetEnabled(bool enabled) { diff --git a/views/controls/textfield/textfield.h b/views/controls/textfield/textfield.h index afcc441..3d7ce38 100644 --- a/views/controls/textfield/textfield.h +++ b/views/controls/textfield/textfield.h @@ -209,9 +209,9 @@ class Textfield : public View { virtual void WillLoseFocus(); // Accessibility accessors, overridden from View: - virtual AccessibilityTypes::Role GetAccessibleRole(); - virtual AccessibilityTypes::State GetAccessibleState(); - virtual std::wstring GetAccessibleValue(); + virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; + virtual AccessibilityTypes::State GetAccessibleState() OVERRIDE; + virtual string16 GetAccessibleValue() OVERRIDE; protected: virtual void Focus(); diff --git a/views/view.cc b/views/view.cc index fa8f1a4..d70e48b 100644 --- a/views/view.cc +++ b/views/view.cc @@ -1160,12 +1160,12 @@ bool View::InDrag() { return root_view ? (root_view->GetDragView() == this) : false; } -bool View::GetAccessibleName(std::wstring* name) { +bool View::GetAccessibleName(string16* name) { DCHECK(name); if (accessible_name_.empty()) return false; - *name = UTF16ToWideHack(accessible_name_); + *name = accessible_name_; return true; } @@ -1173,8 +1173,8 @@ AccessibilityTypes::Role View::GetAccessibleRole() { return AccessibilityTypes::ROLE_CLIENT; } -void View::SetAccessibleName(const std::wstring& name) { - accessible_name_ = WideToUTF16Hack(name); +void View::SetAccessibleName(const string16& name) { + accessible_name_ = name; } // static diff --git a/views/view.h b/views/view.h index 6b0f56c..3c77e03 100644 --- a/views/view.h +++ b/views/view.h @@ -571,18 +571,18 @@ class View : public AcceleratorTarget { // describes the default action that will occur when executing // IAccessible::DoDefaultAction. For instance, default action of a button is // 'Press'. - virtual std::wstring GetAccessibleDefaultAction() { return std::wstring(); } + virtual string16 GetAccessibleDefaultAction() { return string16(); } // Returns a string containing the mnemonic, or the keyboard shortcut, for a // given control. - virtual std::wstring GetAccessibleKeyboardShortcut() { - return std::wstring(); + virtual string16 GetAccessibleKeyboardShortcut() { + return string16(); } // Returns a brief, identifying string, containing a unique, readable name of // a given control. Sets the input string appropriately, and returns true if // successful. - bool GetAccessibleName(std::wstring* name); + bool GetAccessibleName(string16* name); // Returns the accessibility role of the current view. The role is what // assistive technologies (ATs) use to determine what behavior to expect from @@ -595,12 +595,12 @@ class View : public AcceleratorTarget { } // Returns the current value associated with a view. - virtual std::wstring GetAccessibleValue() { return std::wstring(); } + virtual string16 GetAccessibleValue() { return string16(); } // Assigns a string name to the given control. Needed as a View does not know // which name will be associated with it until it is created to be a // certain type. - void SetAccessibleName(const std::wstring& name); + void SetAccessibleName(const string16& name); // Returns an instance of the (platform-specific) accessibility interface for // the View. diff --git a/views/window/custom_frame_view.cc b/views/window/custom_frame_view.cc index c2d8599..1b3351c 100644 --- a/views/window/custom_frame_view.cc +++ b/views/window/custom_frame_view.cc @@ -78,13 +78,13 @@ CustomFrameView::CustomFrameView(Window* frame) ResourceBundle& rb = ResourceBundle::GetSharedInstance(); close_button_->SetAccessibleName( - UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CLOSE))); + l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CLOSE)); // Close button images will be set in LayoutWindowControls(). AddChildView(close_button_); restore_button_->SetAccessibleName( - UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_ACCNAME_RESTORE))); + l10n_util::GetStringUTF16(IDS_APP_ACCNAME_RESTORE)); restore_button_->SetImage(CustomButton::BS_NORMAL, rb.GetBitmapNamed(IDR_RESTORE)); restore_button_->SetImage(CustomButton::BS_HOT, @@ -94,7 +94,7 @@ CustomFrameView::CustomFrameView(Window* frame) AddChildView(restore_button_); maximize_button_->SetAccessibleName( - UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_ACCNAME_MAXIMIZE))); + l10n_util::GetStringUTF16(IDS_APP_ACCNAME_MAXIMIZE)); maximize_button_->SetImage(CustomButton::BS_NORMAL, rb.GetBitmapNamed(IDR_MAXIMIZE)); maximize_button_->SetImage(CustomButton::BS_HOT, @@ -104,7 +104,7 @@ CustomFrameView::CustomFrameView(Window* frame) AddChildView(maximize_button_); minimize_button_->SetAccessibleName( - UTF16ToWide(l10n_util::GetStringUTF16(IDS_APP_ACCNAME_MINIMIZE))); + l10n_util::GetStringUTF16(IDS_APP_ACCNAME_MINIMIZE)); minimize_button_->SetImage(CustomButton::BS_NORMAL, rb.GetBitmapNamed(IDR_MINIMIZE)); minimize_button_->SetImage(CustomButton::BS_HOT, |