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

Unified Diff: content/browser/renderer_host/gtk_window_utils.cc

Issue 7753013: content: Make ifdefs match with where this is used (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Factor out common code Created 9 years, 4 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: content/browser/renderer_host/gtk_window_utils.cc
diff --git a/content/browser/renderer_host/gtk_window_utils.cc b/content/browser/renderer_host/gtk_window_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a574941b8f36858f6fb9f6d4a484358cbcf652c7
--- /dev/null
+++ b/content/browser/renderer_host/gtk_window_utils.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2011 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 "content/browser/renderer_host/gtk_window_utils.h"
+
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/x11/WebScreenInfoFactory.h"
+
+namespace content {
+
+void GetScreenInfoFromNativeWindow(
+ GdkWindow* gdk_window, WebKit::WebScreenInfo* results) {
+ GdkScreen* screen = gdk_drawable_get_screen(gdk_window);
+ *results = WebKit::WebScreenInfoFactory::screenInfo(
+ gdk_x11_drawable_get_xdisplay(gdk_window),
+ gdk_x11_screen_get_screen_number(screen));
+
+ // TODO(tony): We should move this code into WebScreenInfoFactory.
+ int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window);
+ GdkRectangle monitor_rect;
+ gdk_screen_get_monitor_geometry(screen, monitor_number, &monitor_rect);
+ results->rect = WebKit::WebRect(monitor_rect.x, monitor_rect.y,
+ monitor_rect.width, monitor_rect.height);
+ // TODO(tony): Should we query _NET_WORKAREA to get the workarea?
+ results->availableRect = results->rect;
+}
+
+} // namespace content
« no previous file with comments | « content/browser/renderer_host/gtk_window_utils.h ('k') | content/browser/renderer_host/render_widget_host_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698