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_view_gtk.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_gtk.h" |
6 | 6 |
7 // If this gets included after the gtk headers, then a bunch of compiler | 7 // If this gets included after the gtk headers, then a bunch of compiler |
8 // errors happen because of a "#define Status int" in Xlib.h, which interacts | 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts |
9 // badly with net::URLRequestStatus::Status. | 9 // badly with net::URLRequestStatus::Status. |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 gfx::Point RenderWidgetHostViewGtk::GetWidgetCenter() { | 1376 gfx::Point RenderWidgetHostViewGtk::GetWidgetCenter() { |
1377 if (widget_center_valid_) | 1377 if (widget_center_valid_) |
1378 return widget_center_; | 1378 return widget_center_; |
1379 | 1379 |
1380 GdkWindow* window = gtk_widget_get_window(view_.get()); | 1380 GdkWindow* window = gtk_widget_get_window(view_.get()); |
1381 gint window_x = 0; | 1381 gint window_x = 0; |
1382 gint window_y = 0; | 1382 gint window_y = 0; |
1383 gdk_window_get_origin(window, &window_x, &window_y); | 1383 gdk_window_get_origin(window, &window_x, &window_y); |
1384 gint window_w = 0; | 1384 gint window_w = 0; |
1385 gint window_h = 0; | 1385 gint window_h = 0; |
1386 gdk_drawable_get_size(window, &window_w, &window_h); | 1386 gdk_window_get_size(window, &window_w, &window_h); |
1387 | 1387 |
1388 widget_center_.SetPoint(window_x + window_w / 2, | 1388 widget_center_.SetPoint(window_x + window_w / 2, |
1389 window_y + window_h / 2); | 1389 window_y + window_h / 2); |
1390 widget_center_valid_ = true; | 1390 widget_center_valid_ = true; |
1391 return widget_center_; | 1391 return widget_center_; |
1392 } | 1392 } |
1393 | 1393 |
1394 void RenderWidgetHostViewGtk::ModifyEventMovementAndCoords( | 1394 void RenderWidgetHostViewGtk::ModifyEventMovementAndCoords( |
1395 WebKit::WebMouseEvent* event) { | 1395 WebKit::WebMouseEvent* event) { |
1396 // Movement is computed by taking the difference of the new cursor position | 1396 // Movement is computed by taking the difference of the new cursor position |
(...skipping 22 matching lines...) Expand all Loading... |
1419 } | 1419 } |
1420 } | 1420 } |
1421 | 1421 |
1422 // static | 1422 // static |
1423 void RenderWidgetHostView::GetDefaultScreenInfo( | 1423 void RenderWidgetHostView::GetDefaultScreenInfo( |
1424 WebKit::WebScreenInfo* results) { | 1424 WebKit::WebScreenInfo* results) { |
1425 GdkWindow* gdk_window = | 1425 GdkWindow* gdk_window = |
1426 gdk_display_get_default_group(gdk_display_get_default()); | 1426 gdk_display_get_default_group(gdk_display_get_default()); |
1427 content::GetScreenInfoFromNativeWindow(gdk_window, results); | 1427 content::GetScreenInfoFromNativeWindow(gdk_window, results); |
1428 } | 1428 } |
OLD | NEW |