OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/gtk_window_utils.h" | 5 #include "content/browser/renderer_host/gtk_window_utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include <gdk/gdkx.h> | 9 #include <gdk/gdkx.h> |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // TODO(tony): We should move this code into WebScreenInfoFactory. | 56 // TODO(tony): We should move this code into WebScreenInfoFactory. |
57 int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window); | 57 int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window); |
58 GdkRectangle monitor_rect; | 58 GdkRectangle monitor_rect; |
59 gdk_screen_get_monitor_geometry(screen, monitor_number, &monitor_rect); | 59 gdk_screen_get_monitor_geometry(screen, monitor_number, &monitor_rect); |
60 results->rect = WebKit::WebRect(monitor_rect.x, monitor_rect.y, | 60 results->rect = WebKit::WebRect(monitor_rect.x, monitor_rect.y, |
61 monitor_rect.width, monitor_rect.height); | 61 monitor_rect.width, monitor_rect.height); |
62 | 62 |
63 gfx::Rect available_rect = results->rect; | 63 gfx::Rect available_rect = results->rect; |
64 gfx::Rect work_area = GetWorkArea(GDK_WINDOW_XID(gdk_window)); | 64 gfx::Rect work_area = GetWorkArea(GDK_WINDOW_XID(gdk_window)); |
65 if (!work_area.IsEmpty()) | 65 if (!work_area.IsEmpty()) |
66 available_rect = available_rect.Intersect(work_area); | 66 available_rect.Intersect(work_area); |
67 results->availableRect = available_rect; | 67 results->availableRect = available_rect; |
68 } | 68 } |
69 | 69 |
70 } // namespace content | 70 } // namespace content |
OLD | NEW |