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

Side by Side 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, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/renderer_host/gtk_window_utils.h"
6
7 #include <gdk/gdkx.h>
8 #include <gtk/gtk.h>
9
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/x11/WebScreenInfoFact ory.h"
12
13 namespace content {
14
15 void GetScreenInfoFromNativeWindow(
16 GdkWindow* gdk_window, WebKit::WebScreenInfo* results) {
17 GdkScreen* screen = gdk_drawable_get_screen(gdk_window);
18 *results = WebKit::WebScreenInfoFactory::screenInfo(
19 gdk_x11_drawable_get_xdisplay(gdk_window),
20 gdk_x11_screen_get_screen_number(screen));
21
22 // TODO(tony): We should move this code into WebScreenInfoFactory.
23 int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window);
24 GdkRectangle monitor_rect;
25 gdk_screen_get_monitor_geometry(screen, monitor_number, &monitor_rect);
26 results->rect = WebKit::WebRect(monitor_rect.x, monitor_rect.y,
27 monitor_rect.width, monitor_rect.height);
28 // TODO(tony): Should we query _NET_WORKAREA to get the workarea?
29 results->availableRect = results->rect;
30 }
31
32 } // namespace content
OLDNEW
« 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