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

Unified Diff: chrome/browser/ui/find_bar/find_tab_helper.cc

Issue 10905058: Upstream the Android port find-in-page feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/find_bar/find_tab_helper.cc
diff --git a/chrome/browser/ui/find_bar/find_tab_helper.cc b/chrome/browser/ui/find_bar/find_tab_helper.cc
index 7b9dee16acc8125fa1d3918819f7ecd1255b2c6e..273c784ecf3bae3a8688e5196ff0d1bf781c3b37 100644
--- a/chrome/browser/ui/find_bar/find_tab_helper.cc
+++ b/chrome/browser/ui/find_bar/find_tab_helper.cc
@@ -9,12 +9,14 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/find_bar/find_bar_state.h"
#include "chrome/browser/ui/find_bar/find_bar_state_factory.h"
+#include "chrome/browser/ui/find_bar/find_match_rects_details.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/stop_find_action.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h"
+#include "ui/gfx/rect_f.h"
using WebKit::WebFindOptions;
using content::WebContents;
@@ -124,6 +126,31 @@ void FindTabHelper::StopFinding(
web_contents()->GetRenderViewHost()->StopFinding(action);
}
+#if defined(OS_ANDROID)
+void FindTabHelper::ActivateNearestFindResult(float x, float y) {
+ if (!find_op_aborted_ && !find_text_.empty()) {
jam 2012/09/04 16:39:09 here and below, are these checks really necessary?
Leandro GraciĆ” Gil 2012/09/04 18:25:50 Probably not if we abort find (it should hide the
+ web_contents()->GetRenderViewHost()->ActivateNearestFindResult(
+ current_find_request_id_, x, y);
+ }
+}
+
+void FindTabHelper::RequestFindMatchRects(int current_version) {
+ if (!find_op_aborted_ && !find_text_.empty())
+ web_contents()->GetRenderViewHost()->RequestFindMatchRects(current_version);
+}
+
+void FindTabHelper::HandleGetFindMatchRectsReply(
+ int version,
+ const std::vector<gfx::RectF>& rects,
+ const gfx::RectF& active_rect) {
+ FindMatchRectsDetails match_rects(version, rects, active_rect);
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_FIND_MATCH_RECTS_AVAILABLE,
+ content::Source<WebContents>(web_contents()),
+ content::Details<FindMatchRectsDetails>(&match_rects));
+}
+#endif
+
void FindTabHelper::HandleFindReply(int request_id,
int number_of_matches,
const gfx::Rect& selection_rect,

Powered by Google App Engine
This is Rietveld 408576698