Commit c38b35ae authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Ensure accessible names for app browser windows and in window selector

The window selector gets names from Aura windows. Propagate titles from
app names to the aura window titles, as the web content itself may not
have a title.

This is split out from the CL to test all widgets and views for
nameless focusable objects. See crrev.com/c/951933.

Bug: 819350
Change-Id: Id61d9398824b836a644c57813f1521faf1aae70f
Reviewed-on: https://chromium-review.googlesource.com/961093Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543063}
parent 9ef10a9b
...@@ -651,6 +651,16 @@ base::string16 Browser::GetWindowTitleFromWebContents( ...@@ -651,6 +651,16 @@ base::string16 Browser::GetWindowTitleFromWebContents(
// On Mac, we don't want to suffix the page title with the application name. // On Mac, we don't want to suffix the page title with the application name.
return title; return title;
#endif #endif
// If there is no title and this is an app, fall back on the app name. This
// ensures that the native window gets a title which is important for a11y,
// for example the window selector uses the Aura window title.
if (title.empty() && is_app() && include_app_name) {
return base::UTF8ToUTF16(hosted_app_controller_
? hosted_app_controller_->GetAppShortName()
: app_name());
}
// Include the app name in window titles for tabbed browser windows when // Include the app name in window titles for tabbed browser windows when
// requested with |include_app_name|. // requested with |include_app_name|.
return (!is_app() && include_app_name) ? return (!is_app() && include_app_name) ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment