diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-11 19:33:32 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-11 19:33:32 +0000 |
commit | 316848c3ab8b40e54118c5c5700df5e25119dc3b (patch) | |
tree | 38f281b972530c326283dd08d60f2da28c583544 /chrome/browser/views | |
parent | d7af8e7d98ab79ad46707b08b6dd7f6ef272cbbe (diff) | |
download | chromium_src-316848c3ab8b40e54118c5c5700df5e25119dc3b.zip chromium_src-316848c3ab8b40e54118c5c5700df5e25119dc3b.tar.gz chromium_src-316848c3ab8b40e54118c5c5700df5e25119dc3b.tar.bz2 |
Fix a crash when dismissing an infobubble... could not locate Window*
Review URL: http://codereview.chromium.org/10405
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5196 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/info_bubble.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/info_bubble.h | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc index 00e5457..59ba380 100644 --- a/chrome/browser/views/info_bubble.cc +++ b/chrome/browser/views/info_bubble.cc @@ -72,10 +72,10 @@ InfoBubble* InfoBubble::Show(HWND parent_hwnd, InfoBubbleDelegate* delegate) { InfoBubble* window = new InfoBubble(); window->Init(parent_hwnd, position_relative_to, content); - views::Window* parent_window = + window->parent_ = reinterpret_cast<views::Window*>(win_util::GetWindowUserData( parent_hwnd)); - parent_window->DisableInactiveRendering(true); + window->parent_->DisableInactiveRendering(true); window->ShowWindow(SW_SHOW); window->delegate_ = delegate; return window; @@ -144,10 +144,7 @@ void InfoBubble::Close() { // We don't fade out because it looks terrible. if (delegate_) delegate_->InfoBubbleClosing(this); - views::Window* parent_window = - reinterpret_cast<views::Window*>( - win_util::GetWindowUserData(GetAncestor(GetHWND(), GA_ROOT))); - parent_window->DisableInactiveRendering(false); + parent_->DisableInactiveRendering(false); ContainerWin::Close(); } diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h index 64c8ec3..cab1644 100644 --- a/chrome/browser/views/info_bubble.h +++ b/chrome/browser/views/info_bubble.h @@ -20,6 +20,9 @@ class BrowserWindow; class InfoBubble; +namespace views { +class Window; +} class InfoBubbleDelegate { public: @@ -152,6 +155,9 @@ class InfoBubble : public views::ContainerWin, // The delegate notified when the InfoBubble is closed. InfoBubbleDelegate* delegate_; + // The window that this InfoBubble is parented to. + views::Window* parent_; + // The content view contained by the infobubble. ContentView* content_view_; |