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

Side by Side Diff: chrome/browser/ui/find_bar/find_tab_helper.h

Issue 10905058: Upstream the Android port find-in-page feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit fixes. Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_ 5 #ifndef CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_
6 #define CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_ 6 #define CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_
7 7
8 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 8 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
9 #include "chrome/browser/ui/find_bar/find_notification_details.h" 9 #include "chrome/browser/ui/find_bar/find_notification_details.h"
10 #include "content/public/browser/web_contents_observer.h" 10 #include "content/public/browser/web_contents_observer.h"
11 11
12 namespace gfx {
13 class RectF;
14 }
15
12 // Per-tab find manager. Handles dealing with the life cycle of find sessions. 16 // Per-tab find manager. Handles dealing with the life cycle of find sessions.
13 class FindTabHelper : public content::WebContentsObserver { 17 class FindTabHelper : public content::WebContentsObserver {
14 public: 18 public:
15 explicit FindTabHelper(content::WebContents* web_contents); 19 explicit FindTabHelper(content::WebContents* web_contents);
16 virtual ~FindTabHelper(); 20 virtual ~FindTabHelper();
17 21
18 // Starts the Find operation by calling StartFinding on the Tab. This function 22 // Starts the Find operation by calling StartFinding on the Tab. This function
19 // can be called from the outside as a result of hot-keys, so it uses the 23 // can be called from the outside as a result of hot-keys, so it uses the
20 // last remembered search string as specified with set_find_string(). This 24 // last remembered search string as specified with set_find_string(). This
21 // function does not block while a search is in progress. The controller will 25 // function does not block while a search is in progress. The controller will
(...skipping 28 matching lines...) Expand all
50 string16 find_text() const { return find_text_; } 54 string16 find_text() const { return find_text_; }
51 55
52 // Accessor for the previous search we issued. 56 // Accessor for the previous search we issued.
53 string16 previous_find_text() const { return previous_find_text_; } 57 string16 previous_find_text() const { return previous_find_text_; }
54 58
55 // Accessor for find_result_. 59 // Accessor for find_result_.
56 const FindNotificationDetails& find_result() const { 60 const FindNotificationDetails& find_result() const {
57 return last_search_result_; 61 return last_search_result_;
58 } 62 }
59 63
64 #if defined(OS_ANDROID)
65 // Selects and zooms to the find result nearest to the point (x,y)
66 // defined in find-in-page coordinates.
67 void ActivateNearestFindResult(float x, float y);
68
69 // Asks the renderer to send the rects of the current find matches.
70 void RequestFindMatchRects(int current_version);
71 #endif
72
60 void HandleFindReply(int request_id, 73 void HandleFindReply(int request_id,
61 int number_of_matches, 74 int number_of_matches,
62 const gfx::Rect& selection_rect, 75 const gfx::Rect& selection_rect,
63 int active_match_ordinal, 76 int active_match_ordinal,
64 bool final_update); 77 bool final_update);
65 78
66 private: 79 private:
67 // Each time a search request comes in we assign it an id before passing it 80 // Each time a search request comes in we assign it an id before passing it
68 // over the IPC so that when the results come in we can evaluate whether we 81 // over the IPC so that when the results come in we can evaluate whether we
69 // still care about the results of the search (in some cases we don't because 82 // still care about the results of the search (in some cases we don't because
(...skipping 26 matching lines...) Expand all
96 109
97 // The last find result. This object contains details about the number of 110 // The last find result. This object contains details about the number of
98 // matches, the find selection rectangle, etc. The UI can access this 111 // matches, the find selection rectangle, etc. The UI can access this
99 // information to build its presentation. 112 // information to build its presentation.
100 FindNotificationDetails last_search_result_; 113 FindNotificationDetails last_search_result_;
101 114
102 DISALLOW_COPY_AND_ASSIGN(FindTabHelper); 115 DISALLOW_COPY_AND_ASSIGN(FindTabHelper);
103 }; 116 };
104 117
105 #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_ 118 #endif // CHROME_BROWSER_UI_FIND_BAR_FIND_TAB_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/find_bar/find_match_rects_details.cc ('k') | chrome/browser/ui/find_bar/find_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698