| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | |
| 2 // source code is governed by a BSD-style license that can be found in the | |
| 3 // LICENSE file. | |
| 4 | |
| 5 #include "webkit/glue/webkit_glue.h" | |
| 6 | |
| 7 #include "webkit/glue/screen_info.h" | |
| 8 | |
| 9 namespace webkit_glue { | |
| 10 | |
| 11 ScreenInfo GetScreenInfoHelper(gfx::NativeView window) { | |
| 12 HMONITOR monitor = MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY); | |
| 13 | |
| 14 MONITORINFOEX monitor_info; | |
| 15 monitor_info.cbSize = sizeof(MONITORINFOEX); | |
| 16 GetMonitorInfo(monitor, &monitor_info); | |
| 17 | |
| 18 DEVMODE dev_mode; | |
| 19 dev_mode.dmSize = sizeof(dev_mode); | |
| 20 dev_mode.dmDriverExtra = 0; | |
| 21 EnumDisplaySettings(monitor_info.szDevice, ENUM_CURRENT_SETTINGS, &dev_mode); | |
| 22 | |
| 23 ScreenInfo results; | |
| 24 results.depth = dev_mode.dmBitsPerPel; | |
| 25 results.depth_per_component = dev_mode.dmBitsPerPel / 3; // Assumes RGB | |
| 26 results.is_monochrome = dev_mode.dmColor == DMCOLOR_MONOCHROME; | |
| 27 results.rect = gfx::Rect(monitor_info.rcMonitor); | |
| 28 results.available_rect = gfx::Rect(monitor_info.rcWork); | |
| 29 return results; | |
| 30 } | |
| 31 | |
| 32 } // namespace webkit_glue | |
| OLD | NEW |