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_helper.h" | 10 #include "base/android/jni_helper.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.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.h" | 15 #include "base/process.h" |
16 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 16 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
17 #include "content/browser/web_contents/web_contents_impl.h" | 17 #include "content/browser/web_contents/web_contents_impl.h" |
18 #include "content/public/browser/android/content_view_core.h" | 18 #include "content/public/browser/android/content_view_core.h" |
19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
23 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
24 | 24 |
25 struct WebMenuItem; | 25 struct WebMenuItem; |
26 | 26 |
27 namespace ui { | 27 namespace ui { |
| 28 class ViewAndroid; |
28 class WindowAndroid; | 29 class WindowAndroid; |
29 } | 30 } |
30 | 31 |
31 namespace content { | 32 namespace content { |
32 class RenderWidgetHostViewAndroid; | 33 class RenderWidgetHostViewAndroid; |
33 class SyncInputEventFilter; | 34 class SyncInputEventFilter; |
34 | 35 |
35 // TODO(jrg): this is a shell. Upstream the rest. | 36 // TODO(jrg): this is a shell. Upstream the rest. |
36 class ContentViewCoreImpl : public ContentViewCore, | 37 class ContentViewCoreImpl : public ContentViewCore, |
37 public NotificationObserver { | 38 public NotificationObserver { |
38 public: | 39 public: |
39 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); | 40 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); |
40 ContentViewCoreImpl(JNIEnv* env, | 41 ContentViewCoreImpl(JNIEnv* env, |
41 jobject obj, | 42 jobject obj, |
42 bool hardware_accelerated, | 43 bool hardware_accelerated, |
43 bool input_events_delivered_at_vsync, | 44 bool input_events_delivered_at_vsync, |
44 WebContents* web_contents, | 45 WebContents* web_contents, |
| 46 ui::ViewAndroid* view_android, |
45 ui::WindowAndroid* window_android); | 47 ui::WindowAndroid* window_android); |
46 | 48 |
47 // ContentViewCore implementation. | 49 // ContentViewCore implementation. |
48 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; | 50 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; |
49 virtual base::android::ScopedJavaLocalRef<jobject> GetContainerViewDelegate() | |
50 OVERRIDE; | |
51 virtual WebContents* GetWebContents() const OVERRIDE; | 51 virtual WebContents* GetWebContents() const OVERRIDE; |
| 52 virtual ui::ViewAndroid* GetViewAndroid() const OVERRIDE; |
52 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; | 53 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; |
53 virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE; | 54 virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE; |
54 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; | 55 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; |
55 virtual void OnWebPreferencesUpdated() OVERRIDE; | 56 virtual void OnWebPreferencesUpdated() OVERRIDE; |
56 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; | 57 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; |
57 virtual void ShowPastePopup(int x, int y) OVERRIDE; | 58 virtual void ShowPastePopup(int x, int y) OVERRIDE; |
58 virtual unsigned int GetScaledContentTexture( | 59 virtual unsigned int GetScaledContentTexture( |
59 float scale, | 60 float scale, |
60 gfx::Size* out_size) OVERRIDE; | 61 gfx::Size* out_size) OVERRIDE; |
61 virtual float GetDpiScale() const OVERRIDE; | 62 virtual float GetDpiScale() const OVERRIDE; |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // Whether input events will be consistently delivered at vsync time. | 339 // Whether input events will be consistently delivered at vsync time. |
339 bool input_events_delivered_at_vsync_; | 340 bool input_events_delivered_at_vsync_; |
340 | 341 |
341 // Whether a new frame from the renderer is waiting to be displayed by the | 342 // Whether a new frame from the renderer is waiting to be displayed by the |
342 // browser compositor. | 343 // browser compositor. |
343 bool renderer_frame_pending_; | 344 bool renderer_frame_pending_; |
344 | 345 |
345 // Device scale factor. | 346 // Device scale factor. |
346 float dpi_scale_; | 347 float dpi_scale_; |
347 | 348 |
| 349 // The Android view that can be used to add and remove decoration layers |
| 350 // like AutofillPopup. |
| 351 ui::ViewAndroid* view_android_; |
| 352 |
348 // The owning window that has a hold of main application activity. | 353 // The owning window that has a hold of main application activity. |
349 ui::WindowAndroid* window_android_; | 354 ui::WindowAndroid* window_android_; |
350 | 355 |
351 std::vector<UpdateFrameInfoCallback> update_frame_info_callbacks_; | 356 std::vector<UpdateFrameInfoCallback> update_frame_info_callbacks_; |
352 | 357 |
353 // Optional browser-side input event filtering. | 358 // Optional browser-side input event filtering. |
354 scoped_ptr<SyncInputEventFilter> input_event_filter_; | 359 scoped_ptr<SyncInputEventFilter> input_event_filter_; |
355 | 360 |
356 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 361 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
357 }; | 362 }; |
358 | 363 |
359 bool RegisterContentViewCore(JNIEnv* env); | 364 bool RegisterContentViewCore(JNIEnv* env); |
360 | 365 |
361 } // namespace content | 366 } // namespace content |
362 | 367 |
363 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 368 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |