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 cb9007fff365b15c09b574073f74774ef1ea13fa..51667a348e73452d6106ce243531b89170811834 100644 |
--- a/chrome/browser/ui/views/desktop_media_picker_views.cc |
+++ b/chrome/browser/ui/views/desktop_media_picker_views.cc |
@@ -495,23 +495,29 @@ DesktopMediaPickerDialogView::DesktopMediaPickerDialogView( |
// DesktopMediaList needs to know the ID of the picker window which |
// matches the ID it gets from the OS. Depending on the OS and configuration |
// we get this ID differently. |
- // |
- // TODO(sergeyu): Update this code when Ash-specific window capturer is |
- // implemented. Currently this code will always get native windows ID |
- // which is not what we need in Ash. http://crbug.com/295102 |
- content::DesktopMediaID::Id dialog_window_id; |
+ content::DesktopMediaID::Id dialog_window_id = 0; |
#if defined(OS_WIN) |
dialog_window_id = reinterpret_cast<content::DesktopMediaID::Id>( |
views::HWNDForWidget(GetWidget())); |
#elif defined(USE_AURA) |
- dialog_window_id = static_cast<content::DesktopMediaID::Id>( |
- GetWidget()->GetNativeWindow()->GetDispatcher()->host()-> |
- GetAcceleratedWidget()); |
-#else |
+ |
+#if defined(USE_ASH) |
+ if (ash::Shell::HasInstance()) { |
Ben Goodger (Google)
2013/12/19 04:01:07
instead of doing this, you probably should instead
Sergey Ulanov
2013/12/20 01:43:08
Done.
|
+ dialog_window_id = content::DesktopMediaID::RegisterAuraWindow( |
+ GetWidget()->GetNativeWindow()).id; |
+ } else |
+#endif |
+ { |
+ dialog_window_id = static_cast<content::DesktopMediaID::Id>( |
+ GetWidget()->GetNativeWindow()->GetDispatcher()->host()-> |
+ GetAcceleratedWidget()); |
+ } |
+ |
+#else // defined(USE_AURA) |
dialog_window_id = 0; |
NOTIMPLEMENTED(); |
-#endif |
+#endif // !defined(USE_AURA) |
list_view_->StartUpdating(dialog_window_id); |