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

Unified Diff: chrome/browser/ui/views/app_list/app_list_dialog_container.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 | « no previous file | chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/app_list/app_list_dialog_container.cc
diff --git a/chrome/browser/ui/views/app_list/app_list_dialog_container.cc b/chrome/browser/ui/views/app_list/app_list_dialog_container.cc
index 49eb02a21e3d36d379076beeda7a2c11b830c1e8..c60e48d0372c1bc85dca11960e0ce35eb52aa320 100644
--- a/chrome/browser/ui/views/app_list/app_list_dialog_container.cc
+++ b/chrome/browser/ui/views/app_list/app_list_dialog_container.cc
@@ -86,9 +86,15 @@ class AppListDialogContainer : public views::DialogDelegateView,
dialog_body_->SetBoundsRect(GetContentsBounds());
views::DialogDelegateView::Layout();
}
+ void ViewHierarchyChanged(
+ const ViewHierarchyChangedDetails& details) override {
+ views::DialogDelegateView::ViewHierarchyChanged(details);
+ if (details.is_add && details.child == this)
+ GetFocusManager()->AdvanceFocus(false);
+ }
// Overridden from views::WidgetDelegate:
- views::View* GetInitiallyFocusedView() override { return GetContentsView(); }
+ views::View* GetInitiallyFocusedView() override { return NULL; }
ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_WINDOW; }
void WindowClosing() override {
if (!close_callback_.is_null())
@@ -160,6 +166,12 @@ class NativeDialogContainer : public views::DialogDelegateView {
private:
// Overridden from views::View:
gfx::Size GetPreferredSize() const override { return size_; }
+ void ViewHierarchyChanged(
+ const ViewHierarchyChangedDetails& details) override {
+ views::DialogDelegateView::ViewHierarchyChanged(details);
+ if (details.is_add && details.child == this)
+ GetFocusManager()->AdvanceFocus(false);
+ }
// Overridden from views::WidgetDelegate:
ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_WINDOW; }
« no previous file with comments | « no previous file | chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698