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

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

Issue 100833002: Add AshDesktopMediaList and enable Desktop Capture API on Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 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);

Powered by Google App Engine
This is Rietveld 408576698