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

Side by Side 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. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
11 #include "base/android/jni_weak_ref.h" 11 #include "base/android/jni_weak_ref.h"
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
14 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
15 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
16 #include "base/process/process.h" 15 #include "base/process/process.h"
17 #include "content/browser/renderer_host/render_widget_host_view_android.h" 16 #include "content/browser/renderer_host/render_widget_host_view_android.h"
18 #include "content/browser/web_contents/web_contents_impl.h" 17 #include "content/browser/web_contents/web_contents_impl.h"
19 #include "content/public/browser/android/content_view_core.h" 18 #include "content/public/browser/android/content_view_core.h"
19 #include "content/public/browser/android/text_surroundings_delegate.h"
20 #include "content/public/browser/web_contents_observer.h" 20 #include "content/public/browser/web_contents_observer.h"
21 #include "third_party/WebKit/public/web/WebInputEvent.h" 21 #include "third_party/WebKit/public/web/WebInputEvent.h"
22 #include "ui/gfx/rect.h" 22 #include "ui/gfx/rect.h"
23 #include "ui/gfx/rect_f.h" 23 #include "ui/gfx/rect_f.h"
24 #include "url/gurl.h" 24 #include "url/gurl.h"
25 25
26 namespace ui { 26 namespace ui {
27 class ViewAndroid; 27 class ViewAndroid;
28 class WindowAndroid; 28 class WindowAndroid;
29 } 29 }
(...skipping 25 matching lines...) Expand all
55 virtual void ShowPastePopup(int x, int y) OVERRIDE; 55 virtual void ShowPastePopup(int x, int y) OVERRIDE;
56 virtual void GetScaledContentBitmap( 56 virtual void GetScaledContentBitmap(
57 float scale, 57 float scale,
58 jobject bitmap_config, 58 jobject bitmap_config,
59 gfx::Rect src_subrect, 59 gfx::Rect src_subrect,
60 const base::Callback<void(bool, const SkBitmap&)>& result_callback) 60 const base::Callback<void(bool, const SkBitmap&)>& result_callback)
61 OVERRIDE; 61 OVERRIDE;
62 virtual float GetDpiScale() const OVERRIDE; 62 virtual float GetDpiScale() const OVERRIDE;
63 virtual void PauseVideo() OVERRIDE; 63 virtual void PauseVideo() OVERRIDE;
64 virtual void PauseOrResumeGeolocation(bool should_pause) OVERRIDE; 64 virtual void PauseOrResumeGeolocation(bool should_pause) OVERRIDE;
65 virtual void SetTextSurroundingsDelegate(TextSurroundingsDelegate* delegate)
66 OVERRIDE;
67 virtual void RequestTextSurroundingSelection(int max_length) const OVERRIDE;
65 68
66 // -------------------------------------------------------------------------- 69 // --------------------------------------------------------------------------
67 // Methods called from Java via JNI 70 // Methods called from Java via JNI
68 // -------------------------------------------------------------------------- 71 // --------------------------------------------------------------------------
69 72
70 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(JNIEnv* env, 73 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(JNIEnv* env,
71 jobject obj); 74 jobject obj);
72 75
73 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); 76 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj);
74 77
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 jobject obj, 222 jobject obj,
220 jint x, 223 jint x,
221 jint y, 224 jint y,
222 jint width, 225 jint width,
223 jint height); 226 jint height);
224 227
225 void SetBackgroundOpaque(JNIEnv* env, jobject jobj, jboolean opaque); 228 void SetBackgroundOpaque(JNIEnv* env, jobject jobj, jboolean opaque);
226 229
227 jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj); 230 jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj);
228 231
232 void OnTextSurroundingSelectionResponse(const base::string16& content,
233 int start_offset,
234 int end_offset);
235
236
229 // -------------------------------------------------------------------------- 237 // --------------------------------------------------------------------------
230 // Public methods that call to Java via JNI 238 // Public methods that call to Java via JNI
231 // -------------------------------------------------------------------------- 239 // --------------------------------------------------------------------------
232 240
233 void OnSmartClipDataExtracted(const base::string16& result); 241 void OnSmartClipDataExtracted(const base::string16& result);
234 242
235 // Creates a popup menu with |items|. 243 // Creates a popup menu with |items|.
236 // |multiple| defines if it should support multi-select. 244 // |multiple| defines if it should support multi-select.
237 // If not |multiple|, |selected_item| sets the initially selected item. 245 // If not |multiple|, |selected_item| sets the initially selected item.
238 // Otherwise, item's "checked" flag selects it. 246 // Otherwise, item's "checked" flag selects it.
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // The cache of device's current orientation set from Java side, this value 379 // The cache of device's current orientation set from Java side, this value
372 // will be sent to Renderer once it is ready. 380 // will be sent to Renderer once it is ready.
373 int device_orientation_; 381 int device_orientation_;
374 382
375 bool accessibility_enabled_; 383 bool accessibility_enabled_;
376 384
377 // Manages injecting Java objects. 385 // Manages injecting Java objects.
378 scoped_ptr<JavaBridgeDispatcherHostManager> 386 scoped_ptr<JavaBridgeDispatcherHostManager>
379 java_bridge_dispatcher_host_manager_; 387 java_bridge_dispatcher_host_manager_;
380 388
389 TextSurroundingsDelegate* text_surroundings_delegate_;
390
381 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); 391 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
382 }; 392 };
383 393
384 bool RegisterContentViewCore(JNIEnv* env); 394 bool RegisterContentViewCore(JNIEnv* env);
385 395
386 } // namespace content 396 } // namespace content
387 397
388 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 398 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
OLDNEW
« 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