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

Side by Side Diff: chrome/browser/ui/find_bar/find_tab_helper.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: make same logic for removing Findbox on reload. 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/find_bar/find_tab_helper.h ('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_tab_helper.h" 5 #include "chrome/browser/ui/find_bar/find_tab_helper.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // static 25 // static
26 int FindTabHelper::find_request_id_counter_ = -1; 26 int FindTabHelper::find_request_id_counter_ = -1;
27 27
28 FindTabHelper::FindTabHelper(WebContents* web_contents) 28 FindTabHelper::FindTabHelper(WebContents* web_contents)
29 : content::WebContentsObserver(web_contents), 29 : content::WebContentsObserver(web_contents),
30 find_ui_active_(false), 30 find_ui_active_(false),
31 find_op_aborted_(false), 31 find_op_aborted_(false),
32 current_find_request_id_(find_request_id_counter_++), 32 current_find_request_id_(find_request_id_counter_++),
33 last_search_case_sensitive_(false), 33 last_search_case_sensitive_(false),
34 last_search_result_() { 34 last_search_result_(),
35 loading_at_tab_Change_(false) {
35 } 36 }
36 37
37 FindTabHelper::~FindTabHelper() { 38 FindTabHelper::~FindTabHelper() {
38 } 39 }
39 40
40 void FindTabHelper::StartFinding(base::string16 search_string, 41 void FindTabHelper::StartFinding(base::string16 search_string,
41 bool forward_direction, 42 bool forward_direction,
42 bool case_sensitive) { 43 bool case_sensitive) {
43 // Remove the carriage return character, which generally isn't in web content. 44 // Remove the carriage return character, which generally isn't in web content.
44 const base::char16 kInvalidChars[] = { '\r', 0 }; 45 const base::char16 kInvalidChars[] = { '\r', 0 };
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // found. 170 // found.
170 last_search_result_ = FindNotificationDetails( 171 last_search_result_ = FindNotificationDetails(
171 request_id, number_of_matches, selection, active_match_ordinal, 172 request_id, number_of_matches, selection, active_match_ordinal,
172 final_update); 173 final_update);
173 content::NotificationService::current()->Notify( 174 content::NotificationService::current()->Notify(
174 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, 175 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE,
175 content::Source<WebContents>(web_contents()), 176 content::Source<WebContents>(web_contents()),
176 content::Details<FindNotificationDetails>(&last_search_result_)); 177 content::Details<FindNotificationDetails>(&last_search_result_));
177 } 178 }
178 } 179 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/find_bar/find_tab_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698