Chromium Code Reviews| 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; |
| } |