diff options
-rw-r--r-- | chrome/browser/browser.cc | 3 | ||||
-rw-r--r-- | chrome/browser/tab_contents/match_preview.cc | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index d636310..f777f25 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -3266,8 +3266,7 @@ void Browser::ShowMatchPreview() { } void Browser::HideMatchPreview() { - if (match_preview_->tab_contents() == GetSelectedTabContents()) - window_->HideMatchPreview(); + window_->HideMatchPreview(); } void Browser::CommitMatchPreview() { diff --git a/chrome/browser/tab_contents/match_preview.cc b/chrome/browser/tab_contents/match_preview.cc index 1d24287..1ddd4e9 100644 --- a/chrome/browser/tab_contents/match_preview.cc +++ b/chrome/browser/tab_contents/match_preview.cc @@ -505,6 +505,11 @@ void MatchPreview::SetOmniboxBounds(const gfx::Rect& bounds) { } void MatchPreview::DestroyPreviewContents() { + if (!preview_contents_.get()) { + // We're not showing anything, nothing to do. + return; + } + delegate_->HideMatchPreview(); delete ReleasePreviewContents(false); } |