OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |