| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 class ContentViewCoreImpl : public ContentViewCore, | 48 class ContentViewCoreImpl : public ContentViewCore, |
| 49 public ui::OverscrollRefreshHandler, | 49 public ui::OverscrollRefreshHandler, |
| 50 public WebContentsObserver { | 50 public WebContentsObserver { |
| 51 public: | 51 public: |
| 52 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); | 52 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); |
| 53 ContentViewCoreImpl( | 53 ContentViewCoreImpl( |
| 54 JNIEnv* env, | 54 JNIEnv* env, |
| 55 const base::android::JavaRef<jobject>& obj, | 55 const base::android::JavaRef<jobject>& obj, |
| 56 WebContents* web_contents, | 56 WebContents* web_contents, |
| 57 const base::android::JavaRef<jobject>& view_android_delegate, | |
| 58 ui::WindowAndroid* window_android, | |
| 59 const base::android::JavaRef<jobject>& java_bridge_retained_object_set); | 57 const base::android::JavaRef<jobject>& java_bridge_retained_object_set); |
| 60 | 58 |
| 61 // ContentViewCore implementation. | 59 // ContentViewCore implementation. |
| 62 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; | 60 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; |
| 63 WebContents* GetWebContents() const override; | 61 WebContents* GetWebContents() const override; |
| 64 ui::WindowAndroid* GetWindowAndroid() const override; | 62 ui::WindowAndroid* GetWindowAndroid() const override; |
| 65 void ShowPastePopup(int x, int y) override; | 63 void ShowPastePopup(int x, int y) override; |
| 66 | 64 |
| 67 void AddObserver(ContentViewCoreImplObserver* observer); | 65 void AddObserver(ContentViewCoreImplObserver* observer); |
| 68 void RemoveObserver(ContentViewCoreImplObserver* observer); | 66 void RemoveObserver(ContentViewCoreImplObserver* observer); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 float GetTopControlsHeightDip() const; | 380 float GetTopControlsHeightDip() const; |
| 383 float GetBottomControlsHeightDip() const; | 381 float GetBottomControlsHeightDip() const; |
| 384 | 382 |
| 385 void MoveRangeSelectionExtent(const gfx::PointF& extent); | 383 void MoveRangeSelectionExtent(const gfx::PointF& extent); |
| 386 | 384 |
| 387 void SelectBetweenCoordinates(const gfx::PointF& base, | 385 void SelectBetweenCoordinates(const gfx::PointF& base, |
| 388 const gfx::PointF& extent); | 386 const gfx::PointF& extent); |
| 389 | 387 |
| 390 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); | 388 void OnShowUnhandledTapUIIfNeeded(int x_dip, int y_dip); |
| 391 | 389 |
| 392 ui::ViewAndroid* GetViewAndroid(); | 390 ui::ViewAndroid* GetViewAndroid() const; |
| 393 | 391 |
| 394 private: | 392 private: |
| 395 class ContentViewUserData; | 393 class ContentViewUserData; |
| 396 | 394 |
| 397 friend class ContentViewUserData; | 395 friend class ContentViewUserData; |
| 398 ~ContentViewCoreImpl() override; | 396 ~ContentViewCoreImpl() override; |
| 399 | 397 |
| 400 // WebContentsObserver implementation. | 398 // WebContentsObserver implementation. |
| 401 void RenderViewReady() override; | 399 void RenderViewReady() override; |
| 402 void RenderViewHostChanged(RenderViewHost* old_host, | 400 void RenderViewHostChanged(RenderViewHost* old_host, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 void SendOrientationChangeEventInternal(); | 433 void SendOrientationChangeEventInternal(); |
| 436 | 434 |
| 437 float dpi_scale() const { return dpi_scale_; } | 435 float dpi_scale() const { return dpi_scale_; } |
| 438 | 436 |
| 439 // A weak reference to the Java ContentViewCore object. | 437 // A weak reference to the Java ContentViewCore object. |
| 440 JavaObjectWeakGlobalRef java_ref_; | 438 JavaObjectWeakGlobalRef java_ref_; |
| 441 | 439 |
| 442 // Select popup view | 440 // Select popup view |
| 443 ui::ViewAndroid::ScopedAnchorView select_popup_; | 441 ui::ViewAndroid::ScopedAnchorView select_popup_; |
| 444 | 442 |
| 445 ui::ViewAndroid view_; | |
| 446 | |
| 447 // Reference to the current WebContents used to determine how and what to | 443 // Reference to the current WebContents used to determine how and what to |
| 448 // display in the ContentViewCore. | 444 // display in the ContentViewCore. |
| 449 WebContentsImpl* web_contents_; | 445 WebContentsImpl* web_contents_; |
| 450 | 446 |
| 451 // Page scale factor. | 447 // Page scale factor. |
| 452 float page_scale_; | 448 float page_scale_; |
| 453 | 449 |
| 454 // Device scale factor. | 450 // Device scale factor. |
| 455 const float dpi_scale_; | 451 const float dpi_scale_; |
| 456 | 452 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 467 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; | 463 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; |
| 468 | 464 |
| 469 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 465 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 470 }; | 466 }; |
| 471 | 467 |
| 472 bool RegisterContentViewCore(JNIEnv* env); | 468 bool RegisterContentViewCore(JNIEnv* env); |
| 473 | 469 |
| 474 } // namespace content | 470 } // namespace content |
| 475 | 471 |
| 476 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 472 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |