| 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" |
| 11 #include "base/android/jni_weak_ref.h" | 11 #include "base/android/jni_weak_ref.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/process/process.h" | 15 #include "base/process/process.h" |
| 16 #include "content/browser/android/overscroll_refresh.h" |
| 16 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 17 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 17 #include "content/browser/web_contents/web_contents_impl.h" | 18 #include "content/browser/web_contents/web_contents_impl.h" |
| 18 #include "content/public/browser/android/content_view_core.h" | 19 #include "content/public/browser/android/content_view_core.h" |
| 19 #include "content/public/browser/web_contents_observer.h" | 20 #include "content/public/browser/web_contents_observer.h" |
| 20 #include "third_party/WebKit/public/web/WebInputEvent.h" | 21 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 21 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
| 22 #include "ui/gfx/geometry/rect_f.h" | 23 #include "ui/gfx/geometry/rect_f.h" |
| 23 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 24 | 25 |
| 25 namespace ui { | 26 namespace ui { |
| 26 class ViewAndroid; | 27 class ViewAndroid; |
| 27 class WindowAndroid; | 28 class WindowAndroid; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace content { | 31 namespace content { |
| 31 | 32 |
| 32 class GinJavaBridgeDispatcherHost; | 33 class GinJavaBridgeDispatcherHost; |
| 33 class RenderFrameHost; | 34 class RenderFrameHost; |
| 34 class RenderWidgetHostViewAndroid; | 35 class RenderWidgetHostViewAndroid; |
| 35 struct MenuItem; | 36 struct MenuItem; |
| 36 | 37 |
| 37 class ContentViewCoreImpl : public ContentViewCore, | 38 class ContentViewCoreImpl : public ContentViewCore, |
| 39 public OverscrollRefreshHandler, |
| 38 public WebContentsObserver { | 40 public WebContentsObserver { |
| 39 public: | 41 public: |
| 40 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); | 42 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); |
| 41 ContentViewCoreImpl(JNIEnv* env, | 43 ContentViewCoreImpl(JNIEnv* env, |
| 42 jobject obj, | 44 jobject obj, |
| 43 WebContents* web_contents, | 45 WebContents* web_contents, |
| 44 jobject view_android, | 46 jobject view_android, |
| 45 ui::WindowAndroid* window_android, | 47 ui::WindowAndroid* window_android, |
| 46 jobject java_bridge_retained_object_set); | 48 jobject java_bridge_retained_object_set); |
| 47 | 49 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 300 |
| 299 friend class ContentViewUserData; | 301 friend class ContentViewUserData; |
| 300 ~ContentViewCoreImpl() override; | 302 ~ContentViewCoreImpl() override; |
| 301 | 303 |
| 302 // WebContentsObserver implementation. | 304 // WebContentsObserver implementation. |
| 303 void RenderViewReady() override; | 305 void RenderViewReady() override; |
| 304 void RenderViewHostChanged(RenderViewHost* old_host, | 306 void RenderViewHostChanged(RenderViewHost* old_host, |
| 305 RenderViewHost* new_host) override; | 307 RenderViewHost* new_host) override; |
| 306 void WebContentsDestroyed() override; | 308 void WebContentsDestroyed() override; |
| 307 | 309 |
| 310 // OverscrollRefreshHandler implementation. |
| 311 bool PullStart() override; |
| 312 void PullUpdate(float delta) override; |
| 313 void PullRelease(bool allow_refresh) override; |
| 314 void PullReset() override; |
| 315 |
| 308 // -------------------------------------------------------------------------- | 316 // -------------------------------------------------------------------------- |
| 309 // Other private methods and data | 317 // Other private methods and data |
| 310 // -------------------------------------------------------------------------- | 318 // -------------------------------------------------------------------------- |
| 311 | 319 |
| 312 void InitWebContents(); | 320 void InitWebContents(); |
| 313 | 321 |
| 314 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; | 322 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; |
| 315 | 323 |
| 316 blink::WebGestureEvent MakeGestureEvent( | 324 blink::WebGestureEvent MakeGestureEvent( |
| 317 blink::WebInputEvent::Type type, int64 time_ms, float x, float y) const; | 325 blink::WebInputEvent::Type type, int64 time_ms, float x, float y) const; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; | 367 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; |
| 360 | 368 |
| 361 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 369 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 362 }; | 370 }; |
| 363 | 371 |
| 364 bool RegisterContentViewCore(JNIEnv* env); | 372 bool RegisterContentViewCore(JNIEnv* env); |
| 365 | 373 |
| 366 } // namespace content | 374 } // namespace content |
| 367 | 375 |
| 368 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 376 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |