From 47b7eb37e00744c8d220dd5a45203cdc3172c236 Mon Sep 17 00:00:00 2001 From: "sky@google.com" Date: Wed, 10 Dec 2008 18:14:04 +0000 Subject: Fixes regression in info bubble that caused crash on clicking star on history page. BUG=4397 TEST=go to history page, click on a star and make sure star bubble pops up. Review URL: http://codereview.chromium.org/13349 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6717 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/info_bubble.cc | 20 ++++++-------------- chrome/browser/views/info_bubble.h | 4 ---- 2 files changed, 6 insertions(+), 18 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc index 56e1e48..c896f33 100644 --- a/chrome/browser/views/info_bubble.cc +++ b/chrome/browser/views/info_bubble.cc @@ -86,8 +86,13 @@ InfoBubble::~InfoBubble() { void InfoBubble::Init(HWND parent_hwnd, const gfx::Rect& position_relative_to, views::View* content) { + HWND owning_frame_hwnd = GetAncestor(parent_hwnd, GA_ROOTOWNER); + // We should always have a frame, but there was a bug elsewhere that + // made it possible for the frame to be NULL, so we have the check. If + // you hit this, file a bug. + DCHECK(BrowserView::GetBrowserWindowForHWND(owning_frame_hwnd)); parent_ = reinterpret_cast(win_util::GetWindowUserData( - parent_hwnd)); + owning_frame_hwnd)); parent_->DisableInactiveRendering(true); if (kInfoBubbleCornerTopLeft == NULL) { @@ -187,19 +192,6 @@ InfoBubble::ContentView* InfoBubble::CreateContentView(View* content) { return new ContentView(content, this); } -BrowserWindow* InfoBubble::GetHostingWindow() { - HWND owning_frame_hwnd = GetAncestor(GetHWND(), GA_ROOTOWNER); - BrowserWindow* frame = - BrowserView::GetBrowserWindowForHWND(owning_frame_hwnd); - if (!frame) { - // We should always have a frame, but there was a bug else where that - // made it possible for the frame to be NULL, so we have the check. If - // you hit this, file a bug. - NOTREACHED(); - } - return frame; -} - // ContentView ---------------------------------------------------------------- InfoBubble::ContentView::ContentView(views::View* content, InfoBubble* host) diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h index 08a0667..21a4e2d 100644 --- a/chrome/browser/views/info_bubble.h +++ b/chrome/browser/views/info_bubble.h @@ -18,7 +18,6 @@ // (or rather ContentView) insets the content view for you, so that the // content typically shouldn't have any additional margins around the view. -class BrowserWindow; class InfoBubble; namespace views { class Window; @@ -148,9 +147,6 @@ class InfoBubble : public views::WidgetWin, // Creates and return a new ContentView containing content. virtual ContentView* CreateContentView(views::View* content); - // Returns the BrowserWindow that owns this InfoBubble. - BrowserWindow* GetHostingWindow(); - private: // The delegate notified when the InfoBubble is closed. InfoBubbleDelegate* delegate_; -- cgit v1.1