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

Unified Diff: services/ui/display/platform_screen_impl_ozone.cc

Issue 2190633002: Add flag to launch two displays for mus+ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix. Created 4 years, 5 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
« no previous file with comments | « no previous file | services/ui/ws/display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/display/platform_screen_impl_ozone.cc
diff --git a/services/ui/display/platform_screen_impl_ozone.cc b/services/ui/display/platform_screen_impl_ozone.cc
index 89138f637a7a620c0da27bb7d8353b647b178117..f96f07049a1204536fb282e208204d017786232a 100644
--- a/services/ui/display/platform_screen_impl_ozone.cc
+++ b/services/ui/display/platform_screen_impl_ozone.cc
@@ -4,6 +4,7 @@
#include "services/ui/display/platform_screen_impl_ozone.h"
+#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/sys_info.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -28,7 +29,13 @@ namespace {
// ConfigurePhysicalDisplay() with a hard-coded |id| and |bounds|.
void FixedSizeScreenConfiguration(
const PlatformScreen::ConfiguredDisplayCallback& callback) {
- callback.Run(1, gfx::Rect(1024, 768));
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("multi-display")) {
+ // This really doesn't work properly. Use at your own risk.
+ callback.Run(100, gfx::Rect(800, 800));
+ callback.Run(200, gfx::Rect(800, 0, 800, 800));
+ } else {
+ callback.Run(100, gfx::Rect(0, 0, 1024, 768));
+ }
}
// Needed for DisplayConfigurator::ForceInitialConfigure.
@@ -67,10 +74,14 @@ void PlatformScreenImplOzone::ConfigurePhysicalDisplay(
void PlatformScreenImplOzone::OnDisplayModeChanged(
const ui::DisplayConfigurator::DisplayStateList& displays) {
- // TODO(kylechar): Remove checks when multiple display support is added.
- CHECK(displays.size() == 1) << "Mus only supports one 1 display";
+ // TODO(kylechar): Remove check when adding/removing displays is supported.
CHECK(!callback_.is_null());
+ if (displays.size() > 1) {
+ LOG(ERROR)
+ << "Mus doesn't really support multiple displays, expect it to crash";
+ }
+
gfx::Point origin;
for (auto* display : displays) {
const ui::DisplayMode* current_mode = display->current_mode();
« no previous file with comments | « no previous file | services/ui/ws/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698