diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-28 21:49:11 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-28 21:49:11 +0000 |
commit | 8907d0469ed010147265c95017102d1d976565f3 (patch) | |
tree | ebd07a3271022d5d0e21a8a185735c4221c36139 /chrome | |
parent | 928afbc588e8b48b9c7af579a63b11d904c80089 (diff) | |
download | chromium_src-8907d0469ed010147265c95017102d1d976565f3.zip chromium_src-8907d0469ed010147265c95017102d1d976565f3.tar.gz chromium_src-8907d0469ed010147265c95017102d1d976565f3.tar.bz2 |
Fix browser crash when closing popups (issue 3631).
The Google Bookmarks bookmarklet opens a popup window that allows you to bookmark a page. When the window closes we crash because we dereference a NULL TabContents pointer the we get from GetSelectedTabContents(). This fixes that.
Review URL: http://codereview.chromium.org/8185
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/frame/browser_view2.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index 0208185..cadf038 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -284,7 +284,7 @@ void BrowserView2::Init() { status_bubble_.reset(new StatusBubble(GetContainer())); -#ifdef CHROME_PERSONALIZATION +#ifdef CHROME_PERSONALIZATION EnablePersonalization(CommandLine().HasSwitch(switches::kEnableP13n)); if (IsPersonalizationEnabled()) { personalization_ = Personalization::CreateFramePersonalization( @@ -390,8 +390,10 @@ void BrowserView2::SetAcceleratorTable( } void BrowserView2::ValidateThrobber() { - if (ShouldShowWindowIcon()) - frame_->UpdateThrobber(browser_->GetSelectedTabContents()->is_loading()); + if (ShouldShowWindowIcon()) { + TabContents* tab_contents = browser_->GetSelectedTabContents(); + frame_->UpdateThrobber(tab_contents ? tab_contents->is_loading() : false); + } } gfx::Rect BrowserView2::GetNormalBounds() { @@ -716,7 +718,7 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) { // The top few pixels of the TabStrip are a drop-shadow - as we're pretty // starved of dragable area, let's give it to window dragging (this also // makes sense visually). - if (!window->IsMaximized() && + if (!window->IsMaximized() && (point_in_view_coords.y() < tabstrip_->y() + kTabShadowSize)) { // We return HTNOWHERE as this is a signal to our containing // NonClientView that it should figure out what the correct hit-test @@ -942,7 +944,7 @@ int BrowserView2::LayoutBookmarkBar(int top) { top -= kSeparationLineHeight; active_bookmark_bar_->SetBounds(0, top, width(), ps.height()); top += ps.height(); - } + } return top; } int BrowserView2::LayoutInfoBar(int top) { |