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

Unified Diff: chrome/common/gtk_util.cc

Issue 326017: GTK: Compute infobubble rects correctly. (Closed)
Patch Set: Created 11 years, 2 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
« no previous file with comments | « chrome/common/gtk_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/gtk_util.cc
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc
index 842b99ab19e8c02487a6d8675b0985d05ffe4793..fac62f491297cacc8dcf42a2195984ec37cb786b 100644
--- a/chrome/common/gtk_util.cc
+++ b/chrome/common/gtk_util.cc
@@ -568,4 +568,13 @@ void StackPopupWindow(GtkWidget* popup, GtkWidget* toplevel) {
}
}
+gfx::Rect GetWidgetRectRelativeToToplevel(GtkWidget* widget) {
+ gint x = 0, y = 0;
+ DCHECK(gtk_widget_translate_coordinates(widget,
+ gtk_widget_get_toplevel(widget),
+ 0, 0,
+ &x, &y));
+ return gfx::Rect(x, y, widget->allocation.width, widget->allocation.height);
+}
+
} // namespace gtk_util
« no previous file with comments | « chrome/common/gtk_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698