| 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_AURA_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 class InputMethod; | 62 class InputMethod; |
| 63 class LocatedEvent; | 63 class LocatedEvent; |
| 64 class Texture; | 64 class Texture; |
| 65 } | 65 } |
| 66 | 66 |
| 67 namespace content { | 67 namespace content { |
| 68 #if defined(OS_WIN) | 68 #if defined(OS_WIN) |
| 69 class LegacyRenderWidgetHostHWND; | 69 class LegacyRenderWidgetHostHWND; |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 class OverscrollController; |
| 72 class RenderFrameHostImpl; | 73 class RenderFrameHostImpl; |
| 73 class RenderWidgetHostImpl; | 74 class RenderWidgetHostImpl; |
| 74 class RenderWidgetHostView; | 75 class RenderWidgetHostView; |
| 75 | 76 |
| 76 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 77 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
| 77 class CONTENT_EXPORT RenderWidgetHostViewAura | 78 class CONTENT_EXPORT RenderWidgetHostViewAura |
| 78 : public RenderWidgetHostViewBase, | 79 : public RenderWidgetHostViewBase, |
| 79 public DelegatedFrameHostClient, | 80 public DelegatedFrameHostClient, |
| 80 public ui::TextInputClient, | 81 public ui::TextInputClient, |
| 81 public gfx::DisplayObserver, | 82 public gfx::DisplayObserver, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, | 198 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, |
| 198 int gpu_host_id) OVERRIDE; | 199 int gpu_host_id) OVERRIDE; |
| 199 virtual void AcceleratedSurfacePostSubBuffer( | 200 virtual void AcceleratedSurfacePostSubBuffer( |
| 200 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, | 201 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, |
| 201 int gpu_host_id) OVERRIDE; | 202 int gpu_host_id) OVERRIDE; |
| 202 virtual void AcceleratedSurfaceSuspend() OVERRIDE; | 203 virtual void AcceleratedSurfaceSuspend() OVERRIDE; |
| 203 virtual void AcceleratedSurfaceRelease() OVERRIDE; | 204 virtual void AcceleratedSurfaceRelease() OVERRIDE; |
| 204 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; | 205 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; |
| 205 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; | 206 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; |
| 206 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; | 207 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; |
| 208 virtual void WheelEventAck(const blink::WebMouseWheelEvent& event, |
| 209 InputEventAckState ack_result) OVERRIDE; |
| 207 virtual void GestureEventAck(const blink::WebGestureEvent& event, | 210 virtual void GestureEventAck(const blink::WebGestureEvent& event, |
| 208 InputEventAckState ack_result) OVERRIDE; | 211 InputEventAckState ack_result) OVERRIDE; |
| 209 virtual void ProcessAckedTouchEvent( | 212 virtual void ProcessAckedTouchEvent( |
| 210 const TouchEventWithLatencyInfo& touch, | 213 const TouchEventWithLatencyInfo& touch, |
| 211 InputEventAckState ack_result) OVERRIDE; | 214 InputEventAckState ack_result) OVERRIDE; |
| 212 virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() | 215 virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() |
| 213 OVERRIDE; | 216 OVERRIDE; |
| 214 virtual void SetScrollOffsetPinning( | 217 virtual void SetScrollOffsetPinning( |
| 215 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; | 218 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; |
| 219 virtual InputEventAckState FilterInputEvent( |
| 220 const blink::WebInputEvent& input_event) OVERRIDE; |
| 216 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; | 221 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
| 217 virtual void CreateBrowserAccessibilityManagerIfNeeded() OVERRIDE; | 222 virtual void CreateBrowserAccessibilityManagerIfNeeded() OVERRIDE; |
| 218 virtual bool LockMouse() OVERRIDE; | 223 virtual bool LockMouse() OVERRIDE; |
| 219 virtual void UnlockMouse() OVERRIDE; | 224 virtual void UnlockMouse() OVERRIDE; |
| 220 virtual void OnSwapCompositorFrame( | 225 virtual void OnSwapCompositorFrame( |
| 221 uint32 output_surface_id, | 226 uint32 output_surface_id, |
| 222 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; | 227 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; |
| 223 | 228 |
| 224 #if defined(OS_WIN) | 229 #if defined(OS_WIN) |
| 225 virtual void SetParentNativeViewAccessible( | 230 virtual void SetParentNativeViewAccessible( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 323 |
| 319 // Updates the cursor clip region. Used for mouse locking. | 324 // Updates the cursor clip region. Used for mouse locking. |
| 320 void UpdateMouseLockRegion(); | 325 void UpdateMouseLockRegion(); |
| 321 #endif | 326 #endif |
| 322 | 327 |
| 323 // Method to indicate if this instance is shutting down or closing. | 328 // Method to indicate if this instance is shutting down or closing. |
| 324 // TODO(shrikant): Discuss around to see if it makes sense to add this method | 329 // TODO(shrikant): Discuss around to see if it makes sense to add this method |
| 325 // as part of RenderWidgetHostView. | 330 // as part of RenderWidgetHostView. |
| 326 bool IsClosing() const { return in_shutdown_; } | 331 bool IsClosing() const { return in_shutdown_; } |
| 327 | 332 |
| 333 // Sets whether the overscroll controller should be enabled for this page. |
| 334 void SetOverscrollControllerEnabled(bool enabled); |
| 335 |
| 336 OverscrollController* overscroll_controller() const { |
| 337 return overscroll_controller_.get(); |
| 338 } |
| 339 |
| 328 protected: | 340 protected: |
| 329 virtual ~RenderWidgetHostViewAura(); | 341 virtual ~RenderWidgetHostViewAura(); |
| 330 | 342 |
| 331 // Exposed for tests. | 343 // Exposed for tests. |
| 332 aura::Window* window() { return window_; } | 344 aura::Window* window() { return window_; } |
| 333 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; | 345 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; |
| 334 virtual DelegatedFrameHost* GetDelegatedFrameHost() const OVERRIDE; | 346 virtual DelegatedFrameHost* GetDelegatedFrameHost() const OVERRIDE; |
| 335 | 347 |
| 336 private: | 348 private: |
| 337 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText); | 349 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText); |
| 338 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState); | 350 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState); |
| 339 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync); | 351 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync); |
| 340 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow); | 352 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow); |
| 341 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, | 353 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
| 342 SkippedDelegatedFrames); | 354 SkippedDelegatedFrames); |
| 343 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, OutputSurfaceIdChange); | 355 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, OutputSurfaceIdChange); |
| 344 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, | 356 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
| 345 DiscardDelegatedFrames); | 357 DiscardDelegatedFrames); |
| 346 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, | 358 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
| 347 DiscardDelegatedFramesWithLocking); | 359 DiscardDelegatedFramesWithLocking); |
| 348 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SoftwareDPIChange); | 360 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SoftwareDPIChange); |
| 349 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, | 361 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
| 350 UpdateCursorIfOverSelf); | 362 UpdateCursorIfOverSelf); |
| 351 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraCopyRequestTest, | 363 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraCopyRequestTest, |
| 352 DestroyedAfterCopyRequest); | 364 DestroyedAfterCopyRequest); |
| 353 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, | 365 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
| 354 VisibleViewportTest); | 366 VisibleViewportTest); |
| 367 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, |
| 368 OverscrollResetsOnBlur); |
| 355 | 369 |
| 356 class WindowObserver; | 370 class WindowObserver; |
| 357 friend class WindowObserver; | 371 friend class WindowObserver; |
| 358 | 372 |
| 359 void UpdateCursorIfOverSelf(); | 373 void UpdateCursorIfOverSelf(); |
| 360 | 374 |
| 361 // Set the bounds of the window and handle size changes. Assumes the caller | 375 // Set the bounds of the window and handle size changes. Assumes the caller |
| 362 // has already adjusted the origin of |rect| to conform to whatever coordinate | 376 // has already adjusted the origin of |rect| to conform to whatever coordinate |
| 363 // space is required by the aura::Window. | 377 // space is required by the aura::Window. |
| 364 void InternalSetBounds(const gfx::Rect& rect); | 378 void InternalSetBounds(const gfx::Rect& rect); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 typedef std::map<HWND, WebPluginGeometry> PluginWindowMoves; | 554 typedef std::map<HWND, WebPluginGeometry> PluginWindowMoves; |
| 541 // Contains information about each windowed plugin's clip and cutout rects ( | 555 // Contains information about each windowed plugin's clip and cutout rects ( |
| 542 // from the renderer). This is needed because when the transient windoiws | 556 // from the renderer). This is needed because when the transient windoiws |
| 543 // over this view changes, we need this information in order to create a new | 557 // over this view changes, we need this information in order to create a new |
| 544 // region for the HWND. | 558 // region for the HWND. |
| 545 PluginWindowMoves plugin_window_moves_; | 559 PluginWindowMoves plugin_window_moves_; |
| 546 #endif | 560 #endif |
| 547 | 561 |
| 548 TouchEditingClient* touch_editing_client_; | 562 TouchEditingClient* touch_editing_client_; |
| 549 | 563 |
| 564 scoped_ptr<OverscrollController> overscroll_controller_; |
| 565 |
| 550 gfx::Insets insets_; | 566 gfx::Insets insets_; |
| 551 | 567 |
| 552 std::vector<ui::LatencyInfo> software_latency_info_; | 568 std::vector<ui::LatencyInfo> software_latency_info_; |
| 553 | 569 |
| 554 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; | 570 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; |
| 555 | 571 |
| 556 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; | 572 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
| 557 | 573 |
| 558 #if defined(OS_WIN) | 574 #if defined(OS_WIN) |
| 559 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used | 575 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used |
| 560 // for accessibility, as the container for windowless plugins like | 576 // for accessibility, as the container for windowless plugins like |
| 561 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads, | 577 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads, |
| 562 // etc. | 578 // etc. |
| 563 scoped_ptr<content::LegacyRenderWidgetHostHWND> | 579 scoped_ptr<content::LegacyRenderWidgetHostHWND> |
| 564 legacy_render_widget_host_HWND_; | 580 legacy_render_widget_host_HWND_; |
| 565 #endif | 581 #endif |
| 566 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 582 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
| 567 }; | 583 }; |
| 568 | 584 |
| 569 } // namespace content | 585 } // namespace content |
| 570 | 586 |
| 571 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 587 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| OLD | NEW |