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

Unified Diff: ui/aura/monitor_aura.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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: ui/aura/monitor_aura.cc
diff --git a/ui/aura/monitor_aura.cc b/ui/aura/monitor_aura.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cceef4f5e0e6c288272722eb488fae3a73e28d9b
--- /dev/null
+++ b/ui/aura/monitor_aura.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2012 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/aura/monitor_aura.h"
+
+#include "ui/gfx/monitor.h"
+
+namespace aura {
+
+MonitorAura::MonitorAura() : device_scale_factor_(1.0f) {
+}
+
+MonitorAura::MonitorAura(const gfx::Rect& bounds)
+ : bounds_(bounds), device_scale_factor_(1.0f) {
+}
+
+MonitorAura::~MonitorAura() {
+}
+
+void MonitorAura::CopyTo(gfx::Monitor* monitor_out) const {
+ // TODO(oshima): For m19, the origin of work area/monitor bounds for
+ // views/aura is always (0,0) because it's simple and enough. Fix this when
+ // real multi monitor support is implemented.
+ gfx::Rect bounds(bounds_.size());
+ monitor_out->set_bounds(bounds);
+ bounds.Inset(work_area_insets_);
+ monitor_out->set_work_area(bounds);
+ monitor_out->set_device_scale_factor(device_scale_factor_);
+}
+
+} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698