Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2833)

Unified Diff: chrome/browser/ui/find_bar/find_bar_controller.cc

Issue 532143002: Close the find bar on reload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit chnages done. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | chrome/browser/ui/find_bar/find_bar_host_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/find_bar/find_bar_controller.cc
diff --git a/chrome/browser/ui/find_bar/find_bar_controller.cc b/chrome/browser/ui/find_bar/find_bar_controller.cc
index 713c3fa0984cbf5303fb1af640a47d0266e9b60c..5241fa4a190f10643968ddf671a14a8c696535b5 100644
--- a/chrome/browser/ui/find_bar/find_bar_controller.cc
+++ b/chrome/browser/ui/find_bar/find_bar_controller.cc
@@ -155,22 +155,12 @@ void FindBarController::Observe(int type,
content::Details<content::LoadCommittedDetails>(details).ptr();
content::PageTransition transition_type =
commit_details->entry->GetTransitionType();
- // We hide the FindInPage window when the user navigates away, except on
- // reload (and when clicking on anchors within web pages).
- if (find_bar_->IsFindBarVisible()) {
- if (content::PageTransitionStripQualifier(transition_type) !=
- content::PAGE_TRANSITION_RELOAD) {
- // This is a new navigation (not reload), but we still don't want the
- // Find box to disappear if the navigation is just to a fragment
- // within the page.
- if (commit_details->is_navigation_to_different_page())
- EndFindSession(kKeepSelectionOnPage, kClearResultsInFindBox);
- } else {
- // On Reload we want to make sure FindNext is converted to a full Find
- // to make sure highlights for inactive matches are repainted.
- find_tab_helper->set_find_op_aborted(true);
- }
- }
+ // Hide the find bar on reload or navigation.
+ if (find_bar_->IsFindBarVisible() &&
+ (content::PageTransitionStripQualifier(transition_type) ==
+ content::PAGE_TRANSITION_RELOAD ||
+ commit_details->is_navigation_to_different_page()))
+ EndFindSession(kKeepSelectionOnPage, kClearResultsInFindBox);
}
}
}
« no previous file with comments | « AUTHORS ('k') | chrome/browser/ui/find_bar/find_bar_host_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698