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

Unified Diff: chrome/browser/media/desktop_media_list_ash.cc

Issue 615133002: Add support for a virtual display on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix remaining comment periods (thanks achuithb@) Created 5 years, 10 months 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/media/desktop_media_list_ash.cc
diff --git a/chrome/browser/media/desktop_media_list_ash.cc b/chrome/browser/media/desktop_media_list_ash.cc
index d24ec21b2b1c493942bb5472bfe57dacb2610b98..f25af0b47a500983572485888883f705d63a3f87 100644
--- a/chrome/browser/media/desktop_media_list_ash.cc
+++ b/chrome/browser/media/desktop_media_list_ash.cc
@@ -11,6 +11,7 @@
#include "base/hash.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/sys_info.h"
#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/media/desktop_media_list_observer.h"
#include "chrome/grit/generated_resources.h"
@@ -18,6 +19,7 @@
#include "media/base/video_util.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/compositor/dip_util.h"
+#include "ui/display/chromeos/display_configurator.h"
#include "ui/gfx/image/image.h"
#include "ui/snapshot/snapshot.h"
@@ -209,6 +211,24 @@ void DesktopMediaListAsh::EnumerateSources(
sources, root_windows[i], ash::kShellWindowId_DockedContainer);
}
}
+#if defined(OS_CHROMEOS)
+ // DisplayConfigurator only works when running on ChromeOS.
+ if (base::SysInfo::IsRunningOnChromeOS()) {
+ ui::DisplayConfigurator* configurator =
+ ash::Shell::GetInstance()->display_configurator();
+ if (configurator->GetVirtualDisplayId() ==
+ gfx::Display::kInvalidDisplayID) {
+ SourceDescription virtual_screen_source(
+ content::DesktopMediaID(
+ content::DesktopMediaID::TYPE_AURA_VIRTUAL_SCREEN, 0),
+ l10n_util::GetStringUTF16(
+ IDS_DESTOP_MEDIA_PICKER_VIRTUAL_SCREEN_NAME));
+ sources->push_back(virtual_screen_source);
+ // TODO(robert.bradford): crbug.com/425060 There is no thumbnail for the
+ // virtual screen right now.
+ }
+ }
+#endif
}
void DesktopMediaListAsh::CaptureThumbnail(content::DesktopMediaID id,

Powered by Google App Engine
This is Rietveld 408576698