summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webkit_glue_win.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 22:28:40 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 22:28:40 +0000
commit5299356524f2e169ec97db351c44fe6da701984e (patch)
tree6aeb51a22c6d3c101fce0f17ea1e65a659232507 /webkit/glue/webkit_glue_win.cc
parent9c8108d9356604eec57bf3c880f1580eb41fd1c3 (diff)
downloadchromium_src-5299356524f2e169ec97db351c44fe6da701984e.zip
chromium_src-5299356524f2e169ec97db351c44fe6da701984e.tar.gz
chromium_src-5299356524f2e169ec97db351c44fe6da701984e.tar.bz2
Takes steps to make our PlatformScreen implementation more portable.
Introduces ChromiumBridge as a means for our WebCore port to depend on the embedder indirectly. This will be extended to support the rest of our port. WebWidgetImpl and ChromeClientImpl both needed to have their platformWindow getter implemented. This fixes a regression related to the most recent merge. Removes the orphaned Language.cpp (see the real one in the platform/chromium directory. Changed webkit_glue::GetMonitorInfoForWindow to webkit_glue::GetScreenInfo. This resulted in a varied amount of plumbing changes. It also pushes the platform specific bits up into the browser where they belong. ScreenInfo is a struct that is part of the webkit/glue API. R=dglazkov,eseidel Review URL: http://codereview.chromium.org/8761 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkit_glue_win.cc')
-rw-r--r--webkit/glue/webkit_glue_win.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/webkit/glue/webkit_glue_win.cc b/webkit/glue/webkit_glue_win.cc
new file mode 100644
index 0000000..107a569
--- /dev/null
+++ b/webkit/glue/webkit_glue_win.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2008 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 "webkit/glue/webkit_glue.h"
+
+namespace webkit_glue {
+
+ScreenInfo GetScreenInfoHelper(gfx::ViewHandle window) {
+ HMONITOR monitor = MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY);
+
+ MONITORINFOEX monitor_info;
+ monitor_info.cbSize = sizeof(MONITORINFOEX);
+ GetMonitorInfo(monitor, &monitor_info);
+
+ DEVMODE dev_mode;
+ dev_mode.dmSize = sizeof(dev_mode);
+ dev_mode.dmDriverExtra = 0;
+ EnumDisplaySettings(monitor_info.szDevice, ENUM_CURRENT_SETTINGS, &dev_mode);
+
+ ScreenInfo results;
+ results.depth = dev_mode.dmBitsPerPel;
+ results.depth_per_component = dev_mode.dmBitsPerPel / 3; // Assumes RGB
+ results.is_monochrome = dev_mode.dmColor == DMCOLOR_MONOCHROME;
+ results.rect = gfx::Rect(monitor_info.rcMonitor);
+ results.available_rect = gfx::Rect(monitor_info.rcWork);
+ return results;
+}
+
+} // namespace webkit_glue