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