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

Unified Diff: chrome/browser/android/find_in_page/find_in_page_bridge.h

Issue 633743002: Add FindInPageBridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Ted's comments Created 6 years, 2 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/android/find_in_page/find_in_page_bridge.h
diff --git a/chrome/browser/android/find_in_page/find_in_page_bridge.h b/chrome/browser/android/find_in_page/find_in_page_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e5d715f067cf41e907ad563fb81ed4b42dee4f3
--- /dev/null
+++ b/chrome/browser/android/find_in_page/find_in_page_bridge.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_FIND_IN_PAGE_FIND_IN_PAGE_BRIDGE_H_
+#define CHROME_BROWSER_ANDROID_FIND_IN_PAGE_FIND_IN_PAGE_BRIDGE_H_
+
+#include <jni.h>
+
+#include "base/android/jni_weak_ref.h"
+#include "content/public/browser/web_contents.h"
+
+class FindInPageBridge {
+ public:
+ FindInPageBridge(JNIEnv* env, jobject obj, jobject j_web_contents);
+ void Destroy(JNIEnv*, jobject);
+
+ void StartFinding(JNIEnv* env,
+ jobject obj,
+ jstring search_string,
+ jboolean forward_direction,
+ jboolean case_sensitive);
+
+ void StopFinding(JNIEnv* env, jobject obj);
+
+ base::android::ScopedJavaLocalRef<jstring> GetPreviousFindText(JNIEnv* env,
+ jobject obj);
+
+ void RequestFindMatchRects(JNIEnv* env, jobject obj, jint current_version);
+
+ void ActivateNearestFindResult(JNIEnv* env, jobject obj, jfloat x, jfloat y);
+
+ static bool RegisterFindInPageBridge(JNIEnv* env);
+
+ private:
+ content::WebContents* web_contents_;
+ JavaObjectWeakGlobalRef weak_java_ref_;
+
+ DISALLOW_COPY_AND_ASSIGN(FindInPageBridge);
+};
+
+#endif // CHROME_BROWSER_ANDROID_FIND_IN_PAGE_FIND_IN_PAGE_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698