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

Unified Diff: chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc

Issue 689833004: Auto-focus the first button in the App Info dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@accessibility_dialog
Patch Set: Made the initially focused view return NULL Created 6 years, 1 month 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 | « chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
index c32b1deae15c6c9810c413dfe11df075caa74bfb..84112a38277a47a9714a38216329e1a59369ffb8 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
@@ -82,18 +82,24 @@ void AppInfoFooterPanel::LayoutButtons() {
AddChildView(pin_to_shelf_button_);
if (unpin_from_shelf_button_)
AddChildView(unpin_from_shelf_button_);
- UpdatePinButtons();
+ UpdatePinButtons(false);
if (remove_button_)
AddChildView(remove_button_);
}
-void AppInfoFooterPanel::UpdatePinButtons() {
+void AppInfoFooterPanel::UpdatePinButtons(bool focus_visible_button) {
if (pin_to_shelf_button_ && unpin_from_shelf_button_) {
bool is_pinned =
!ash::Shell::GetInstance()->GetShelfDelegate()->IsAppPinned(app_->id());
pin_to_shelf_button_->SetVisible(is_pinned);
unpin_from_shelf_button_->SetVisible(!is_pinned);
+
+ if (focus_visible_button) {
+ views::View* button_to_focus =
+ is_pinned ? pin_to_shelf_button_ : unpin_from_shelf_button_;
+ button_to_focus->RequestFocus();
+ }
}
}
@@ -153,7 +159,7 @@ void AppInfoFooterPanel::SetPinnedToShelf(bool value) {
else
shelf_delegate->UnpinAppWithID(app_->id());
- UpdatePinButtons();
+ UpdatePinButtons(true);
Layout();
}
« no previous file with comments | « chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698