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

Unified Diff: ui/app_list/views/folder_header_view.cc

Issue 253833004: Add vox support for reading unnamed folder description and fix a focus bug when app launcher is ope… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a commnent. Created 6 years, 8 months 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
« no previous file with comments | « ui/app_list/views/folder_header_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/folder_header_view.cc
diff --git a/ui/app_list/views/folder_header_view.cc b/ui/app_list/views/folder_header_view.cc
index 29f84d32b8e39200d2c1af55f1035c79b5223506..fd54984b80f3edf1e4ec4a72f7cc185a3b713589 100644
--- a/ui/app_list/views/folder_header_view.cc
+++ b/ui/app_list/views/folder_header_view.cc
@@ -117,11 +117,23 @@ void FolderHeaderView::Update() {
folder_name_view_->SetVisible(folder_name_visible_);
if (folder_name_visible_) {
folder_name_view_->SetText(base::UTF8ToUTF16(folder_item_->name()));
+ UpdateFolderNameAccessibleName();
}
Layout();
}
+void FolderHeaderView::UpdateFolderNameAccessibleName() {
+ // Sets |folder_name_view_|'s accessible name to the placeholder text if
+ // |folder_name_view_| is blank; otherwise, clear the accessible name, the
+ // accessible state's value is set to be folder_name_view_->text() by
+ // TextField.
+ base::string16 accessible_name = folder_name_view_->text().empty()
+ ? folder_name_placeholder_text_
+ : base::string16();
+ folder_name_view_->SetAccessibleName(accessible_name);
+}
+
const base::string16& FolderHeaderView::GetFolderNameForTest() {
return folder_name_view_->text();
}
@@ -198,6 +210,8 @@ void FolderHeaderView::ContentsChanged(views::Textfield* sender,
delegate_->SetItemName(folder_item_, name);
folder_item_->AddObserver(this);
+ UpdateFolderNameAccessibleName();
+
Layout();
}
« no previous file with comments | « ui/app_list/views/folder_header_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698