summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 18:14:04 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 18:14:04 +0000
commit47b7eb37e00744c8d220dd5a45203cdc3172c236 (patch)
treec9e912cb08ed605bd221950fae7f370afe158d3a /chrome/browser/views
parentbe2cfb00981df5041557753d7724685f9b08cbaa (diff)
downloadchromium_src-47b7eb37e00744c8d220dd5a45203cdc3172c236.zip
chromium_src-47b7eb37e00744c8d220dd5a45203cdc3172c236.tar.gz
chromium_src-47b7eb37e00744c8d220dd5a45203cdc3172c236.tar.bz2
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
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/info_bubble.cc20
-rw-r--r--chrome/browser/views/info_bubble.h4
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_;