Chromium Code Reviews| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; | 185 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; |
| 186 virtual void AccessibilityScrollToMakeVisible( | 186 virtual void AccessibilityScrollToMakeVisible( |
| 187 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; | 187 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; |
| 188 virtual void AccessibilityScrollToPoint( | 188 virtual void AccessibilityScrollToPoint( |
| 189 int acc_obj_id, gfx::Point point) OVERRIDE; | 189 int acc_obj_id, gfx::Point point) OVERRIDE; |
| 190 virtual void AccessibilitySetTextSelection( | 190 virtual void AccessibilitySetTextSelection( |
| 191 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; | 191 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; |
| 192 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE; | 192 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE; |
| 193 virtual void FatalAccessibilityTreeError() OVERRIDE; | 193 virtual void FatalAccessibilityTreeError() OVERRIDE; |
| 194 | 194 |
| 195 // cc::TextureLayerClient implementation. | |
| 196 virtual unsigned PrepareTexture() OVERRIDE; | |
| 197 virtual bool PrepareTextureMailbox( | |
| 198 cc::TextureMailbox* mailbox, | |
| 199 scoped_ptr<cc::SingleReleaseCallback>* release_callback, | |
| 200 bool use_shared_memory) OVERRIDE; | |
| 201 | |
| 202 // cc::DelegatedRendererLayerClient implementation. | |
| 203 virtual void DidCommitFrameData() OVERRIDE; | |
| 204 | |
| 205 // cc::DelegatedFrameResourceCollectionClient implementation. | 195 // cc::DelegatedFrameResourceCollectionClient implementation. |
| 206 virtual void UnusedResourcesAreAvailable() OVERRIDE; | 196 virtual void UnusedResourcesAreAvailable() OVERRIDE; |
| 207 | 197 |
| 198 // ui::WindowAndroidObserver implementation. | |
| 199 virtual void OnCompositingDidCommit() OVERRIDE; | |
| 200 virtual void OnAttachCompositor() OVERRIDE {} | |
| 201 virtual void OnDetachCompositor() OVERRIDE; | |
| 202 | |
| 208 // ImageTransportFactoryAndroidObserver implementation. | 203 // ImageTransportFactoryAndroidObserver implementation. |
| 209 virtual void OnLostResources() OVERRIDE; | 204 virtual void OnLostResources() OVERRIDE; |
| 210 | 205 |
| 211 // Non-virtual methods | 206 // Non-virtual methods |
| 212 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 207 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
| 213 SkColor GetCachedBackgroundColor() const; | 208 SkColor GetCachedBackgroundColor() const; |
| 214 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 209 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
| 215 void SendTouchEvent(const blink::WebTouchEvent& event); | 210 void SendTouchEvent(const blink::WebTouchEvent& event); |
| 216 void SendMouseEvent(const blink::WebMouseEvent& event); | 211 void SendMouseEvent(const blink::WebMouseEvent& event); |
| 217 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 212 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 bool overscroll_effect_enabled_; | 333 bool overscroll_effect_enabled_; |
| 339 scoped_ptr<OverscrollGlow> overscroll_effect_; | 334 scoped_ptr<OverscrollGlow> overscroll_effect_; |
| 340 | 335 |
| 341 bool flush_input_requested_; | 336 bool flush_input_requested_; |
| 342 | 337 |
| 343 int accelerated_surface_route_id_; | 338 int accelerated_surface_route_id_; |
| 344 | 339 |
| 345 // Size to use if we have no backing ContentViewCore | 340 // Size to use if we have no backing ContentViewCore |
| 346 gfx::Size default_size_; | 341 gfx::Size default_size_; |
| 347 | 342 |
| 343 bool using_synchronous_compositor_; | |
|
boliu
2013/11/16 00:42:56
Can this be const?
powei
2013/11/18 19:29:59
Done.
| |
| 344 | |
| 348 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 345 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 349 }; | 346 }; |
| 350 | 347 |
| 351 } // namespace content | 348 } // namespace content |
| 352 | 349 |
| 353 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 350 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |