summaryrefslogtreecommitdiffstats
path: root/android_webview/native/aw_contents.h
diff options
context:
space:
mode:
Diffstat (limited to 'android_webview/native/aw_contents.h')
-rw-r--r--android_webview/native/aw_contents.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h
index 472075e..556f5054 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);
};