OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class SizeF; | 22 class SizeF; |
23 class Vector2dF; | 23 class Vector2dF; |
24 } | 24 } |
25 | 25 |
26 namespace ui { | 26 namespace ui { |
27 class ViewAndroid; | 27 class ViewAndroid; |
28 class WindowAndroid; | 28 class WindowAndroid; |
29 } | 29 } |
30 | 30 |
31 namespace content { | 31 namespace content { |
| 32 class SynchronousInputEventFilter; |
32 class WebContents; | 33 class WebContents; |
33 | 34 |
34 // Native side of the ContentViewCore.java, which is the primary way of | 35 // Native side of the ContentViewCore.java, which is the primary way of |
35 // communicating with the native Chromium code on Android. This is a | 36 // communicating with the native Chromium code on Android. This is a |
36 // public interface used by native code outside of the content module. | 37 // public interface used by native code outside of the content module. |
37 class CONTENT_EXPORT ContentViewCore { | 38 class CONTENT_EXPORT ContentViewCore { |
38 public: | 39 public: |
39 // Returns the existing ContentViewCore for |web_contents|, or NULL. | 40 // Returns the existing ContentViewCore for |web_contents|, or NULL. |
40 static ContentViewCore* FromWebContents(WebContents* web_contents); | 41 static ContentViewCore* FromWebContents(WebContents* web_contents); |
41 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); | 42 static ContentViewCore* GetNativeContentViewCore(JNIEnv* env, jobject obj); |
42 | 43 |
43 virtual WebContents* GetWebContents() const = 0; | 44 virtual WebContents* GetWebContents() const = 0; |
44 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 45 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
45 virtual ui::ViewAndroid* GetViewAndroid() const = 0; | 46 virtual ui::ViewAndroid* GetViewAndroid() const = 0; |
46 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; | 47 virtual ui::WindowAndroid* GetWindowAndroid() const = 0; |
47 virtual scoped_refptr<cc::Layer> GetLayer() const = 0; | 48 virtual scoped_refptr<cc::Layer> GetLayer() const = 0; |
48 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; | 49 virtual void LoadUrl(NavigationController::LoadURLParams& params) = 0; |
49 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; | 50 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) = 0; |
50 virtual void ShowPastePopup(int x, int y) = 0; | 51 virtual void ShowPastePopup(int x, int y) = 0; |
51 virtual unsigned int GetScaledContentTexture( | 52 virtual unsigned int GetScaledContentTexture( |
52 float scale, | 53 float scale, |
53 gfx::Size* out_size) = 0; | 54 gfx::Size* out_size) = 0; |
54 virtual float GetDpiScale() const = 0; | 55 virtual float GetDpiScale() const = 0; |
55 virtual void RequestContentClipping(const gfx::Rect& clipping, | 56 virtual void RequestContentClipping(const gfx::Rect& clipping, |
56 const gfx::Size& content_size) = 0; | 57 const gfx::Size& content_size) = 0; |
| 58 virtual void SetInputEventFilter(SynchronousInputEventFilter* filter) = 0; |
57 | 59 |
58 // Observer callback for frame metadata updates. | 60 // Observer callback for frame metadata updates. |
59 typedef base::Callback<void( | 61 typedef base::Callback<void( |
60 const gfx::SizeF& content_size, | 62 const gfx::SizeF& content_size, |
61 const gfx::Vector2dF& scroll_offset, | 63 const gfx::Vector2dF& scroll_offset, |
62 float page_scale_factor)> UpdateFrameInfoCallback; | 64 float page_scale_factor)> UpdateFrameInfoCallback; |
63 | 65 |
64 virtual void AddFrameInfoCallback( | 66 virtual void AddFrameInfoCallback( |
65 const UpdateFrameInfoCallback& callback) = 0; | 67 const UpdateFrameInfoCallback& callback) = 0; |
66 virtual void RemoveFrameInfoCallback( | 68 virtual void RemoveFrameInfoCallback( |
67 const UpdateFrameInfoCallback& callback) = 0; | 69 const UpdateFrameInfoCallback& callback) = 0; |
68 | 70 |
69 protected: | 71 protected: |
70 virtual ~ContentViewCore() {}; | 72 virtual ~ContentViewCore() {}; |
71 }; | 73 }; |
72 | 74 |
73 }; // namespace content | 75 }; // namespace content |
74 | 76 |
75 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ | 77 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_CORE_H_ |
OLD | NEW |