diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-11 23:53:03 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-11 23:53:03 +0000 |
commit | 97e994985302a708c144e6d05d1b8637f92034c1 (patch) | |
tree | 0d180d8a8bd1dfd09616be1d502056dbfd5bea78 /views | |
parent | 7d23c6e9857e315005431430e24a5c34a69b857e (diff) | |
download | chromium_src-97e994985302a708c144e6d05d1b8637f92034c1.zip chromium_src-97e994985302a708c144e6d05d1b8637f92034c1.tar.gz chromium_src-97e994985302a708c144e6d05d1b8637f92034c1.tar.bz2 |
Makes WidgetGtk::GetBounds work if the widget_ is NULL (CloseNow has
been invoked). We need to allow this so that GetBounds works if
CloseNow is invoked but the destructor hasn't yet run.
BUG=31975
TEST=see bug
Review URL: http://codereview.chromium.org/536018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35971 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/widget_gtk.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 303fe36..ecb131c 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -384,7 +384,11 @@ void WidgetGtk::SetContentsView(View* view) { } void WidgetGtk::GetBounds(gfx::Rect* out, bool including_frame) const { - DCHECK(widget_); + if (!widget_) { + // Due to timing we can get a request for the bounds after Close. + *out = gfx::Rect(gfx::Point(0, 0), size_); + return; + } int x = 0, y = 0, w, h; if (GTK_IS_WINDOW(widget_)) { |