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

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

Issue 498133002: Findbox should disappear once we reload and open new tab and come back to previous tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 MaybeSetPrepopulateText(); 113 MaybeSetPrepopulateText();
114 114
115 if (find_tab_helper && find_tab_helper->find_ui_active()) { 115 if (find_tab_helper && find_tab_helper->find_ui_active()) {
116 // A tab with a visible find bar just got selected and we need to show the 116 // A tab with a visible find bar just got selected and we need to show the
117 // find bar but without animation since it was already animated into its 117 // find bar but without animation since it was already animated into its
118 // visible state. We also want to reset the window location so that 118 // visible state. We also want to reset the window location so that
119 // we don't surprise the user by popping up to the left for no apparent 119 // we don't surprise the user by popping up to the left for no apparent
120 // reason. 120 // reason.
121 find_bar_->Show(false); 121 find_bar_->Show(false);
122 } 122 }
123 123 // Clearing the count and previous results.
124 find_tab_helper->StopFinding(kClearSelectionOnPage);
Finnur 2014/08/25 10:50:41 This fix isn't correct. This breaks the following
Deepak 2014/08/25 14:22:42 Thanks for review, I will modify my patch, conside
124 UpdateFindBarForCurrentResult(); 125 UpdateFindBarForCurrentResult();
125 find_bar_->UpdateFindBarForChangedWebContents(); 126 find_bar_->UpdateFindBarForChangedWebContents();
126 } 127 }
127 128
128 //////////////////////////////////////////////////////////////////////////////// 129 ////////////////////////////////////////////////////////////////////////////////
129 // FindBarHost, content::NotificationObserver implementation: 130 // FindBarHost, content::NotificationObserver implementation:
130 131
131 void FindBarController::Observe(int type, 132 void FindBarController::Observe(int type,
132 const content::NotificationSource& source, 133 const content::NotificationSource& source,
133 const content::NotificationDetails& details) { 134 const content::NotificationDetails& details) {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 } 261 }
261 262
262 // Update the find bar with existing results and search text, regardless of 263 // Update the find bar with existing results and search text, regardless of
263 // whether or not the find bar is visible, so that if it's subsequently 264 // whether or not the find bar is visible, so that if it's subsequently
264 // shown it is showing the right state for this tab. We update the find text 265 // shown it is showing the right state for this tab. We update the find text
265 // _first_ since the FindBarView checks its emptiness to see if it should 266 // _first_ since the FindBarView checks its emptiness to see if it should
266 // clear the result count display when there's nothing in the box. 267 // clear the result count display when there's nothing in the box.
267 find_bar_->SetFindTextAndSelectedRange(find_string, 268 find_bar_->SetFindTextAndSelectedRange(find_string,
268 find_tab_helper->selected_range()); 269 find_tab_helper->selected_range());
269 } 270 }
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698