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

Unified Diff: content/browser/android/content_view_core_impl.h

Issue 322203002: Add an interface to gather text surrounding the selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@surroundings-patch-5
Patch Set: Comments, and handle any case where the renderer crashes differently. Created 6 years, 6 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: content/browser/android/content_view_core_impl.h
diff --git a/content/browser/android/content_view_core_impl.h b/content/browser/android/content_view_core_impl.h
index 6c003df44620f384a828e460fbba36473f982419..29964fc09751e515ffc8b5b4ba1dd8114aef9774 100644
--- a/content/browser/android/content_view_core_impl.h
+++ b/content/browser/android/content_view_core_impl.h
@@ -9,7 +9,6 @@
#include "base/android/jni_android.h"
#include "base/android/jni_weak_ref.h"
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/i18n/rtl.h"
#include "base/memory/scoped_ptr.h"
@@ -62,6 +61,9 @@ class ContentViewCoreImpl : public ContentViewCore,
virtual float GetDpiScale() const OVERRIDE;
virtual void PauseVideo() OVERRIDE;
virtual void PauseOrResumeGeolocation(bool should_pause) OVERRIDE;
+ virtual void RequestTextSurroundingSelection(
+ int max_length,
+ const TextSurroundingSelectionCallback& callback) OVERRIDE;
// --------------------------------------------------------------------------
// Methods called from Java via JNI
@@ -226,6 +228,11 @@ class ContentViewCoreImpl : public ContentViewCore,
jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj);
+ void OnTextSurroundingSelectionResponse(const base::string16& content,
+ int start_offset,
+ int end_offset);
+
+
// --------------------------------------------------------------------------
// Public methods that call to Java via JNI
// --------------------------------------------------------------------------
@@ -378,6 +385,8 @@ class ContentViewCoreImpl : public ContentViewCore,
scoped_ptr<JavaBridgeDispatcherHostManager>
java_bridge_dispatcher_host_manager_;
+ TextSurroundingSelectionCallback text_surroundings_callback_;
+
DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
};
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.cc » ('j') | content/browser/android/content_view_core_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698