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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 2497373003: Add tab status to accessibility labels (Closed)
Patch Set: Formatting and style 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 activate_modal_dialog_factory_.GetWeakPtr())); 1587 activate_modal_dialog_factory_.GetWeakPtr()));
1588 #endif 1588 #endif
1589 return false; 1589 return false;
1590 } 1590 }
1591 1591
1592 base::string16 BrowserView::GetWindowTitle() const { 1592 base::string16 BrowserView::GetWindowTitle() const {
1593 return browser_->GetWindowTitleForCurrentTab(true /* include_app_name */); 1593 return browser_->GetWindowTitleForCurrentTab(true /* include_app_name */);
1594 } 1594 }
1595 1595
1596 base::string16 BrowserView::GetAccessibleWindowTitle() const { 1596 base::string16 BrowserView::GetAccessibleWindowTitle() const {
1597 const bool include_app_name = false; 1597 Tab* current_tab =
1598 if (IsIncognito()) { 1598 tabstrip_->tab_at(browser_->tab_strip_model()->active_index());
1599 return l10n_util::GetStringFUTF16( 1599 return current_tab->GetAccessibleTabLabel();
1600 IDS_ACCESSIBLE_INCOGNITO_WINDOW_TITLE_FORMAT,
1601 browser_->GetWindowTitleForCurrentTab(include_app_name));
1602 }
1603 return browser_->GetWindowTitleForCurrentTab(include_app_name);
sky 2016/11/26 17:19:33 GetWindowTitleForCurrentTab() has a couple of heur
edwardjung 2016/12/06 20:23:16 Done.
1604 } 1600 }
1605 1601
1606 views::View* BrowserView::GetInitiallyFocusedView() { 1602 views::View* BrowserView::GetInitiallyFocusedView() {
1607 return nullptr; 1603 return nullptr;
1608 } 1604 }
1609 1605
1610 bool BrowserView::ShouldShowWindowTitle() const { 1606 bool BrowserView::ShouldShowWindowTitle() const {
1611 #if defined(USE_ASH) 1607 #if defined(USE_ASH)
1612 // For Ash only, trusted windows (apps and settings) do not show a title, 1608 // For Ash only, trusted windows (apps and settings) do not show a title,
1613 // crbug.com/119411. Child windows (i.e. popups) do show a title. 1609 // crbug.com/119411. Child windows (i.e. popups) do show a title.
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
2596 } 2592 }
2597 2593
2598 extensions::ActiveTabPermissionGranter* 2594 extensions::ActiveTabPermissionGranter*
2599 BrowserView::GetActiveTabPermissionGranter() { 2595 BrowserView::GetActiveTabPermissionGranter() {
2600 content::WebContents* web_contents = GetActiveWebContents(); 2596 content::WebContents* web_contents = GetActiveWebContents();
2601 if (!web_contents) 2597 if (!web_contents)
2602 return nullptr; 2598 return nullptr;
2603 return extensions::TabHelper::FromWebContents(web_contents) 2599 return extensions::TabHelper::FromWebContents(web_contents)
2604 ->active_tab_permission_granter(); 2600 ->active_tab_permission_granter();
2605 } 2601 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698