| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/android/jni_android.h" | 13 #include "base/android/jni_android.h" |
| 14 #include "base/android/jni_weak_ref.h" | 14 #include "base/android/jni_weak_ref.h" |
| 15 #include "base/android/scoped_java_ref.h" | 15 #include "base/android/scoped_java_ref.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/i18n/rtl.h" | 17 #include "base/i18n/rtl.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/process/process.h" | 19 #include "base/process/process.h" |
| 20 #include "content/browser/android/content_view_core_impl_observer.h" | 20 #include "content/browser/android/content_view_core_impl_observer.h" |
| 21 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 21 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 22 #include "content/browser/web_contents/web_contents_impl.h" | 22 #include "content/browser/web_contents/web_contents_impl.h" |
| 23 #include "content/public/browser/android/content_view_core.h" | 23 #include "content/public/browser/android/content_view_core.h" |
| 24 #include "content/public/browser/web_contents_observer.h" | 24 #include "content/public/browser/web_contents_observer.h" |
| 25 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 25 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| 26 #include "ui/android/overscroll_refresh.h" | |
| 27 #include "ui/android/view_android.h" | 26 #include "ui/android/view_android.h" |
| 28 #include "ui/gfx/geometry/rect.h" | 27 #include "ui/gfx/geometry/rect.h" |
| 29 #include "ui/gfx/geometry/rect_f.h" | 28 #include "ui/gfx/geometry/rect_f.h" |
| 30 #include "ui/gfx/selection_bound.h" | 29 #include "ui/gfx/selection_bound.h" |
| 31 #include "url/gurl.h" | 30 #include "url/gurl.h" |
| 32 | 31 |
| 33 namespace ui { | 32 namespace ui { |
| 34 class WindowAndroid; | 33 class WindowAndroid; |
| 35 } | 34 } |
| 36 | 35 |
| 37 namespace content { | 36 namespace content { |
| 38 | 37 |
| 39 class GinJavaBridgeDispatcherHost; | 38 class GinJavaBridgeDispatcherHost; |
| 40 class RenderFrameHost; | 39 class RenderFrameHost; |
| 41 class RenderWidgetHostViewAndroid; | 40 class RenderWidgetHostViewAndroid; |
| 42 struct MenuItem; | 41 struct MenuItem; |
| 43 | 42 |
| 44 class ContentViewCoreImpl : public ContentViewCore, | 43 class ContentViewCoreImpl : public ContentViewCore, |
| 45 public ui::OverscrollRefreshHandler, | |
| 46 public WebContentsObserver { | 44 public WebContentsObserver { |
| 47 public: | 45 public: |
| 48 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); | 46 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); |
| 49 ContentViewCoreImpl( | 47 ContentViewCoreImpl( |
| 50 JNIEnv* env, | 48 JNIEnv* env, |
| 51 const base::android::JavaRef<jobject>& obj, | 49 const base::android::JavaRef<jobject>& obj, |
| 52 WebContents* web_contents, | 50 WebContents* web_contents, |
| 53 float dpi_scale, | 51 float dpi_scale, |
| 54 const base::android::JavaRef<jobject>& java_bridge_retained_object_set); | 52 const base::android::JavaRef<jobject>& java_bridge_retained_object_set); |
| 55 | 53 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 398 |
| 401 friend class ContentViewUserData; | 399 friend class ContentViewUserData; |
| 402 ~ContentViewCoreImpl() override; | 400 ~ContentViewCoreImpl() override; |
| 403 | 401 |
| 404 // WebContentsObserver implementation. | 402 // WebContentsObserver implementation. |
| 405 void RenderViewReady() override; | 403 void RenderViewReady() override; |
| 406 void RenderViewHostChanged(RenderViewHost* old_host, | 404 void RenderViewHostChanged(RenderViewHost* old_host, |
| 407 RenderViewHost* new_host) override; | 405 RenderViewHost* new_host) override; |
| 408 void WebContentsDestroyed() override; | 406 void WebContentsDestroyed() override; |
| 409 | 407 |
| 410 // OverscrollRefreshHandler implementation. | |
| 411 bool PullStart() override; | |
| 412 void PullUpdate(float delta) override; | |
| 413 void PullRelease(bool allow_refresh) override; | |
| 414 void PullReset() override; | |
| 415 | |
| 416 // -------------------------------------------------------------------------- | 408 // -------------------------------------------------------------------------- |
| 417 // Other private methods and data | 409 // Other private methods and data |
| 418 // -------------------------------------------------------------------------- | 410 // -------------------------------------------------------------------------- |
| 419 | 411 |
| 420 void InitWebContents(); | 412 void InitWebContents(); |
| 421 void SendScreenRectsAndResizeWidget(); | 413 void SendScreenRectsAndResizeWidget(); |
| 422 | 414 |
| 423 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; | 415 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; |
| 424 | 416 |
| 425 blink::WebGestureEvent MakeGestureEvent(blink::WebInputEvent::Type type, | 417 blink::WebGestureEvent MakeGestureEvent(blink::WebInputEvent::Type type, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; | 462 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; |
| 471 | 463 |
| 472 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 464 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 473 }; | 465 }; |
| 474 | 466 |
| 475 bool RegisterContentViewCore(JNIEnv* env); | 467 bool RegisterContentViewCore(JNIEnv* env); |
| 476 | 468 |
| 477 } // namespace content | 469 } // namespace content |
| 478 | 470 |
| 479 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 471 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |