OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/render_widget_host.h" | 5 #include "content/browser/renderer_host/render_widget_host.h" |
6 | 6 |
7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // http://crbug.com/9060 for more details. | 21 // http://crbug.com/9060 for more details. |
22 void RenderWidgetHost::OnMsgGetScreenInfo(gfx::NativeViewId view, | 22 void RenderWidgetHost::OnMsgGetScreenInfo(gfx::NativeViewId view, |
23 WebScreenInfo* results) { | 23 WebScreenInfo* results) { |
24 GtkWidget* widget = NULL; | 24 GtkWidget* widget = NULL; |
25 GdkWindow* gdk_window = NULL; | 25 GdkWindow* gdk_window = NULL; |
26 if (GtkNativeViewManager::GetInstance()->GetNativeViewForId( | 26 if (GtkNativeViewManager::GetInstance()->GetNativeViewForId( |
27 &widget, view) && widget) { | 27 &widget, view) && widget) { |
28 gdk_window = widget->window; | 28 gdk_window = widget->window; |
29 } else { | 29 } else { |
30 GdkDisplay* display = gdk_display_get_default(); | 30 GdkDisplay* display = gdk_display_get_default(); |
31 gdk_window = gdk_display_get_window_at_pointer(display, NULL, NULL); | 31 gdk_window = gdk_display_get_default_group(display); |
32 } | 32 } |
33 if (!gdk_window) | 33 if (!gdk_window) |
34 return; | 34 return; |
35 GdkScreen* screen = gdk_drawable_get_screen(gdk_window); | 35 GdkScreen* screen = gdk_drawable_get_screen(gdk_window); |
36 *results = WebScreenInfoFactory::screenInfo( | 36 *results = WebScreenInfoFactory::screenInfo( |
37 gdk_x11_drawable_get_xdisplay(gdk_window), | 37 gdk_x11_drawable_get_xdisplay(gdk_window), |
38 gdk_x11_screen_get_screen_number(screen)); | 38 gdk_x11_screen_get_screen_number(screen)); |
39 | 39 |
40 // TODO(tony): We should move this code into WebScreenInfoFactory. | 40 // TODO(tony): We should move this code into WebScreenInfoFactory. |
41 int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window); | 41 int monitor_number = gdk_screen_get_monitor_at_window(screen, gdk_window); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 for (int i = 0; | 110 for (int i = 0; |
111 i < static_cast<int>(deferred_plugin_handles_.size()); | 111 i < static_cast<int>(deferred_plugin_handles_.size()); |
112 i++) { | 112 i++) { |
113 if (deferred_plugin_handles_[i] == id) { | 113 if (deferred_plugin_handles_[i] == id) { |
114 deferred_plugin_handles_.erase(deferred_plugin_handles_.begin() + i); | 114 deferred_plugin_handles_.erase(deferred_plugin_handles_.begin() + i); |
115 i--; | 115 i--; |
116 } | 116 } |
117 } | 117 } |
118 } | 118 } |
119 } | 119 } |
OLD | NEW |