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

Unified Diff: android_webview/native/aw_contents.h

Issue 10941015: [Android] Upstream the WebView find-in-page API implementation. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/lib/main/webview_entry_point.cc ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.h
diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h
index 472075ea58ed735a11eb6cacf44b8ee7eb08ce9e..556f50546f1b8b46a2202a1f2f05ddab437c8d73 100644
--- a/android_webview/native/aw_contents.h
+++ b/android_webview/native/aw_contents.h
@@ -8,6 +8,7 @@
#include <jni.h>
#include <string>
+#include "android_webview/browser/find_helper.h"
#include "base/android/scoped_java_ref.h"
#include "base/android/jni_helper.h"
#include "base/memory/scoped_ptr.h"
@@ -29,7 +30,7 @@ class AwWebContentsDelegate;
// Provides the ownership of and access to browser components required for
// WebView functionality; analogous to chrome's TabContents, but with a
// level of indirection provided by the AwContentsContainer abstraction.
-class AwContents {
+class AwContents : public FindHelper::Listener {
public:
// Returns the AwContents instance associated with |web_contents|, or NULL.
static AwContents* FromWebContents(content::WebContents* web_contents);
@@ -38,7 +39,7 @@ class AwContents {
jobject obj,
jobject web_contents_delegate,
bool private_browsing);
- ~AwContents();
+ virtual ~AwContents();
void RunJavaScriptDialog(
content::JavaScriptMessageType message_type,
@@ -65,11 +66,24 @@ class AwContents {
void GenerateMHTML(JNIEnv* env, jobject obj, jstring jpath, jobject callback);
void SetIoThreadClient(JNIEnv* env, jobject obj, jobject client);
+ // Find-in-page API and related methods.
+ jint FindAllSync(JNIEnv* env, jobject obj, jstring search_string);
+ void FindAllAsync(JNIEnv* env, jobject obj, jstring search_string);
+ void FindNext(JNIEnv* env, jobject obj, jboolean forward);
+ void ClearMatches(JNIEnv* env, jobject obj);
+
+ FindHelper* GetFindHelper();
+
+ // FindHelper::Listener implementation.
+ virtual void OnFindResultReceived(int active_ordinal,
+ int match_count,
+ bool finished) OVERRIDE;
private:
JavaObjectWeakGlobalRef java_ref_;
scoped_ptr<AwContentsContainer> contents_container_;
scoped_ptr<AwWebContentsDelegate> web_contents_delegate_;
scoped_ptr<AwRenderViewHostExt> render_view_host_ext_;
+ scoped_ptr<FindHelper> find_helper_;
DISALLOW_COPY_AND_ASSIGN(AwContents);
};
« no previous file with comments | « android_webview/lib/main/webview_entry_point.cc ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698