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

Unified Diff: ui/gfx/screen_win.cc

Issue 1563183008: Added capability on Windows to get the physical dimensions of your attached monitors. Also added th… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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/screen_win.cc
diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc
index 3199f7acaacdd2b15c3dca37d09014dc418c2d00..65ef2cd0a7f4dcfb356259bdc04d2ff4a0f4d3f6 100644
--- a/ui/gfx/screen_win.cc
+++ b/ui/gfx/screen_win.cc
@@ -5,7 +5,6 @@
#include "ui/gfx/screen_win.h"
#include <windows.h>
-#include <stdint.h>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -27,8 +26,7 @@ MONITORINFOEX GetMonitorInfoForMonitor(HMONITOR monitor) {
}
gfx::Display GetDisplay(const MONITORINFOEX& monitor_info) {
- int64_t id =
- static_cast<int64_t>(base::Hash(base::WideToUTF8(monitor_info.szDevice)));
+ int64_t id = gfx::ScreenWin::GenerateDisplayId(monitor_info.szDevice);
gfx::Rect bounds = gfx::Rect(monitor_info.rcMonitor);
gfx::Display display(id);
display.set_bounds(gfx::win::ScreenToDIPRect(bounds));
@@ -107,6 +105,11 @@ NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const {
return NULL;
}
+// static
+int64_t ScreenWin::GenerateDisplayId(const std::wstring& str) {
+ return static_cast<int64_t>(base::Hash(base::WideToUTF8(str)));
+}
+
gfx::Point ScreenWin::GetCursorScreenPoint() {
POINT pt;
GetCursorPos(&pt);

Powered by Google App Engine
This is Rietveld 408576698