summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 20:07:15 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 20:07:15 +0000
commitaead92ea5e4ce873f4f956e6b42870ae6952759e (patch)
tree06bdc9117a12f7ee3ddf91694b83e507b3ed09ce /chrome/browser
parent1a4a8d92f08440dbcf33d484f7a74a0d8293a2c3 (diff)
downloadchromium_src-aead92ea5e4ce873f4f956e6b42870ae6952759e.zip
chromium_src-aead92ea5e4ce873f4f956e6b42870ae6952759e.tar.gz
chromium_src-aead92ea5e4ce873f4f956e6b42870ae6952759e.tar.bz2
Bug 2220 lists two cases where the inactive highlighting doesn't reappear on FindNext. This is a simple fix for one of those cases (user presses Refresh after Find).
BUG=2220 TEST=Open google.com, press Find, press e, press Refresh, press F3 (or FindNext button in UI). Then make sure the inactive matches are highlighted (not just the active match). Review URL: http://codereview.chromium.org/56193 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13028 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/find_bar_controller.cc13
-rw-r--r--chrome/browser/tab_contents/web_contents.h11
2 files changed, 18 insertions, 6 deletions
diff --git a/chrome/browser/find_bar_controller.cc b/chrome/browser/find_bar_controller.cc
index c9c6d51..adb7c067 100644
--- a/chrome/browser/find_bar_controller.cc
+++ b/chrome/browser/find_bar_controller.cc
@@ -125,10 +125,15 @@ void FindBarController::Observe(NotificationType type,
commit_details->entry->transition_type();
// We hide the FindInPage window when the user navigates away, except on
// reload.
- if (find_bar_->IsFindBarVisible() &&
- PageTransition::StripQualifier(transition_type) !=
- PageTransition::RELOAD) {
- EndFindSession();
+ if (find_bar_->IsFindBarVisible()) {
+ if (PageTransition::StripQualifier(transition_type) !=
+ PageTransition::RELOAD) {
+ EndFindSession();
+ } else {
+ // On Reload we want to make sure FindNext is converted to a full Find
+ // to make sure highlights for inactive matches are repainted.
+ web_contents_->set_find_op_aborted(true);
+ }
}
}
}
diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h
index 5aa1093..75984df 100644
--- a/chrome/browser/tab_contents/web_contents.h
+++ b/chrome/browser/tab_contents/web_contents.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -212,6 +212,11 @@ class WebContents : public TabContents,
find_ui_active_ = find_ui_active;
}
+ // Setter for find_op_aborted_.
+ void set_find_op_aborted(bool find_op_aborted) {
+ find_op_aborted_ = find_op_aborted;
+ }
+
// Used _only_ by testing to set the current request ID, since it calls
// StartFinding on the RenderViewHost directly, rather than by using
// StartFinding's more limited API.
@@ -681,7 +686,9 @@ class WebContents : public TabContents,
// True if a Find operation was aborted. This can happen if the Find box is
// closed or if the search term inside the Find box is erased while a search
- // is in progress.
+ // is in progress. This can also be set if a page has been reloaded, and will
+ // on FindNext result in a full Find operation so that the highlighting for
+ // inactive matches can be repainted.
bool find_op_aborted_;
// Each time a search request comes in we assign it an id before passing it