summaryrefslogtreecommitdiffstats
path: root/chrome/common/gtk_util.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 20:36:06 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 20:36:06 +0000
commit0a963192af67150d29a5749d52b1fcf279efb7f3 (patch)
treee15e92771cf268dd4e754ee4804b4c8978def97d /chrome/common/gtk_util.cc
parente133f95e6e64a5d9bf8bf0d1a435958efbe94cce (diff)
downloadchromium_src-0a963192af67150d29a5749d52b1fcf279efb7f3.zip
chromium_src-0a963192af67150d29a5749d52b1fcf279efb7f3.tar.gz
chromium_src-0a963192af67150d29a5749d52b1fcf279efb7f3.tar.bz2
Adds gtk_util::ParentWindow to find the parent window of a GtkWidget.
BUG=none TEST=none Review URL: http://codereview.chromium.org/113919 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17019 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gtk_util.cc')
-rw-r--r--chrome/common/gtk_util.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc
index 01d952e..1deb58f 100644
--- a/chrome/common/gtk_util.cc
+++ b/chrome/common/gtk_util.cc
@@ -122,4 +122,13 @@ void InitRCStyles() {
gtk_rc_parse_string(kRCText);
}
+GtkWindow* ParentWindow(GtkWidget* widget) {
+ while (widget) {
+ if (GTK_IS_WINDOW(widget))
+ return GTK_WINDOW(widget);
+ widget = gtk_widget_get_parent(widget);
+ }
+ return NULL;
+}
+
} // namespace gtk_util