Index: ui/gfx/screen_win.cc |
diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc |
index 4530642e24bcd7450f0eae014091b9c4b772d192..7dff9e90d8c686a899b75dfc1df303eb4f85d53b 100644 |
--- a/ui/gfx/screen_win.cc |
+++ b/ui/gfx/screen_win.cc |
@@ -31,6 +31,32 @@ gfx::Display GetDisplay(MONITORINFOEX& monitor_info) { |
gfx::Display display(id, bounds); |
display.set_work_area(gfx::Rect(monitor_info.rcWork)); |
display.SetScaleAndBounds(gfx::win::GetDeviceScaleFactor(), bounds); |
+ |
+ DEVMODE mode; |
+ memset(&mode, 0, sizeof(DEVMODE)); |
+ mode.dmSize = sizeof(DEVMODE); |
+ mode.dmDriverExtra = 0; |
+ if (EnumDisplaySettings(monitor_info.szDevice, |
+ ENUM_CURRENT_SETTINGS, |
+ &mode)) { |
+ switch (mode.dmDisplayOrientation) { |
+ case DMDO_DEFAULT: |
+ display.set_rotation(gfx::Display::ROTATE_0); |
+ break; |
+ case DMDO_90: |
+ display.set_rotation(gfx::Display::ROTATE_90); |
+ break; |
+ case DMDO_180: |
+ display.set_rotation(gfx::Display::ROTATE_180); |
+ break; |
+ case DMDO_270: |
+ display.set_rotation(gfx::Display::ROTATE_270); |
+ break; |
+ default: |
+ NOTREACHED(); |
+ } |
+ } |
+ |
return display; |
} |