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