| 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/compositor_observer.h" |
| 22 #include "content/browser/renderer_host/image_transport_factory_android.h" | 23 #include "content/browser/renderer_host/image_transport_factory_android.h" |
| 23 #include "content/browser/renderer_host/ime_adapter_android.h" | 24 #include "content/browser/renderer_host/ime_adapter_android.h" |
| 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 25 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 25 #include "gpu/command_buffer/common/mailbox.h" | 26 #include "gpu/command_buffer/common/mailbox.h" |
| 26 #include "third_party/skia/include/core/SkColor.h" | 27 #include "third_party/skia/include/core/SkColor.h" |
| 27 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.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; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 42 class TextureLayer; | 43 class TextureLayer; |
| 43 } | 44 } |
| 44 | 45 |
| 45 namespace WebKit { | 46 namespace WebKit { |
| 46 class WebExternalTextureLayer; | 47 class WebExternalTextureLayer; |
| 47 class WebTouchEvent; | 48 class WebTouchEvent; |
| 48 class WebMouseEvent; | 49 class WebMouseEvent; |
| 49 } | 50 } |
| 50 | 51 |
| 51 namespace content { | 52 namespace content { |
| 53 class Compositor; |
| 52 class ContentViewCoreImpl; | 54 class ContentViewCoreImpl; |
| 53 class OverscrollGlow; | 55 class OverscrollGlow; |
| 54 class RenderWidgetHost; | 56 class RenderWidgetHost; |
| 55 class RenderWidgetHostImpl; | 57 class RenderWidgetHostImpl; |
| 56 struct NativeWebKeyboardEvent; | 58 struct NativeWebKeyboardEvent; |
| 57 | 59 |
| 58 // ----------------------------------------------------------------------------- | 60 // ----------------------------------------------------------------------------- |
| 59 // See comments in render_widget_host_view.h about this class and its members. | 61 // See comments in render_widget_host_view.h about this class and its members. |
| 60 // ----------------------------------------------------------------------------- | 62 // ----------------------------------------------------------------------------- |
| 61 class RenderWidgetHostViewAndroid | 63 class RenderWidgetHostViewAndroid |
| 62 : public RenderWidgetHostViewBase, | 64 : public RenderWidgetHostViewBase, |
| 63 public BrowserAccessibilityDelegate, | 65 public BrowserAccessibilityDelegate, |
| 64 public cc::TextureLayerClient, | |
| 65 public cc::DelegatedRendererLayerClient, | |
| 66 public cc::DelegatedFrameResourceCollectionClient, | 66 public cc::DelegatedFrameResourceCollectionClient, |
| 67 public CompositorObserver, |
| 67 public ImageTransportFactoryAndroidObserver { | 68 public ImageTransportFactoryAndroidObserver { |
| 68 public: | 69 public: |
| 69 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, | 70 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, |
| 70 ContentViewCoreImpl* content_view_core); | 71 ContentViewCoreImpl* content_view_core); |
| 71 virtual ~RenderWidgetHostViewAndroid(); | 72 virtual ~RenderWidgetHostViewAndroid(); |
| 72 | 73 |
| 73 // RenderWidgetHostView implementation. | 74 // RenderWidgetHostView implementation. |
| 74 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 75 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 75 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; | 76 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; |
| 76 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 77 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; | 182 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; |
| 182 virtual void AccessibilityScrollToMakeVisible( | 183 virtual void AccessibilityScrollToMakeVisible( |
| 183 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; | 184 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; |
| 184 virtual void AccessibilityScrollToPoint( | 185 virtual void AccessibilityScrollToPoint( |
| 185 int acc_obj_id, gfx::Point point) OVERRIDE; | 186 int acc_obj_id, gfx::Point point) OVERRIDE; |
| 186 virtual void AccessibilitySetTextSelection( | 187 virtual void AccessibilitySetTextSelection( |
| 187 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; | 188 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; |
| 188 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE; | 189 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE; |
| 189 virtual void FatalAccessibilityTreeError() OVERRIDE; | 190 virtual void FatalAccessibilityTreeError() OVERRIDE; |
| 190 | 191 |
| 191 // cc::TextureLayerClient implementation. | |
| 192 virtual unsigned PrepareTexture() OVERRIDE; | |
| 193 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; | |
| 194 virtual bool PrepareTextureMailbox( | |
| 195 cc::TextureMailbox* mailbox, | |
| 196 scoped_ptr<cc::SingleReleaseCallback>* release_callback, | |
| 197 bool use_shared_memory) OVERRIDE; | |
| 198 | |
| 199 // cc::DelegatedRendererLayerClient implementation. | |
| 200 virtual void DidCommitFrameData() OVERRIDE; | |
| 201 | |
| 202 // cc::DelegatedFrameResourceCollectionClient implementation. | 192 // cc::DelegatedFrameResourceCollectionClient implementation. |
| 203 virtual void UnusedResourcesAreAvailable() OVERRIDE; | 193 virtual void UnusedResourcesAreAvailable() OVERRIDE; |
| 204 | 194 |
| 195 // content::CompositorObserver implementation. |
| 196 virtual void OnCompositingDidCommit(Compositor* compositor) OVERRIDE; |
| 197 |
| 205 // ImageTransportFactoryAndroidObserver implementation. | 198 // ImageTransportFactoryAndroidObserver implementation. |
| 206 virtual void OnLostResources() OVERRIDE; | 199 virtual void OnLostResources() OVERRIDE; |
| 207 | 200 |
| 208 // Non-virtual methods | 201 // Non-virtual methods |
| 209 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 202 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
| 203 void SetCompositor(Compositor* compositor); |
| 210 SkColor GetCachedBackgroundColor() const; | 204 SkColor GetCachedBackgroundColor() const; |
| 211 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 205 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
| 212 void SendTouchEvent(const WebKit::WebTouchEvent& event); | 206 void SendTouchEvent(const WebKit::WebTouchEvent& event); |
| 213 void SendMouseEvent(const WebKit::WebMouseEvent& event); | 207 void SendMouseEvent(const WebKit::WebMouseEvent& event); |
| 214 void SendMouseWheelEvent(const WebKit::WebMouseWheelEvent& event); | 208 void SendMouseWheelEvent(const WebKit::WebMouseWheelEvent& event); |
| 215 void SendGestureEvent(const WebKit::WebGestureEvent& event); | 209 void SendGestureEvent(const WebKit::WebGestureEvent& event); |
| 216 void SendBeginFrame(const cc::BeginFrameArgs& args); | 210 void SendBeginFrame(const cc::BeginFrameArgs& args); |
| 217 | 211 |
| 218 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); | 212 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); |
| 219 void OnDidChangeBodyBackgroundColor(SkColor color); | 213 void OnDidChangeBodyBackgroundColor(SkColor color); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 322 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
| 329 | 323 |
| 330 std::queue<base::Closure> ack_callbacks_; | 324 std::queue<base::Closure> ack_callbacks_; |
| 331 | 325 |
| 332 // Used to render overscroll overlays. | 326 // Used to render overscroll overlays. |
| 333 bool overscroll_effect_enabled_; | 327 bool overscroll_effect_enabled_; |
| 334 scoped_ptr<OverscrollGlow> overscroll_effect_; | 328 scoped_ptr<OverscrollGlow> overscroll_effect_; |
| 335 | 329 |
| 336 bool flush_input_requested_; | 330 bool flush_input_requested_; |
| 337 | 331 |
| 332 Compositor* compositor_; |
| 333 |
| 338 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 334 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 339 }; | 335 }; |
| 340 | 336 |
| 341 } // namespace content | 337 } // namespace content |
| 342 | 338 |
| 343 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 339 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |