| 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_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.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/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
| 17 #include "cc/layers/delegated_frame_resource_collection.h" | 17 #include "cc/layers/delegated_frame_resource_collection.h" |
| 18 #include "cc/layers/delegated_renderer_layer_client.h" | 18 #include "cc/layers/delegated_renderer_layer_client.h" |
| 19 #include "cc/layers/texture_layer_client.h" | 19 #include "cc/layers/texture_layer_client.h" |
| 20 #include "cc/output/begin_frame_args.h" | 20 #include "cc/output/begin_frame_args.h" |
| 21 #include "content/browser/accessibility/browser_accessibility_manager.h" | 21 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 22 #include "content/browser/renderer_host/image_transport_factory_android.h" | 22 #include "content/browser/renderer_host/image_transport_factory_android.h" |
| 23 #include "content/browser/renderer_host/ime_adapter_android.h" | 23 #include "content/browser/renderer_host/ime_adapter_android.h" |
| 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 25 #include "gpu/command_buffer/common/mailbox.h" | 25 #include "gpu/command_buffer/common/mailbox.h" |
| 26 #include "third_party/skia/include/core/SkColor.h" | 26 #include "third_party/skia/include/core/SkColor.h" |
| 27 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 27 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 28 #include "ui/base/android/window_android_observer.h" |
| 28 #include "ui/gfx/size.h" | 29 #include "ui/gfx/size.h" |
| 29 #include "ui/gfx/vector2d_f.h" | 30 #include "ui/gfx/vector2d_f.h" |
| 30 | 31 |
| 31 struct ViewHostMsg_TextInputState_Params; | 32 struct ViewHostMsg_TextInputState_Params; |
| 32 | 33 |
| 33 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 34 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
| 34 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; | 35 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; |
| 35 | 36 |
| 36 namespace cc { | 37 namespace cc { |
| 37 class CopyOutputResult; | 38 class CopyOutputResult; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 54 class RenderWidgetHost; | 55 class RenderWidgetHost; |
| 55 class RenderWidgetHostImpl; | 56 class RenderWidgetHostImpl; |
| 56 struct NativeWebKeyboardEvent; | 57 struct NativeWebKeyboardEvent; |
| 57 | 58 |
| 58 // ----------------------------------------------------------------------------- | 59 // ----------------------------------------------------------------------------- |
| 59 // See comments in render_widget_host_view.h about this class and its members. | 60 // See comments in render_widget_host_view.h about this class and its members. |
| 60 // ----------------------------------------------------------------------------- | 61 // ----------------------------------------------------------------------------- |
| 61 class RenderWidgetHostViewAndroid | 62 class RenderWidgetHostViewAndroid |
| 62 : public RenderWidgetHostViewBase, | 63 : public RenderWidgetHostViewBase, |
| 63 public BrowserAccessibilityDelegate, | 64 public BrowserAccessibilityDelegate, |
| 64 public cc::TextureLayerClient, | |
| 65 public cc::DelegatedRendererLayerClient, | |
| 66 public cc::DelegatedFrameResourceCollectionClient, | 65 public cc::DelegatedFrameResourceCollectionClient, |
| 67 public ImageTransportFactoryAndroidObserver { | 66 public ImageTransportFactoryAndroidObserver, |
| 67 public ui::WindowAndroidObserver { |
| 68 public: | 68 public: |
| 69 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, | 69 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, |
| 70 ContentViewCoreImpl* content_view_core); | 70 ContentViewCoreImpl* content_view_core); |
| 71 virtual ~RenderWidgetHostViewAndroid(); | 71 virtual ~RenderWidgetHostViewAndroid(); |
| 72 | 72 |
| 73 // RenderWidgetHostView implementation. | 73 // RenderWidgetHostView implementation. |
| 74 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 74 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 75 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; | 75 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; |
| 76 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 76 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
| 77 const gfx::Rect& pos) OVERRIDE; | 77 const gfx::Rect& pos) OVERRIDE; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; | 179 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; |
| 180 virtual void AccessibilityScrollToMakeVisible( | 180 virtual void AccessibilityScrollToMakeVisible( |
| 181 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; | 181 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; |
| 182 virtual void AccessibilityScrollToPoint( | 182 virtual void AccessibilityScrollToPoint( |
| 183 int acc_obj_id, gfx::Point point) OVERRIDE; | 183 int acc_obj_id, gfx::Point point) OVERRIDE; |
| 184 virtual void AccessibilitySetTextSelection( | 184 virtual void AccessibilitySetTextSelection( |
| 185 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; | 185 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; |
| 186 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE; | 186 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE; |
| 187 virtual void FatalAccessibilityTreeError() OVERRIDE; | 187 virtual void FatalAccessibilityTreeError() OVERRIDE; |
| 188 | 188 |
| 189 // cc::TextureLayerClient implementation. | |
| 190 virtual unsigned PrepareTexture() OVERRIDE; | |
| 191 virtual bool PrepareTextureMailbox( | |
| 192 cc::TextureMailbox* mailbox, | |
| 193 scoped_ptr<cc::SingleReleaseCallback>* release_callback, | |
| 194 bool use_shared_memory) OVERRIDE; | |
| 195 | |
| 196 // cc::DelegatedRendererLayerClient implementation. | |
| 197 virtual void DidCommitFrameData() OVERRIDE; | |
| 198 | |
| 199 // cc::DelegatedFrameResourceCollectionClient implementation. | 189 // cc::DelegatedFrameResourceCollectionClient implementation. |
| 200 virtual void UnusedResourcesAreAvailable() OVERRIDE; | 190 virtual void UnusedResourcesAreAvailable() OVERRIDE; |
| 201 | 191 |
| 192 // ui::WindowAndroidObserver implementation. |
| 193 virtual void OnCompositingDidCommit() OVERRIDE; |
| 194 virtual void OnAttachCompositor() OVERRIDE {} |
| 195 virtual void OnDetachCompositor() OVERRIDE; |
| 196 |
| 202 // ImageTransportFactoryAndroidObserver implementation. | 197 // ImageTransportFactoryAndroidObserver implementation. |
| 203 virtual void OnLostResources() OVERRIDE; | 198 virtual void OnLostResources() OVERRIDE; |
| 204 | 199 |
| 205 // Non-virtual methods | 200 // Non-virtual methods |
| 206 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 201 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
| 207 SkColor GetCachedBackgroundColor() const; | 202 SkColor GetCachedBackgroundColor() const; |
| 208 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 203 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
| 209 void SendTouchEvent(const blink::WebTouchEvent& event); | 204 void SendTouchEvent(const blink::WebTouchEvent& event); |
| 210 void SendMouseEvent(const blink::WebMouseEvent& event); | 205 void SendMouseEvent(const blink::WebMouseEvent& event); |
| 211 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 206 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 bool overscroll_effect_enabled_; | 327 bool overscroll_effect_enabled_; |
| 333 scoped_ptr<OverscrollGlow> overscroll_effect_; | 328 scoped_ptr<OverscrollGlow> overscroll_effect_; |
| 334 | 329 |
| 335 bool flush_input_requested_; | 330 bool flush_input_requested_; |
| 336 | 331 |
| 337 int accelerated_surface_route_id_; | 332 int accelerated_surface_route_id_; |
| 338 | 333 |
| 339 // Size to use if we have no backing ContentViewCore | 334 // Size to use if we have no backing ContentViewCore |
| 340 gfx::Size default_size_; | 335 gfx::Size default_size_; |
| 341 | 336 |
| 337 const bool using_synchronous_compositor_; |
| 338 |
| 342 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 339 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 343 }; | 340 }; |
| 344 | 341 |
| 345 } // namespace content | 342 } // namespace content |
| 346 | 343 |
| 347 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 344 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |