Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1192)

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 2579893002: Revert "Add tab status to accessibility labels". (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 14a5d8356e6f6256f2f115796f67d5b5ff2f3def..f2a776f3b188e2ffb5e54ed5588256b86d3b0d6b 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1595,64 +1595,12 @@ base::string16 BrowserView::GetWindowTitle() const {
base::string16 BrowserView::GetAccessibleWindowTitle() const {
const bool include_app_name = false;
- Tab* current_tab =
- tabstrip_->tab_at(browser_->tab_strip_model()->active_index());
-
if (IsIncognito()) {
return l10n_util::GetStringFUTF16(
IDS_ACCESSIBLE_INCOGNITO_WINDOW_TITLE_FORMAT,
- GetAccessibleTabLabel(include_app_name, current_tab->data()));
- }
- return GetAccessibleTabLabel(include_app_name, current_tab->data());
-}
-
-base::string16 BrowserView::GetAccessibleTabLabel(
- bool include_app_name,
- const TabRendererData& data) const {
- base::string16 window_title =
- browser_->GetWindowTitleForCurrentTab(include_app_name);
- base::string16 tab_label;
- if (data.IsCrashed()) {
- // Tab has crashed.
- tab_label = l10n_util::GetStringFUTF16(IDS_TAB_AX_LABEL_CRASHED_FORMAT,
- window_title);
- } else if (data.network_state == TabRendererData::NETWORK_STATE_ERROR) {
- // Network error interstitial.
- tab_label = l10n_util::GetStringFUTF16(
- IDS_TAB_AX_LABEL_NETWORK_ERROR_FORMAT, window_title);
- } else {
- // Alert tab states.
- switch (data.alert_state) {
- case TabAlertState::AUDIO_PLAYING:
- tab_label = l10n_util::GetStringFUTF16(
- IDS_TAB_AX_LABEL_AUDIO_PLAYING_FORMAT, window_title);
- break;
- case TabAlertState::USB_CONNECTED:
- tab_label = l10n_util::GetStringFUTF16(
- IDS_TAB_AX_LABEL_USB_CONNECTED_FORMAT, window_title);
- break;
- case TabAlertState::BLUETOOTH_CONNECTED:
- tab_label = l10n_util::GetStringFUTF16(
- IDS_TAB_AX_LABEL_BLUETOOTH_CONNECTED_FORMAT, window_title);
- break;
- case TabAlertState::MEDIA_RECORDING:
- tab_label = l10n_util::GetStringFUTF16(
- IDS_TAB_AX_LABEL_MEDIA_RECORDING_FORMAT, window_title);
- break;
- case TabAlertState::AUDIO_MUTING:
- tab_label = l10n_util::GetStringFUTF16(
- IDS_TAB_AX_LABEL_AUDIO_MUTING_FORMAT, window_title);
- break;
- case TabAlertState::TAB_CAPTURING:
- tab_label = l10n_util::GetStringFUTF16(
- IDS_TAB_AX_LABEL_TAB_CAPTURING_FORMAT, window_title);
- break;
- case TabAlertState::NONE:
- tab_label = window_title;
- break;
- }
+ browser_->GetWindowTitleForCurrentTab(include_app_name));
}
- return tab_label;
+ return browser_->GetWindowTitleForCurrentTab(include_app_name);
}
views::View* BrowserView::GetInitiallyFocusedView() {
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698