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

Unified Diff: ui/display/chromeos/display_snapshot_virtual.cc

Issue 1456623002: Add support for virtual displays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test (removing need for friend on DisplayConfigurator) Created 5 years, 1 month 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: ui/display/chromeos/display_snapshot_virtual.cc
diff --git a/ui/display/chromeos/display_snapshot_virtual.cc b/ui/display/chromeos/display_snapshot_virtual.cc
new file mode 100644
index 0000000000000000000000000000000000000000..77d40707be45756b59239f7e97ca942d0b2fbc2a
--- /dev/null
+++ b/ui/display/chromeos/display_snapshot_virtual.cc
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/display/chromeos/display_snapshot_virtual.h"
+
+#include <inttypes.h>
+
+#include "base/strings/stringprintf.h"
+#include "ui/display/types/display_mode.h"
+
+namespace ui {
+DisplaySnapshotVirtual::DisplaySnapshotVirtual(int64_t display_id,
+ gfx::Size display_size)
+ : DisplaySnapshot(display_id,
+ gfx::Point(0, 0),
+ // TODO(robert.bradford): Use better physical dimensions.
+ gfx::Size(200, 200),
oshima 2015/11/24 22:19:27 why not display_size ?
robert.bradford 2015/11/26 16:29:40 This parameter is for the physical size. I've repl
oshima 2015/12/02 20:34:27 I think this will be used to compute the DPI thres
robert.bradford 2015/12/03 18:44:57 Or, as i've just posted, calculate the physical di
oshima 2015/12/03 18:54:07 sgtm
+ DISPLAY_CONNECTION_TYPE_VIRTUAL,
+ false,
+ false,
+ "Virtual display",
+ std::vector<const DisplayMode*>(),
+ NULL,
+ NULL) {
+ mode_.reset(new DisplayMode(display_size, false, 30));
+ modes_.push_back(mode_.get());
+
+ native_mode_ = modes_.front();
+}
+
+DisplaySnapshotVirtual::~DisplaySnapshotVirtual() {}
+
+std::string DisplaySnapshotVirtual::ToString() const {
+ return base::StringPrintf(
+ "Virtual id=%" PRId64 " current_mode=%s physical_size=%s", display_id_,
+ current_mode_ ? current_mode_->ToString().c_str() : "NULL",
+ physical_size_.ToString().c_str());
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698