Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/desktop_media_picker_views.h" | 5 #include "chrome/browser/ui/views/desktop_media_picker_views.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/media/desktop_media_list.h" | 10 #include "chrome/browser/media/desktop_media_list.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 436 #endif | 436 #endif |
| 437 | 437 |
| 438 // Set native window ID if the windows is outside Ash. | 438 // Set native window ID if the windows is outside Ash. |
| 439 if (!is_ash_window) { | 439 if (!is_ash_window) { |
| 440 dialog_window_id.id = AcceleratedWidgetToDesktopMediaId( | 440 dialog_window_id.id = AcceleratedWidgetToDesktopMediaId( |
| 441 widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()); | 441 widget->GetNativeWindow()->GetHost()->GetAcceleratedWidget()); |
| 442 } | 442 } |
| 443 } | 443 } |
| 444 | 444 |
| 445 list_view_->StartUpdating(dialog_window_id); | 445 list_view_->StartUpdating(dialog_window_id); |
| 446 | |
| 447 // Enable and request keyboard focus for list view. | |
| 448 list_view_->SetFocusable(true); | |
|
Peter Kasting
2015/09/23 20:54:20
I would move this to the list view's constructor.
gyzhou
2015/09/23 22:37:26
Done.
| |
| 449 list_view_->RequestFocus(); | |
|
Peter Kasting
2015/09/23 20:54:20
I would instead implement this by overriding GetIn
gyzhou
2015/09/23 22:37:26
Done.
| |
| 446 } | 450 } |
| 447 | 451 |
| 448 DesktopMediaPickerDialogView::~DesktopMediaPickerDialogView() {} | 452 DesktopMediaPickerDialogView::~DesktopMediaPickerDialogView() {} |
| 449 | 453 |
| 450 void DesktopMediaPickerDialogView::DetachParent() { | 454 void DesktopMediaPickerDialogView::DetachParent() { |
| 451 parent_ = NULL; | 455 parent_ = NULL; |
| 452 } | 456 } |
| 453 | 457 |
| 454 gfx::Size DesktopMediaPickerDialogView::GetPreferredSize() const { | 458 gfx::Size DesktopMediaPickerDialogView::GetPreferredSize() const { |
| 455 static const size_t kDialogViewWidth = 600; | 459 static const size_t kDialogViewWidth = 600; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 585 content::BrowserThread::PostTask( | 589 content::BrowserThread::PostTask( |
| 586 content::BrowserThread::UI, FROM_HERE, | 590 content::BrowserThread::UI, FROM_HERE, |
| 587 base::Bind(callback_, source)); | 591 base::Bind(callback_, source)); |
| 588 callback_.Reset(); | 592 callback_.Reset(); |
| 589 } | 593 } |
| 590 | 594 |
| 591 // static | 595 // static |
| 592 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 596 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
| 593 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 597 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
| 594 } | 598 } |
| OLD | NEW |