Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.h

Issue 291003002: Move OverscrollController to RenderWidgetHostViewAura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK_GE Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, 199 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel,
199 int gpu_host_id) OVERRIDE; 200 int gpu_host_id) OVERRIDE;
200 virtual void AcceleratedSurfacePostSubBuffer( 201 virtual void AcceleratedSurfacePostSubBuffer(
201 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, 202 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel,
202 int gpu_host_id) OVERRIDE; 203 int gpu_host_id) OVERRIDE;
203 virtual void AcceleratedSurfaceSuspend() OVERRIDE; 204 virtual void AcceleratedSurfaceSuspend() OVERRIDE;
204 virtual void AcceleratedSurfaceRelease() OVERRIDE; 205 virtual void AcceleratedSurfaceRelease() OVERRIDE;
205 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; 206 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE;
206 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; 207 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE;
207 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; 208 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE;
209 virtual void WheelEventAck(const blink::WebMouseWheelEvent& event,
210 InputEventAckState ack_result) OVERRIDE;
208 virtual void GestureEventAck(const blink::WebGestureEvent& event, 211 virtual void GestureEventAck(const blink::WebGestureEvent& event,
209 InputEventAckState ack_result) OVERRIDE; 212 InputEventAckState ack_result) OVERRIDE;
210 virtual void ProcessAckedTouchEvent( 213 virtual void ProcessAckedTouchEvent(
211 const TouchEventWithLatencyInfo& touch, 214 const TouchEventWithLatencyInfo& touch,
212 InputEventAckState ack_result) OVERRIDE; 215 InputEventAckState ack_result) OVERRIDE;
213 virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() 216 virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget()
214 OVERRIDE; 217 OVERRIDE;
215 virtual void SetScrollOffsetPinning( 218 virtual void SetScrollOffsetPinning(
216 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; 219 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE;
220 virtual InputEventAckState FilterInputEvent(
221 const blink::WebInputEvent& input_event) OVERRIDE;
217 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; 222 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
218 virtual void CreateBrowserAccessibilityManagerIfNeeded() OVERRIDE; 223 virtual void CreateBrowserAccessibilityManagerIfNeeded() OVERRIDE;
219 virtual bool LockMouse() OVERRIDE; 224 virtual bool LockMouse() OVERRIDE;
220 virtual void UnlockMouse() OVERRIDE; 225 virtual void UnlockMouse() OVERRIDE;
221 virtual void OnSwapCompositorFrame( 226 virtual void OnSwapCompositorFrame(
222 uint32 output_surface_id, 227 uint32 output_surface_id,
223 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; 228 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE;
224 229
225 #if defined(OS_WIN) 230 #if defined(OS_WIN)
226 virtual void SetParentNativeViewAccessible( 231 virtual void SetParentNativeViewAccessible(
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 325
321 // Updates the cursor clip region. Used for mouse locking. 326 // Updates the cursor clip region. Used for mouse locking.
322 void UpdateMouseLockRegion(); 327 void UpdateMouseLockRegion();
323 #endif 328 #endif
324 329
325 // Method to indicate if this instance is shutting down or closing. 330 // Method to indicate if this instance is shutting down or closing.
326 // TODO(shrikant): Discuss around to see if it makes sense to add this method 331 // TODO(shrikant): Discuss around to see if it makes sense to add this method
327 // as part of RenderWidgetHostView. 332 // as part of RenderWidgetHostView.
328 bool IsClosing() const { return in_shutdown_; } 333 bool IsClosing() const { return in_shutdown_; }
329 334
335 // Sets whether the overscroll controller should be enabled for this page.
336 void SetOverscrollControllerEnabled(bool enabled);
337
338 OverscrollController* overscroll_controller() const {
339 return overscroll_controller_.get();
340 }
341
330 protected: 342 protected:
331 virtual ~RenderWidgetHostViewAura(); 343 virtual ~RenderWidgetHostViewAura();
332 344
333 // Exposed for tests. 345 // Exposed for tests.
334 aura::Window* window() { return window_; } 346 aura::Window* window() { return window_; }
335 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; 347 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE;
336 virtual DelegatedFrameHost* GetDelegatedFrameHost() const OVERRIDE; 348 virtual DelegatedFrameHost* GetDelegatedFrameHost() const OVERRIDE;
337 349
338 private: 350 private:
339 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText); 351 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText);
340 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState); 352 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState);
341 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync); 353 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventSyncAsync);
342 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow); 354 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SwapNotifiesWindow);
343 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 355 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
344 SkippedDelegatedFrames); 356 SkippedDelegatedFrames);
345 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, OutputSurfaceIdChange); 357 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, OutputSurfaceIdChange);
346 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 358 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
347 DiscardDelegatedFrames); 359 DiscardDelegatedFrames);
348 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 360 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
349 DiscardDelegatedFramesWithLocking); 361 DiscardDelegatedFramesWithLocking);
350 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SoftwareDPIChange); 362 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SoftwareDPIChange);
351 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 363 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
352 UpdateCursorIfOverSelf); 364 UpdateCursorIfOverSelf);
353 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraCopyRequestTest, 365 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraCopyRequestTest,
354 DestroyedAfterCopyRequest); 366 DestroyedAfterCopyRequest);
355 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 367 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
356 VisibleViewportTest); 368 VisibleViewportTest);
369 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
370 OverscrollResetsOnBlur);
357 371
358 class WindowObserver; 372 class WindowObserver;
359 friend class WindowObserver; 373 friend class WindowObserver;
360 374
361 void UpdateCursorIfOverSelf(); 375 void UpdateCursorIfOverSelf();
362 376
363 // Set the bounds of the window and handle size changes. Assumes the caller 377 // Set the bounds of the window and handle size changes. Assumes the caller
364 // has already adjusted the origin of |rect| to conform to whatever coordinate 378 // has already adjusted the origin of |rect| to conform to whatever coordinate
365 // space is required by the aura::Window. 379 // space is required by the aura::Window.
366 void InternalSetBounds(const gfx::Rect& rect); 380 void InternalSetBounds(const gfx::Rect& rect);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 typedef std::map<HWND, WebPluginGeometry> PluginWindowMoves; 556 typedef std::map<HWND, WebPluginGeometry> PluginWindowMoves;
543 // Contains information about each windowed plugin's clip and cutout rects ( 557 // Contains information about each windowed plugin's clip and cutout rects (
544 // from the renderer). This is needed because when the transient windoiws 558 // from the renderer). This is needed because when the transient windoiws
545 // over this view changes, we need this information in order to create a new 559 // over this view changes, we need this information in order to create a new
546 // region for the HWND. 560 // region for the HWND.
547 PluginWindowMoves plugin_window_moves_; 561 PluginWindowMoves plugin_window_moves_;
548 #endif 562 #endif
549 563
550 TouchEditingClient* touch_editing_client_; 564 TouchEditingClient* touch_editing_client_;
551 565
566 scoped_ptr<OverscrollController> overscroll_controller_;
567
552 gfx::Insets insets_; 568 gfx::Insets insets_;
553 569
554 std::vector<ui::LatencyInfo> software_latency_info_; 570 std::vector<ui::LatencyInfo> software_latency_info_;
555 571
556 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; 572 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_;
557 573
558 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; 574 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_;
559 575
560 #if defined(OS_WIN) 576 #if defined(OS_WIN)
561 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used 577 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used
562 // for accessibility, as the container for windowless plugins like 578 // for accessibility, as the container for windowless plugins like
563 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads, 579 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads,
564 // etc. 580 // etc.
565 scoped_ptr<content::LegacyRenderWidgetHostHWND> 581 scoped_ptr<content::LegacyRenderWidgetHostHWND>
566 legacy_render_widget_host_HWND_; 582 legacy_render_widget_host_HWND_;
567 #endif 583 #endif
568 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 584 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
569 }; 585 };
570 586
571 } // namespace content 587 } // namespace content
572 588
573 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 589 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698