From d0033329c98edaf3fff226aabe8f5adc7aa10c62 Mon Sep 17 00:00:00 2001 From: "finnur@google.com" Date: Thu, 26 Feb 2009 18:45:45 +0000 Subject: Fix 8063: Find-in-page remains open on History/Downloads page. Added a UI test to catch this in the future. Also, in some of the UI tests I added a generic URL for pages that don't care about the content of the page and are just testing visibility of the Find box, etc. TEST=Covered by tests already. BUG=8063 Review URL: http://codereview.chromium.org/28162 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10490 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/find_bar_win.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'chrome/browser/views/find_bar_win.cc') diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc index 8c4cce9..dd9056c 100644 --- a/chrome/browser/views/find_bar_win.cc +++ b/chrome/browser/views/find_bar_win.cc @@ -225,10 +225,12 @@ void FindBarWin::ChangeWebContents(WebContents* contents) { web_contents_ = contents; - if (web_contents_) { - if (IsVisible() && web_contents_ && !web_contents_->find_ui_active()) - ShowWindow(SW_HIDE); + // Hide any visible find window from the previous tab if NULL |web_contents| + // is passed in or if the find UI is not active in the new tab. + if (IsVisible() && (!web_contents_ || !web_contents_->find_ui_active())) + ShowWindow(SW_HIDE); + if (web_contents_) { NotificationService::current()->AddObserver( this, NotificationType::FIND_RESULT_AVAILABLE, Source(web_contents_)); -- cgit v1.1