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

Side by Side Diff: chrome/browser/ui/find_bar/find_bar_controller.cc

Issue 2236403004: Handling new frames and frame navigations with find-in-page during a find session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 5 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { 153 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
154 NavigationController* source_controller = 154 NavigationController* source_controller =
155 content::Source<NavigationController>(source).ptr(); 155 content::Source<NavigationController>(source).ptr();
156 if (source_controller == &web_contents_->GetController()) { 156 if (source_controller == &web_contents_->GetController()) {
157 content::LoadCommittedDetails* commit_details = 157 content::LoadCommittedDetails* commit_details =
158 content::Details<content::LoadCommittedDetails>(details).ptr(); 158 content::Details<content::LoadCommittedDetails>(details).ptr();
159 ui::PageTransition transition_type = 159 ui::PageTransition transition_type =
160 commit_details->entry->GetTransitionType(); 160 commit_details->entry->GetTransitionType();
161 // Hide the find bar on reload or navigation. 161 // Hide the find bar on reload or navigation.
162 if (find_bar_->IsFindBarVisible() && 162 if (find_bar_->IsFindBarVisible() && commit_details->is_main_frame &&
dcheng 2016/09/21 07:15:44 Please commenton this fixin the CL description too
paulmeyer 2016/09/21 15:40:52 Done.
163 (ui::PageTransitionCoreTypeIs(transition_type, 163 (ui::PageTransitionCoreTypeIs(transition_type,
164 ui::PAGE_TRANSITION_RELOAD) || 164 ui::PAGE_TRANSITION_RELOAD) ||
165 commit_details->is_navigation_to_different_page())) 165 commit_details->is_navigation_to_different_page()))
166 EndFindSession(kKeepSelectionOnPage, kClearResultsInFindBox); 166 EndFindSession(kKeepSelectionOnPage, kClearResultsInFindBox);
167 } 167 }
168 } 168 }
169 } 169 }
170 170
171 // static 171 // static
172 gfx::Rect FindBarController::GetLocationForFindbarView( 172 gfx::Rect FindBarController::GetLocationForFindbarView(
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 253 }
254 254
255 // Update the find bar with existing results and search text, regardless of 255 // Update the find bar with existing results and search text, regardless of
256 // whether or not the find bar is visible, so that if it's subsequently 256 // whether or not the find bar is visible, so that if it's subsequently
257 // shown it is showing the right state for this tab. We update the find text 257 // shown it is showing the right state for this tab. We update the find text
258 // _first_ since the FindBarView checks its emptiness to see if it should 258 // _first_ since the FindBarView checks its emptiness to see if it should
259 // clear the result count display when there's nothing in the box. 259 // clear the result count display when there's nothing in the box.
260 find_bar_->SetFindTextAndSelectedRange(find_string, 260 find_bar_->SetFindTextAndSelectedRange(find_string,
261 find_tab_helper->selected_range()); 261 find_tab_helper->selected_range());
262 } 262 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/find_request_manager.h » ('j') | content/browser/find_request_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698