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

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: Minor format changes done by "git cl format". 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"
20 #include "content/public/browser/web_contents_observer.h" 19 #include "content/public/browser/web_contents_observer.h"
21 #include "third_party/WebKit/public/web/WebInputEvent.h" 20 #include "third_party/WebKit/public/web/WebInputEvent.h"
22 #include "ui/gfx/rect.h" 21 #include "ui/gfx/rect.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 virtual void ShowPastePopup(int x, int y) OVERRIDE; 54 virtual void ShowPastePopup(int x, int y) OVERRIDE;
56 virtual void GetScaledContentBitmap( 55 virtual void GetScaledContentBitmap(
57 float scale, 56 float scale,
58 jobject bitmap_config, 57 jobject bitmap_config,
59 gfx::Rect src_subrect, 58 gfx::Rect src_subrect,
60 const base::Callback<void(bool, const SkBitmap&)>& result_callback) 59 const base::Callback<void(bool, const SkBitmap&)>& result_callback)
61 OVERRIDE; 60 OVERRIDE;
62 virtual float GetDpiScale() const OVERRIDE; 61 virtual float GetDpiScale() const OVERRIDE;
63 virtual void PauseVideo() OVERRIDE; 62 virtual void PauseVideo() OVERRIDE;
64 virtual void PauseOrResumeGeolocation(bool should_pause) OVERRIDE; 63 virtual void PauseOrResumeGeolocation(bool should_pause) OVERRIDE;
64 virtual void RequestTextSurroundingSelection(
65 int max_length,
66 const TextSurroundingSelectionCallback& callback) OVERRIDE;
65 67
66 // -------------------------------------------------------------------------- 68 // --------------------------------------------------------------------------
67 // Methods called from Java via JNI 69 // Methods called from Java via JNI
68 // -------------------------------------------------------------------------- 70 // --------------------------------------------------------------------------
69 71
70 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(JNIEnv* env, 72 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(JNIEnv* env,
71 jobject obj); 73 jobject obj);
72 74
73 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); 75 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj);
74 76
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 jobject obj, 221 jobject obj,
220 jint x, 222 jint x,
221 jint y, 223 jint y,
222 jint width, 224 jint width,
223 jint height); 225 jint height);
224 226
225 void SetBackgroundOpaque(JNIEnv* env, jobject jobj, jboolean opaque); 227 void SetBackgroundOpaque(JNIEnv* env, jobject jobj, jboolean opaque);
226 228
227 jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj); 229 jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj);
228 230
231 void OnTextSurroundingSelectionResponse(const base::string16& content,
232 int start_offset,
233 int end_offset);
234
229 // -------------------------------------------------------------------------- 235 // --------------------------------------------------------------------------
230 // Public methods that call to Java via JNI 236 // Public methods that call to Java via JNI
231 // -------------------------------------------------------------------------- 237 // --------------------------------------------------------------------------
232 238
233 void OnSmartClipDataExtracted(const base::string16& result); 239 void OnSmartClipDataExtracted(const base::string16& result);
234 240
235 // Creates a popup menu with |items|. 241 // Creates a popup menu with |items|.
236 // |multiple| defines if it should support multi-select. 242 // |multiple| defines if it should support multi-select.
237 // If not |multiple|, |selected_item| sets the initially selected item. 243 // If not |multiple|, |selected_item| sets the initially selected item.
238 // Otherwise, item's "checked" flag selects it. 244 // 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 377 // The cache of device's current orientation set from Java side, this value
372 // will be sent to Renderer once it is ready. 378 // will be sent to Renderer once it is ready.
373 int device_orientation_; 379 int device_orientation_;
374 380
375 bool accessibility_enabled_; 381 bool accessibility_enabled_;
376 382
377 // Manages injecting Java objects. 383 // Manages injecting Java objects.
378 scoped_ptr<JavaBridgeDispatcherHostManager> 384 scoped_ptr<JavaBridgeDispatcherHostManager>
379 java_bridge_dispatcher_host_manager_; 385 java_bridge_dispatcher_host_manager_;
380 386
387 TextSurroundingSelectionCallback text_surroundings_callback_;
388
381 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); 389 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
382 }; 390 };
383 391
384 bool RegisterContentViewCore(JNIEnv* env); 392 bool RegisterContentViewCore(JNIEnv* env);
385 393
386 } // namespace content 394 } // namespace content
387 395
388 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 396 #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