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

Unified Diff: ui/gfx/win/display_info.h

Issue 1426933002: Refactor Windows DPI Point, Rect, and Size for Multiple Monitor DPI Awareness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Other Unit Tests - Moved Inner Classes Outside Created 4 years, 11 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/gfx/win/display_info.h
diff --git a/ui/gfx/win/display_info.h b/ui/gfx/win/display_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..beedf74a80340895d78cb1f4c562f70a6c561e2b
--- /dev/null
+++ b/ui/gfx/win/display_info.h
@@ -0,0 +1,46 @@
+// Copyright 2016 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.
+
+#ifndef UI_GFX_WIN_DISPLAY_INFO_H_
+#define UI_GFX_WIN_DISPLAY_INFO_H_
+
+#include <windows.h>
+#include <stdint.h>
+
+#include "ui/gfx/display.h"
+#include "ui/gfx/gfx_export.h"
+
+namespace gfx {
+namespace win {
+
+// Holds the parameters necessary to create a gfx::win::ScreenWinDisplay
+class GFX_EXPORT DisplayInfo {
+ public:
+ static int64_t HashDeviceName(const wchar_t* device_name);
+
+ DisplayInfo(HMONITOR monitor, float device_scale_factor);
+ DisplayInfo(const MONITORINFOEX& monitor_info,
+ gfx::Display::Rotation rotation,
+ float device_scale_factor);
+
+ int64_t id() const;
+ gfx::Display::Rotation rotation() const;
+ const gfx::Rect& screen_rect() const;
+ const gfx::Rect& screen_work_rect() const;
+ float device_scale_factor() const;
+
+ private:
+ void InitializeFromMonitorInfo(const MONITORINFOEX& monitor_info);
+
+ int64_t id_;
+ gfx::Display::Rotation rotation_;
+ gfx::Rect screen_rect_;
+ gfx::Rect screen_work_rect_;
+ float device_scale_factor_;
+};
+
+} // namespace win
+} // namespace gfx
+
+#endif // UI_GFX_WIN_DISPLAY_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698