| 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/output/begin_frame_args.h" | 18 #include "cc/output/begin_frame_args.h" |
| 19 #include "content/browser/accessibility/browser_accessibility_manager.h" | 19 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 20 #include "content/browser/renderer_host/delegated_frame_evictor.h" | 20 #include "content/browser/renderer_host/delegated_frame_evictor.h" |
| 21 #include "content/browser/renderer_host/image_transport_factory_android.h" | 21 #include "content/browser/renderer_host/image_transport_factory_android.h" |
| 22 #include "content/browser/renderer_host/ime_adapter_android.h" | 22 #include "content/browser/renderer_host/ime_adapter_android.h" |
| 23 #include "content/browser/renderer_host/input/stylus_text_selector.h" | 23 #include "content/browser/renderer_host/input/stylus_text_selector.h" |
| 24 #include "content/browser/renderer_host/input/touch_selection_controller.h" | |
| 25 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 26 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
| 27 #include "content/public/browser/readback_types.h" | 26 #include "content/public/browser/readback_types.h" |
| 28 #include "gpu/command_buffer/common/mailbox.h" | 27 #include "gpu/command_buffer/common/mailbox.h" |
| 29 #include "third_party/skia/include/core/SkColor.h" | 28 #include "third_party/skia/include/core/SkColor.h" |
| 30 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 29 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 31 #include "ui/base/android/window_android_observer.h" | 30 #include "ui/base/android/window_android_observer.h" |
| 32 #include "ui/events/gesture_detection/filtered_gesture_provider.h" | 31 #include "ui/events/gesture_detection/filtered_gesture_provider.h" |
| 33 #include "ui/gfx/size.h" | 32 #include "ui/gfx/size.h" |
| 34 #include "ui/gfx/vector2d_f.h" | 33 #include "ui/gfx/vector2d_f.h" |
| 34 #include "ui/touch_selection/touch_selection_controller.h" |
| 35 | 35 |
| 36 struct ViewHostMsg_TextInputState_Params; | 36 struct ViewHostMsg_TextInputState_Params; |
| 37 | 37 |
| 38 namespace cc { | 38 namespace cc { |
| 39 class CopyOutputResult; | 39 class CopyOutputResult; |
| 40 class DelegatedFrameProvider; | 40 class DelegatedFrameProvider; |
| 41 class DelegatedRendererLayer; | 41 class DelegatedRendererLayer; |
| 42 class Layer; | 42 class Layer; |
| 43 } | 43 } |
| 44 | 44 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // See comments in render_widget_host_view.h about this class and its members. | 80 // See comments in render_widget_host_view.h about this class and its members. |
| 81 // ----------------------------------------------------------------------------- | 81 // ----------------------------------------------------------------------------- |
| 82 class CONTENT_EXPORT RenderWidgetHostViewAndroid | 82 class CONTENT_EXPORT RenderWidgetHostViewAndroid |
| 83 : public RenderWidgetHostViewBase, | 83 : public RenderWidgetHostViewBase, |
| 84 public cc::DelegatedFrameResourceCollectionClient, | 84 public cc::DelegatedFrameResourceCollectionClient, |
| 85 public ImageTransportFactoryAndroidObserver, | 85 public ImageTransportFactoryAndroidObserver, |
| 86 public ui::GestureProviderClient, | 86 public ui::GestureProviderClient, |
| 87 public ui::WindowAndroidObserver, | 87 public ui::WindowAndroidObserver, |
| 88 public DelegatedFrameEvictorClient, | 88 public DelegatedFrameEvictorClient, |
| 89 public StylusTextSelectorClient, | 89 public StylusTextSelectorClient, |
| 90 public TouchSelectionControllerClient { | 90 public ui::TouchSelectionControllerClient { |
| 91 public: | 91 public: |
| 92 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, | 92 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, |
| 93 ContentViewCoreImpl* content_view_core); | 93 ContentViewCoreImpl* content_view_core); |
| 94 virtual ~RenderWidgetHostViewAndroid(); | 94 virtual ~RenderWidgetHostViewAndroid(); |
| 95 | 95 |
| 96 // RenderWidgetHostView implementation. | 96 // RenderWidgetHostView implementation. |
| 97 virtual bool OnMessageReceived(const IPC::Message& msg) override; | 97 virtual bool OnMessageReceived(const IPC::Message& msg) override; |
| 98 virtual void InitAsChild(gfx::NativeView parent_view) override; | 98 virtual void InitAsChild(gfx::NativeView parent_view) override; |
| 99 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 99 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
| 100 const gfx::Rect& pos) override; | 100 const gfx::Rect& pos) override; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 virtual void EvictDelegatedFrame() override; | 204 virtual void EvictDelegatedFrame() override; |
| 205 | 205 |
| 206 virtual SkColorType PreferredReadbackFormat() override; | 206 virtual SkColorType PreferredReadbackFormat() override; |
| 207 | 207 |
| 208 // StylusTextSelectorClient implementation. | 208 // StylusTextSelectorClient implementation. |
| 209 void OnStylusSelectBegin(float x0, float y0, float x1, float y1) override; | 209 void OnStylusSelectBegin(float x0, float y0, float x1, float y1) override; |
| 210 void OnStylusSelectUpdate(float x, float y) override; | 210 void OnStylusSelectUpdate(float x, float y) override; |
| 211 void OnStylusSelectEnd() override; | 211 void OnStylusSelectEnd() override; |
| 212 void OnStylusSelectTap(base::TimeTicks time, float x, float y) override; | 212 void OnStylusSelectTap(base::TimeTicks time, float x, float y) override; |
| 213 | 213 |
| 214 // TouchSelectionControllerClient implementation. | 214 // ui::TouchSelectionControllerClient implementation. |
| 215 virtual bool SupportsAnimation() const override; | 215 virtual bool SupportsAnimation() const override; |
| 216 virtual void SetNeedsAnimate() override; | 216 virtual void SetNeedsAnimate() override; |
| 217 virtual void MoveCaret(const gfx::PointF& position) override; | 217 virtual void MoveCaret(const gfx::PointF& position) override; |
| 218 virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) override; | 218 virtual void MoveRangeSelectionExtent(const gfx::PointF& extent) override; |
| 219 virtual void SelectBetweenCoordinates(const gfx::PointF& base, | 219 virtual void SelectBetweenCoordinates(const gfx::PointF& base, |
| 220 const gfx::PointF& extent) override; | 220 const gfx::PointF& extent) override; |
| 221 virtual void OnSelectionEvent(SelectionEventType event, | 221 virtual void OnSelectionEvent(ui::SelectionEventType event, |
| 222 const gfx::PointF& anchor_position) override; | 222 const gfx::PointF& anchor_position) override; |
| 223 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() override; | 223 virtual scoped_ptr<ui::TouchHandleDrawable> CreateDrawable() override; |
| 224 | 224 |
| 225 // Non-virtual methods | 225 // Non-virtual methods |
| 226 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 226 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
| 227 SkColor GetCachedBackgroundColor() const; | 227 SkColor GetCachedBackgroundColor() const; |
| 228 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 228 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
| 229 void SendMouseEvent(const blink::WebMouseEvent& event); | 229 void SendMouseEvent(const blink::WebMouseEvent& event); |
| 230 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 230 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
| 231 void SendGestureEvent(const blink::WebGestureEvent& event); | 231 void SendGestureEvent(const blink::WebGestureEvent& event); |
| 232 | 232 |
| 233 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); | 233 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 376 |
| 377 // Provides gesture synthesis given a stream of touch events (derived from | 377 // Provides gesture synthesis given a stream of touch events (derived from |
| 378 // Android MotionEvent's) and touch event acks. | 378 // Android MotionEvent's) and touch event acks. |
| 379 ui::FilteredGestureProvider gesture_provider_; | 379 ui::FilteredGestureProvider gesture_provider_; |
| 380 | 380 |
| 381 // Handles gesture based text selection | 381 // Handles gesture based text selection |
| 382 StylusTextSelector stylus_text_selector_; | 382 StylusTextSelector stylus_text_selector_; |
| 383 | 383 |
| 384 // Manages selection handle rendering and manipulation. | 384 // Manages selection handle rendering and manipulation. |
| 385 // This will always be NULL if |content_view_core_| is NULL. | 385 // This will always be NULL if |content_view_core_| is NULL. |
| 386 scoped_ptr<TouchSelectionController> selection_controller_; | 386 scoped_ptr<ui::TouchSelectionController> selection_controller_; |
| 387 | 387 |
| 388 int accelerated_surface_route_id_; | 388 int accelerated_surface_route_id_; |
| 389 | 389 |
| 390 // Size to use if we have no backing ContentViewCore | 390 // Size to use if we have no backing ContentViewCore |
| 391 gfx::Size default_size_; | 391 gfx::Size default_size_; |
| 392 | 392 |
| 393 const bool using_synchronous_compositor_; | 393 const bool using_synchronous_compositor_; |
| 394 | 394 |
| 395 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; | 395 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; |
| 396 | 396 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 416 gfx::Vector2dF last_scroll_offset_; | 416 gfx::Vector2dF last_scroll_offset_; |
| 417 | 417 |
| 418 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; | 418 base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
| 419 | 419 |
| 420 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 420 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 421 }; | 421 }; |
| 422 | 422 |
| 423 } // namespace content | 423 } // namespace content |
| 424 | 424 |
| 425 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 425 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |