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

Unified Diff: chrome/browser/ui/views/desktop_media_picker_views.cc

Issue 1313843003: Enable keyboard navigation for Desktopcapture window selection dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: q Created 5 years, 3 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
Index: chrome/browser/ui/views/desktop_media_picker_views.cc
diff --git a/chrome/browser/ui/views/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_media_picker_views.cc
index b2975b2b2309b25d1a1208e10f30ccd1bbb3a35c..181e9becc0f1d495137d83157a9aabea1491dbfb 100644
--- a/chrome/browser/ui/views/desktop_media_picker_views.cc
+++ b/chrome/browser/ui/views/desktop_media_picker_views.cc
@@ -206,6 +206,9 @@ DesktopMediaListView::DesktopMediaListView(
media_list_(media_list.Pass()),
weak_factory_(this) {
media_list_->SetThumbnailSize(gfx::Size(kThumbnailWidth, kThumbnailHeight));
+
+ // Enable keyboard focus
Peter Kasting 2015/09/23 22:43:57 This comment adds nothing to the code; remove it.
gyzhou 2015/09/23 23:43:40 Done.
+ SetFocusable(true);
}
DesktopMediaListView::~DesktopMediaListView() {}
@@ -443,10 +446,23 @@ DesktopMediaPickerDialogView::DesktopMediaPickerDialogView(
}
list_view_->StartUpdating(dialog_window_id);
+
+ // Request keyboard focus for initial view.
Peter Kasting 2015/09/23 22:43:57 This block should not be necessary because the wid
gyzhou 2015/09/23 23:43:40 Done.
+ views::View* initView = GetInitiallyFocusedView();
+ if (initView)
+ initView->RequestFocus();
}
DesktopMediaPickerDialogView::~DesktopMediaPickerDialogView() {}
+views::View* DesktopMediaPickerDialogView::GetInitiallyFocusedView()
+{
+ if (list_view_)
Peter Kasting 2015/09/23 22:43:57 Why null-check this when it can't ever be null?
gyzhou 2015/09/23 23:43:40 Done.
+ return list_view_;
+
+ return NULL;
+}
+
void DesktopMediaPickerDialogView::DetachParent() {
parent_ = NULL;
}

Powered by Google App Engine
This is Rietveld 408576698