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" |
(...skipping 29 matching lines...) Expand all Loading... |
40 public: | 40 public: |
41 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); | 41 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); |
42 ContentViewCoreImpl(JNIEnv* env, | 42 ContentViewCoreImpl(JNIEnv* env, |
43 jobject obj, | 43 jobject obj, |
44 WebContents* web_contents, | 44 WebContents* web_contents, |
45 ui::ViewAndroid* view_android, | 45 ui::ViewAndroid* view_android, |
46 ui::WindowAndroid* window_android, | 46 ui::WindowAndroid* window_android, |
47 jobject java_bridge_retained_object_set); | 47 jobject java_bridge_retained_object_set); |
48 | 48 |
49 // ContentViewCore implementation. | 49 // ContentViewCore implementation. |
50 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; | 50 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; |
51 virtual WebContents* GetWebContents() const override; | 51 WebContents* GetWebContents() const override; |
52 virtual ui::ViewAndroid* GetViewAndroid() const override; | 52 ui::ViewAndroid* GetViewAndroid() const override; |
53 virtual ui::WindowAndroid* GetWindowAndroid() const override; | 53 ui::WindowAndroid* GetWindowAndroid() const override; |
54 virtual const scoped_refptr<cc::Layer>& GetLayer() const override; | 54 const scoped_refptr<cc::Layer>& GetLayer() const override; |
55 virtual void ShowPastePopup(int x, int y) override; | 55 void ShowPastePopup(int x, int y) override; |
56 virtual void GetScaledContentBitmap( | 56 void GetScaledContentBitmap( |
57 float scale, | 57 float scale, |
58 SkColorType color_type, | 58 SkColorType color_type, |
59 gfx::Rect src_subrect, | 59 gfx::Rect src_subrect, |
60 ReadbackRequestCallback& result_callback) override; | 60 ReadbackRequestCallback& result_callback) override; |
61 virtual float GetDpiScale() const override; | 61 float GetDpiScale() const override; |
62 virtual void PauseOrResumeGeolocation(bool should_pause) override; | 62 void PauseOrResumeGeolocation(bool should_pause) override; |
63 virtual void RequestTextSurroundingSelection( | 63 void RequestTextSurroundingSelection( |
64 int max_length, | 64 int max_length, |
65 const base::Callback<void(const base::string16& content, | 65 const base::Callback<void(const base::string16& content, |
66 int start_offset, | 66 int start_offset, |
67 int end_offset)>& callback) override; | 67 int end_offset)>& callback) override; |
68 | 68 |
69 // -------------------------------------------------------------------------- | 69 // -------------------------------------------------------------------------- |
70 // Methods called from Java via JNI | 70 // Methods called from Java via JNI |
71 // -------------------------------------------------------------------------- | 71 // -------------------------------------------------------------------------- |
72 | 72 |
73 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(JNIEnv* env, | 73 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(JNIEnv* env, |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 void SelectBetweenCoordinates(const gfx::PointF& base, | 279 void SelectBetweenCoordinates(const gfx::PointF& base, |
280 const gfx::PointF& extent); | 280 const gfx::PointF& extent); |
281 | 281 |
282 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); | 282 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); |
283 | 283 |
284 private: | 284 private: |
285 class ContentViewUserData; | 285 class ContentViewUserData; |
286 | 286 |
287 friend class ContentViewUserData; | 287 friend class ContentViewUserData; |
288 virtual ~ContentViewCoreImpl(); | 288 ~ContentViewCoreImpl() override; |
289 | 289 |
290 // WebContentsObserver implementation. | 290 // WebContentsObserver implementation. |
291 virtual void RenderViewReady() override; | 291 void RenderViewReady() override; |
292 virtual void RenderViewHostChanged(RenderViewHost* old_host, | 292 void RenderViewHostChanged(RenderViewHost* old_host, |
293 RenderViewHost* new_host) override; | 293 RenderViewHost* new_host) override; |
294 virtual void WebContentsDestroyed() override; | 294 void WebContentsDestroyed() override; |
295 | 295 |
296 // -------------------------------------------------------------------------- | 296 // -------------------------------------------------------------------------- |
297 // Other private methods and data | 297 // Other private methods and data |
298 // -------------------------------------------------------------------------- | 298 // -------------------------------------------------------------------------- |
299 | 299 |
300 void InitWebContents(); | 300 void InitWebContents(); |
301 | 301 |
302 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; | 302 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; |
303 | 303 |
304 blink::WebGestureEvent MakeGestureEvent( | 304 blink::WebGestureEvent MakeGestureEvent( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; | 347 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; |
348 | 348 |
349 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 349 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
350 }; | 350 }; |
351 | 351 |
352 bool RegisterContentViewCore(JNIEnv* env); | 352 bool RegisterContentViewCore(JNIEnv* env); |
353 | 353 |
354 } // namespace content | 354 } // namespace content |
355 | 355 |
356 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 356 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |