OLD | NEW |
---|---|
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" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
17 #include "content/browser/android/text_surroundings_delegate.h" | |
17 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 18 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
18 #include "content/browser/web_contents/web_contents_impl.h" | 19 #include "content/browser/web_contents/web_contents_impl.h" |
19 #include "content/public/browser/android/content_view_core.h" | 20 #include "content/public/browser/android/content_view_core.h" |
20 #include "content/public/browser/web_contents_observer.h" | 21 #include "content/public/browser/web_contents_observer.h" |
21 #include "third_party/WebKit/public/web/WebInputEvent.h" | 22 #include "third_party/WebKit/public/web/WebInputEvent.h" |
22 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
23 #include "ui/gfx/rect_f.h" | 24 #include "ui/gfx/rect_f.h" |
24 #include "url/gurl.h" | 25 #include "url/gurl.h" |
25 | 26 |
26 namespace ui { | 27 namespace ui { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 jobject obj, | 218 jobject obj, |
218 jint x, | 219 jint x, |
219 jint y, | 220 jint y, |
220 jint width, | 221 jint width, |
221 jint height); | 222 jint height); |
222 | 223 |
223 void SetBackgroundOpaque(JNIEnv* env, jobject jobj, jboolean opaque); | 224 void SetBackgroundOpaque(JNIEnv* env, jobject jobj, jboolean opaque); |
224 | 225 |
225 jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj); | 226 jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj); |
226 | 227 |
227 void TextSurroundingSelectionRequest(JNIEnv* env, | 228 void SetTextSurroundingsDelegate(TextSurroundingsDelegate* delegate) { |
jdduke (slow)
2014/06/10 22:08:09
Ah, so looks like we'll need to have this method e
donnd
2014/06/17 22:23:25
Done.
| |
228 jobject obj, | 229 text_surroundings_delegate_ = delegate; |
David Trainor- moved to gerrit
2014/06/11 17:38:28
body in cc file except for getters/setters that ar
donnd
2014/06/17 22:23:25
Done.
| |
229 jint max_length); | 230 } |
231 virtual void TextSurroundingSelectionRequest(int max_length); | |
jdduke (slow)
2014/06/10 22:08:09
Nit: This should probably read RequestTextSurround
donnd
2014/06/17 22:23:25
Done.
| |
232 void OnTextSurroundingSelectionResponse(const base::string16& content, | |
233 int start_offset, | |
234 int end_offset); | |
230 | 235 |
231 // -------------------------------------------------------------------------- | 236 // -------------------------------------------------------------------------- |
232 // Public methods that call to Java via JNI | 237 // Public methods that call to Java via JNI |
233 // -------------------------------------------------------------------------- | 238 // -------------------------------------------------------------------------- |
234 | 239 |
235 void OnSmartClipDataExtracted(const base::string16& result); | 240 void OnSmartClipDataExtracted(const base::string16& result); |
236 | 241 |
237 // Creates a popup menu with |items|. | 242 // Creates a popup menu with |items|. |
238 // |multiple| defines if it should support multi-select. | 243 // |multiple| defines if it should support multi-select. |
239 // If not |multiple|, |selected_item| sets the initially selected item. | 244 // If not |multiple|, |selected_item| sets the initially selected item. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
292 // Returns True if the given media should be blocked to load. | 297 // Returns True if the given media should be blocked to load. |
293 bool ShouldBlockMediaRequest(const GURL& url); | 298 bool ShouldBlockMediaRequest(const GURL& url); |
294 | 299 |
295 void DidStopFlinging(); | 300 void DidStopFlinging(); |
296 | 301 |
297 // Returns the viewport size after accounting for the viewport offset. | 302 // Returns the viewport size after accounting for the viewport offset. |
298 gfx::Size GetViewSize() const; | 303 gfx::Size GetViewSize() const; |
299 | 304 |
300 void SetAccessibilityEnabledInternal(bool enabled); | 305 void SetAccessibilityEnabledInternal(bool enabled); |
301 | 306 |
302 void OnTextSurroundingSelectionResponse(const base::string16& content, | |
303 int start_offset, | |
304 int end_offset); | |
305 | |
306 // -------------------------------------------------------------------------- | 307 // -------------------------------------------------------------------------- |
307 // Methods called from native code | 308 // Methods called from native code |
308 // -------------------------------------------------------------------------- | 309 // -------------------------------------------------------------------------- |
309 | 310 |
310 gfx::Size GetPhysicalBackingSize() const; | 311 gfx::Size GetPhysicalBackingSize() const; |
311 gfx::Size GetViewportSizeDip() const; | 312 gfx::Size GetViewportSizeDip() const; |
312 gfx::Size GetViewportSizeOffsetDip() const; | 313 gfx::Size GetViewportSizeOffsetDip() const; |
313 float GetOverdrawBottomHeightDip() const; | 314 float GetOverdrawBottomHeightDip() const; |
314 | 315 |
315 void AttachLayer(scoped_refptr<cc::Layer> layer); | 316 void AttachLayer(scoped_refptr<cc::Layer> layer); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
377 // The cache of device's current orientation set from Java side, this value | 378 // The cache of device's current orientation set from Java side, this value |
378 // will be sent to Renderer once it is ready. | 379 // will be sent to Renderer once it is ready. |
379 int device_orientation_; | 380 int device_orientation_; |
380 | 381 |
381 bool accessibility_enabled_; | 382 bool accessibility_enabled_; |
382 | 383 |
383 // Manages injecting Java objects. | 384 // Manages injecting Java objects. |
384 scoped_ptr<JavaBridgeDispatcherHostManager> | 385 scoped_ptr<JavaBridgeDispatcherHostManager> |
385 java_bridge_dispatcher_host_manager_; | 386 java_bridge_dispatcher_host_manager_; |
386 | 387 |
388 TextSurroundingsDelegate* text_surroundings_delegate_; | |
jdduke (slow)
2014/06/10 22:08:09
You'll want to NULL this in the constructor.
donnd
2014/06/17 22:23:25
Done.
| |
389 | |
387 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 390 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
388 }; | 391 }; |
389 | 392 |
390 bool RegisterContentViewCore(JNIEnv* env); | 393 bool RegisterContentViewCore(JNIEnv* env); |
391 | 394 |
392 } // namespace content | 395 } // namespace content |
393 | 396 |
394 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 397 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |