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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 class ContentViewCoreImpl : public ContentViewCore, | 47 class ContentViewCoreImpl : public ContentViewCore, |
48 public ui::OverscrollRefreshHandler, | 48 public ui::OverscrollRefreshHandler, |
49 public WebContentsObserver { | 49 public WebContentsObserver { |
50 public: | 50 public: |
51 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); | 51 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); |
52 ContentViewCoreImpl( | 52 ContentViewCoreImpl( |
53 JNIEnv* env, | 53 JNIEnv* env, |
54 jobject obj, | 54 jobject obj, |
55 WebContents* web_contents, | 55 WebContents* web_contents, |
| 56 const base::android::JavaRef<jobject>& view_context, |
56 const base::android::JavaRef<jobject>& view_android_delegate, | 57 const base::android::JavaRef<jobject>& view_android_delegate, |
57 ui::WindowAndroid* window_android, | 58 ui::WindowAndroid* window_android, |
58 jobject java_bridge_retained_object_set); | 59 jobject java_bridge_retained_object_set); |
59 | 60 |
60 // ContentViewCore implementation. | 61 // ContentViewCore implementation. |
61 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; | 62 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; |
62 WebContents* GetWebContents() const override; | 63 WebContents* GetWebContents() const override; |
63 ui::WindowAndroid* GetWindowAndroid() const override; | 64 ui::WindowAndroid* GetWindowAndroid() const override; |
64 const base::android::JavaRef<jobject>& GetViewAndroidDelegate() | 65 ui::ViewAndroid* GetViewAndroid() override; |
65 const override; | |
66 cc::Layer* GetLayer() const override; | 66 cc::Layer* GetLayer() const override; |
67 bool ShowPastePopup(int x, int y) override; | 67 bool ShowPastePopup(int x, int y) override; |
68 float GetDpiScale() const override; | 68 float GetDpiScale() const override; |
69 void PauseOrResumeGeolocation(bool should_pause) override; | 69 void PauseOrResumeGeolocation(bool should_pause) override; |
70 void RequestTextSurroundingSelection( | 70 void RequestTextSurroundingSelection( |
71 int max_length, | 71 int max_length, |
72 const base::Callback<void(const base::string16& content, | 72 const base::Callback<void(const base::string16& content, |
73 int start_offset, | 73 int start_offset, |
74 int end_offset)>& callback) override; | 74 int end_offset)>& callback) override; |
75 | 75 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 void AttachLayer(scoped_refptr<cc::Layer> layer); | 397 void AttachLayer(scoped_refptr<cc::Layer> layer); |
398 void RemoveLayer(scoped_refptr<cc::Layer> layer); | 398 void RemoveLayer(scoped_refptr<cc::Layer> layer); |
399 | 399 |
400 void MoveRangeSelectionExtent(const gfx::PointF& extent); | 400 void MoveRangeSelectionExtent(const gfx::PointF& extent); |
401 | 401 |
402 void SelectBetweenCoordinates(const gfx::PointF& base, | 402 void SelectBetweenCoordinates(const gfx::PointF& base, |
403 const gfx::PointF& extent); | 403 const gfx::PointF& extent); |
404 | 404 |
405 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); | 405 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); |
406 | 406 |
407 ui::ViewAndroid* GetViewAndroid(); | |
408 | |
409 private: | 407 private: |
410 class ContentViewUserData; | 408 class ContentViewUserData; |
411 | 409 |
412 friend class ContentViewUserData; | 410 friend class ContentViewUserData; |
413 ~ContentViewCoreImpl() override; | 411 ~ContentViewCoreImpl() override; |
414 | 412 |
415 // WebContentsObserver implementation. | 413 // WebContentsObserver implementation. |
416 void RenderViewReady() override; | 414 void RenderViewReady() override; |
417 void RenderViewHostChanged(RenderViewHost* old_host, | 415 void RenderViewHostChanged(RenderViewHost* old_host, |
418 RenderViewHost* new_host) override; | 416 RenderViewHost* new_host) override; |
(...skipping 27 matching lines...) Expand all Loading... |
446 void SetFocusInternal(bool focused); | 444 void SetFocusInternal(bool focused); |
447 | 445 |
448 // Send device_orientation_ to renderer. | 446 // Send device_orientation_ to renderer. |
449 void SendOrientationChangeEventInternal(); | 447 void SendOrientationChangeEventInternal(); |
450 | 448 |
451 float dpi_scale() const { return dpi_scale_; } | 449 float dpi_scale() const { return dpi_scale_; } |
452 | 450 |
453 // A weak reference to the Java ContentViewCore object. | 451 // A weak reference to the Java ContentViewCore object. |
454 JavaObjectWeakGlobalRef java_ref_; | 452 JavaObjectWeakGlobalRef java_ref_; |
455 | 453 |
| 454 // Select popup view |
| 455 base::android::ScopedJavaGlobalRef<jobject> select_popup_; |
| 456 |
456 ui::ViewAndroid view_; | 457 ui::ViewAndroid view_; |
457 | 458 |
458 // Reference to the current WebContents used to determine how and what to | 459 // Reference to the current WebContents used to determine how and what to |
459 // display in the ContentViewCore. | 460 // display in the ContentViewCore. |
460 WebContentsImpl* web_contents_; | 461 WebContentsImpl* web_contents_; |
461 | 462 |
462 // Page scale factor. | 463 // Page scale factor. |
463 float page_scale_; | 464 float page_scale_; |
464 | 465 |
465 // Device scale factor. | 466 // Device scale factor. |
(...skipping 12 matching lines...) Expand all Loading... |
478 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; | 479 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; |
479 | 480 |
480 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 481 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
481 }; | 482 }; |
482 | 483 |
483 bool RegisterContentViewCore(JNIEnv* env); | 484 bool RegisterContentViewCore(JNIEnv* env); |
484 | 485 |
485 } // namespace content | 486 } // namespace content |
486 | 487 |
487 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 488 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |