| 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/gesture_text_selector.h" |
| 23 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 24 #include "content/common/content_export.h" | 25 #include "content/common/content_export.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/base/android/window_android_observer.h" | 29 #include "ui/base/android/window_android_observer.h" |
| 29 #include "ui/events/gesture_detection/filtered_gesture_provider.h" | 30 #include "ui/events/gesture_detection/filtered_gesture_provider.h" |
| 30 #include "ui/gfx/size.h" | 31 #include "ui/gfx/size.h" |
| 31 #include "ui/gfx/vector2d_f.h" | 32 #include "ui/gfx/vector2d_f.h" |
| 32 | 33 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 58 | 59 |
| 59 // ----------------------------------------------------------------------------- | 60 // ----------------------------------------------------------------------------- |
| 60 // 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. |
| 61 // ----------------------------------------------------------------------------- | 62 // ----------------------------------------------------------------------------- |
| 62 class CONTENT_EXPORT RenderWidgetHostViewAndroid | 63 class CONTENT_EXPORT RenderWidgetHostViewAndroid |
| 63 : public RenderWidgetHostViewBase, | 64 : public RenderWidgetHostViewBase, |
| 64 public cc::DelegatedFrameResourceCollectionClient, | 65 public cc::DelegatedFrameResourceCollectionClient, |
| 65 public ImageTransportFactoryAndroidObserver, | 66 public ImageTransportFactoryAndroidObserver, |
| 66 public ui::GestureProviderClient, | 67 public ui::GestureProviderClient, |
| 67 public ui::WindowAndroidObserver, | 68 public ui::WindowAndroidObserver, |
| 68 public DelegatedFrameEvictorClient { | 69 public DelegatedFrameEvictorClient, |
| 70 public GestureTextSelectorClient { |
| 69 public: | 71 public: |
| 70 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, | 72 RenderWidgetHostViewAndroid(RenderWidgetHostImpl* widget, |
| 71 ContentViewCoreImpl* content_view_core); | 73 ContentViewCoreImpl* content_view_core); |
| 72 virtual ~RenderWidgetHostViewAndroid(); | 74 virtual ~RenderWidgetHostViewAndroid(); |
| 73 | 75 |
| 74 // RenderWidgetHostView implementation. | 76 // RenderWidgetHostView implementation. |
| 75 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 77 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 76 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; | 78 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; |
| 77 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 79 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
| 78 const gfx::Rect& pos) OVERRIDE; | 80 const gfx::Rect& pos) OVERRIDE; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 base::TimeDelta vsync_period) OVERRIDE; | 184 base::TimeDelta vsync_period) OVERRIDE; |
| 183 | 185 |
| 184 // ImageTransportFactoryAndroidObserver implementation. | 186 // ImageTransportFactoryAndroidObserver implementation. |
| 185 virtual void OnLostResources() OVERRIDE; | 187 virtual void OnLostResources() OVERRIDE; |
| 186 | 188 |
| 187 // DelegatedFrameEvictor implementation | 189 // DelegatedFrameEvictor implementation |
| 188 virtual void EvictDelegatedFrame() OVERRIDE; | 190 virtual void EvictDelegatedFrame() OVERRIDE; |
| 189 | 191 |
| 190 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; | 192 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; |
| 191 | 193 |
| 194 // GestureTextSelectorClient implementation. |
| 195 virtual void ShowSelectionHandlesAutomatically() OVERRIDE; |
| 196 virtual void SelectRange(float x1, float y1, float x2, float y2) OVERRIDE; |
| 197 virtual void Unselect() OVERRIDE; |
| 198 |
| 192 // Non-virtual methods | 199 // Non-virtual methods |
| 193 void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 200 void SetContentViewCore(ContentViewCoreImpl* content_view_core); |
| 194 SkColor GetCachedBackgroundColor() const; | 201 SkColor GetCachedBackgroundColor() const; |
| 195 void SendKeyEvent(const NativeWebKeyboardEvent& event); | 202 void SendKeyEvent(const NativeWebKeyboardEvent& event); |
| 196 void SendTouchEvent(const blink::WebTouchEvent& event); | 203 void SendTouchEvent(const blink::WebTouchEvent& event); |
| 197 void SendMouseEvent(const blink::WebMouseEvent& event); | 204 void SendMouseEvent(const blink::WebMouseEvent& event); |
| 198 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); | 205 void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event); |
| 199 void SendGestureEvent(const blink::WebGestureEvent& event); | 206 void SendGestureEvent(const blink::WebGestureEvent& event); |
| 200 | 207 |
| 201 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); | 208 void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 331 |
| 325 const bool overscroll_effect_enabled_; | 332 const bool overscroll_effect_enabled_; |
| 326 // Used to render overscroll overlays. | 333 // Used to render overscroll overlays. |
| 327 // Note: |overscroll_effect_| will never be NULL, even if it's never enabled. | 334 // Note: |overscroll_effect_| will never be NULL, even if it's never enabled. |
| 328 scoped_ptr<OverscrollGlow> overscroll_effect_; | 335 scoped_ptr<OverscrollGlow> overscroll_effect_; |
| 329 | 336 |
| 330 // Provides gesture synthesis given a stream of touch events (derived from | 337 // Provides gesture synthesis given a stream of touch events (derived from |
| 331 // Android MotionEvent's) and touch event acks. | 338 // Android MotionEvent's) and touch event acks. |
| 332 ui::FilteredGestureProvider gesture_provider_; | 339 ui::FilteredGestureProvider gesture_provider_; |
| 333 | 340 |
| 341 // Handles gesture based text selection |
| 342 GestureTextSelector gesture_text_selector_; |
| 343 |
| 334 bool flush_input_requested_; | 344 bool flush_input_requested_; |
| 335 | 345 |
| 336 int accelerated_surface_route_id_; | 346 int accelerated_surface_route_id_; |
| 337 | 347 |
| 338 // Size to use if we have no backing ContentViewCore | 348 // Size to use if we have no backing ContentViewCore |
| 339 gfx::Size default_size_; | 349 gfx::Size default_size_; |
| 340 | 350 |
| 341 const bool using_synchronous_compositor_; | 351 const bool using_synchronous_compositor_; |
| 342 | 352 |
| 343 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; | 353 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 354 }; | 364 }; |
| 355 | 365 |
| 356 scoped_ptr<LastFrameInfo> last_frame_info_; | 366 scoped_ptr<LastFrameInfo> last_frame_info_; |
| 357 | 367 |
| 358 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 368 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 359 }; | 369 }; |
| 360 | 370 |
| 361 } // namespace content | 371 } // namespace content |
| 362 | 372 |
| 363 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 373 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |