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 560fad1df8ee9764b22455405b651b118395df7d..07aa7f55b23101360c1783edc1f516afee751a45 100644 |
--- a/chrome/browser/ui/views/desktop_media_picker_views.cc |
+++ b/chrome/browser/ui/views/desktop_media_picker_views.cc |
@@ -479,23 +479,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()) { |
+ 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); |