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