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

Unified Diff: chrome/browser/renderer_host/resource_message_filter_gtk.cc

Issue 42336: Adds Get(Root)WindowRect handlers for the Mac.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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: chrome/browser/renderer_host/resource_message_filter_gtk.cc
===================================================================
--- chrome/browser/renderer_host/resource_message_filter_gtk.cc (revision 0)
+++ chrome/browser/renderer_host/resource_message_filter_gtk.cc (revision 0)
@@ -0,0 +1,34 @@
+// Copyright (c) 2006-2009 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 "chrome/browser/renderer_host/resource_message_filter.h"
+
+#include <gtk/gtk.h>
+
+void ResourceMessageFilter::OnGetWindowRect(gfx::NativeViewId window_id,
+ gfx::Rect* rect) {
+ // Ideally this would be gtk_widget_get_window but that's only
+ // from gtk 2.14 onwards. :(
+ GdkWindow* window = gfx::NativeViewFromId(window_id)->window;
+ DCHECK(window);
+ gint x, y, width, height;
+ // This is the "position of a window in root window coordinates".
+ gdk_window_get_origin(window, &x, &y);
+ gdk_window_get_size(window, &width, &height);
+ *rect = gfx::Rect(x, y, width, height);
+}
+
+void ResourceMessageFilter::OnGetRootWindowRect(gfx::NativeViewId window_id,
+ gfx::Rect* rect) {
+ // Windows uses GetAncestor(window, GA_ROOT) here which probably means
+ // we want the top level window.
+ GdkWindow* window =
+ gdk_window_get_toplevel(gfx::NativeViewFromId(window_id)->window);
+ DCHECK(window);
+ gint x, y, width, height;
+ // This is the "position of a window in root window coordinates".
+ gdk_window_get_origin(window, &x, &y);
+ gdk_window_get_size(window, &width, &height);
+ *rect = gfx::Rect(x, y, width, height);
+}
Property changes on: chrome/browser/renderer_host/resource_message_filter_gtk.cc
___________________________________________________________________
Name: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.cc ('k') | chrome/browser/renderer_host/resource_message_filter_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698