diff options
-rw-r--r-- | chrome/browser/views/info_bubble.cc | 20 | ||||
-rw-r--r-- | chrome/browser/views/info_bubble.h | 4 |
2 files changed, 6 insertions, 18 deletions
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<views::Window*>(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_; |