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_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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 struct WebMenuItem; | 27 struct WebMenuItem; |
28 | 28 |
29 namespace ui { | 29 namespace ui { |
30 class ViewAndroid; | 30 class ViewAndroid; |
31 class WindowAndroid; | 31 class WindowAndroid; |
32 } | 32 } |
33 | 33 |
34 namespace content { | 34 namespace content { |
35 class RenderWidgetHostViewAndroid; | 35 class RenderWidgetHostViewAndroid; |
36 class SyncInputEventFilter; | 36 class SynchronousInputEventFilter; |
37 | 37 |
38 // TODO(jrg): this is a shell. Upstream the rest. | 38 // TODO(jrg): this is a shell. Upstream the rest. |
39 class ContentViewCoreImpl : public ContentViewCore, | 39 class ContentViewCoreImpl : public ContentViewCore, |
40 public NotificationObserver { | 40 public NotificationObserver { |
41 public: | 41 public: |
42 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); | 42 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); |
43 ContentViewCoreImpl(JNIEnv* env, | 43 ContentViewCoreImpl(JNIEnv* env, |
44 jobject obj, | 44 jobject obj, |
45 bool hardware_accelerated, | 45 bool hardware_accelerated, |
46 WebContents* web_contents, | 46 WebContents* web_contents, |
47 ui::ViewAndroid* view_android, | 47 ui::ViewAndroid* view_android, |
48 ui::WindowAndroid* window_android); | 48 ui::WindowAndroid* window_android); |
49 | 49 |
50 // ContentViewCore implementation. | 50 // ContentViewCore implementation. |
51 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; | 51 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; |
52 virtual WebContents* GetWebContents() const OVERRIDE; | 52 virtual WebContents* GetWebContents() const OVERRIDE; |
53 virtual ui::ViewAndroid* GetViewAndroid() const OVERRIDE; | 53 virtual ui::ViewAndroid* GetViewAndroid() const OVERRIDE; |
54 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; | 54 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; |
55 virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE; | 55 virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE; |
56 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; | 56 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; |
57 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; | 57 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; |
58 virtual void ShowPastePopup(int x, int y) OVERRIDE; | 58 virtual void ShowPastePopup(int x, int y) OVERRIDE; |
59 virtual unsigned int GetScaledContentTexture( | 59 virtual unsigned int GetScaledContentTexture( |
60 float scale, | 60 float scale, |
61 gfx::Size* out_size) OVERRIDE; | 61 gfx::Size* out_size) OVERRIDE; |
62 virtual float GetDpiScale() const OVERRIDE; | 62 virtual float GetDpiScale() const OVERRIDE; |
63 virtual void RequestContentClipping(const gfx::Rect& clipping, | 63 virtual void RequestContentClipping(const gfx::Rect& clipping, |
64 const gfx::Size& content_size) OVERRIDE; | 64 const gfx::Size& content_size) OVERRIDE; |
| 65 virtual void SetInputEventFilter( |
| 66 SynchronousInputEventFilter* input_event_filter) OVERRIDE; |
65 virtual void AddFrameInfoCallback( | 67 virtual void AddFrameInfoCallback( |
66 const UpdateFrameInfoCallback& callback) OVERRIDE; | 68 const UpdateFrameInfoCallback& callback) OVERRIDE; |
67 virtual void RemoveFrameInfoCallback( | 69 virtual void RemoveFrameInfoCallback( |
68 const UpdateFrameInfoCallback& callback) OVERRIDE; | 70 const UpdateFrameInfoCallback& callback) OVERRIDE; |
69 | 71 |
70 // -------------------------------------------------------------------------- | 72 // -------------------------------------------------------------------------- |
71 // Methods called from Java via JNI | 73 // Methods called from Java via JNI |
72 // -------------------------------------------------------------------------- | 74 // -------------------------------------------------------------------------- |
73 | 75 |
74 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); | 76 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // The Android view that can be used to add and remove decoration layers | 357 // The Android view that can be used to add and remove decoration layers |
356 // like AutofillPopup. | 358 // like AutofillPopup. |
357 ui::ViewAndroid* view_android_; | 359 ui::ViewAndroid* view_android_; |
358 | 360 |
359 // The owning window that has a hold of main application activity. | 361 // The owning window that has a hold of main application activity. |
360 ui::WindowAndroid* window_android_; | 362 ui::WindowAndroid* window_android_; |
361 | 363 |
362 std::vector<UpdateFrameInfoCallback> update_frame_info_callbacks_; | 364 std::vector<UpdateFrameInfoCallback> update_frame_info_callbacks_; |
363 | 365 |
364 // Optional browser-side input event filtering. | 366 // Optional browser-side input event filtering. |
365 scoped_ptr<SyncInputEventFilter> input_event_filter_; | 367 SynchronousInputEventFilter* input_event_filter_; |
366 | 368 |
367 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 369 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
368 }; | 370 }; |
369 | 371 |
370 bool RegisterContentViewCore(JNIEnv* env); | 372 bool RegisterContentViewCore(JNIEnv* env); |
371 | 373 |
372 } // namespace content | 374 } // namespace content |
373 | 375 |
374 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 376 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |