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_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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 virtual void OnViewDestroyed() = 0; | 121 virtual void OnViewDestroyed() = 0; |
| 122 | 122 |
| 123 protected: | 123 protected: |
| 124 virtual ~TouchEditingClient() {} | 124 virtual ~TouchEditingClient() {} |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 void set_touch_editing_client(TouchEditingClient* client) { | 127 void set_touch_editing_client(TouchEditingClient* client) { |
| 128 touch_editing_client_ = client; | 128 touch_editing_client_ = client; |
| 129 } | 129 } |
| 130 | 130 |
| 131 explicit RenderWidgetHostViewAura(RenderWidgetHost* host); | 131 RenderWidgetHostViewAura(RenderWidgetHost* host); |
| 132 | 132 |
| 133 // RenderWidgetHostView implementation. | 133 // RenderWidgetHostView implementation. |
| 134 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; | 134 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; |
| 135 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; | 135 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; |
| 136 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 136 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
| 137 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; | 137 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; |
| 138 virtual gfx::Vector2dF GetLastScrollOffset() const OVERRIDE; | 138 virtual gfx::Vector2dF GetLastScrollOffset() const OVERRIDE; |
| 139 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 139 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
| 140 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; | 140 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; |
| 141 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; | 141 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 virtual gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() OVERRIDE; | 223 virtual gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() OVERRIDE; |
| 224 virtual gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() | 224 virtual gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() |
| 225 OVERRIDE; | 225 OVERRIDE; |
| 226 virtual bool LockMouse() OVERRIDE; | 226 virtual bool LockMouse() OVERRIDE; |
| 227 virtual void UnlockMouse() OVERRIDE; | 227 virtual void UnlockMouse() OVERRIDE; |
| 228 virtual void OnSwapCompositorFrame( | 228 virtual void OnSwapCompositorFrame( |
| 229 uint32 output_surface_id, | 229 uint32 output_surface_id, |
| 230 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; | 230 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; |
| 231 | 231 |
| 232 #if defined(OS_WIN) | 232 #if defined(OS_WIN) |
| 233 void SetLegacyRenderWidgetHostHWND(LegacyRenderWidgetHostHWND* legacy_hwnd); | |
| 233 virtual void SetParentNativeViewAccessible( | 234 virtual void SetParentNativeViewAccessible( |
| 234 gfx::NativeViewAccessible accessible_parent) OVERRIDE; | 235 gfx::NativeViewAccessible accessible_parent) OVERRIDE; |
| 235 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const OVERRIDE; | 236 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const OVERRIDE; |
| 236 #endif | 237 #endif |
| 237 | 238 |
| 238 // Overridden from ui::TextInputClient: | 239 // Overridden from ui::TextInputClient: |
| 239 virtual void SetCompositionText( | 240 virtual void SetCompositionText( |
| 240 const ui::CompositionText& composition) OVERRIDE; | 241 const ui::CompositionText& composition) OVERRIDE; |
| 241 virtual void ConfirmCompositionText() OVERRIDE; | 242 virtual void ConfirmCompositionText() OVERRIDE; |
| 242 virtual void ClearCompositionText() OVERRIDE; | 243 virtual void ClearCompositionText() OVERRIDE; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 const gfx::Point& new_origin) OVERRIDE; | 321 const gfx::Point& new_origin) OVERRIDE; |
| 321 | 322 |
| 322 #if defined(OS_WIN) | 323 #if defined(OS_WIN) |
| 323 // Sets the cutout rects from constrained windows. These are rectangles that | 324 // Sets the cutout rects from constrained windows. These are rectangles that |
| 324 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout | 325 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout |
| 325 // rects. | 326 // rects. |
| 326 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); | 327 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); |
| 327 | 328 |
| 328 // Updates the cursor clip region. Used for mouse locking. | 329 // Updates the cursor clip region. Used for mouse locking. |
| 329 void UpdateMouseLockRegion(); | 330 void UpdateMouseLockRegion(); |
| 330 | |
| 331 // Notification that the LegacyRenderWidgetHostHWND was destroyed. | |
| 332 void OnLegacyWindowDestroyed(); | |
| 333 #endif | 331 #endif |
| 334 | 332 |
| 335 // Method to indicate if this instance is shutting down or closing. | 333 // Method to indicate if this instance is shutting down or closing. |
| 336 // TODO(shrikant): Discuss around to see if it makes sense to add this method | 334 // TODO(shrikant): Discuss around to see if it makes sense to add this method |
| 337 // as part of RenderWidgetHostView. | 335 // as part of RenderWidgetHostView. |
| 338 bool IsClosing() const { return in_shutdown_; } | 336 bool IsClosing() const { return in_shutdown_; } |
| 339 | 337 |
| 340 // Sets whether the overscroll controller should be enabled for this page. | 338 // Sets whether the overscroll controller should be enabled for this page. |
| 341 void SetOverscrollControllerEnabled(bool enabled); | 339 void SetOverscrollControllerEnabled(bool enabled); |
| 342 | 340 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 // NPAPI plugins shouldn't draw over them. | 564 // NPAPI plugins shouldn't draw over them. |
| 567 std::vector<gfx::Rect> constrained_rects_; | 565 std::vector<gfx::Rect> constrained_rects_; |
| 568 | 566 |
| 569 typedef std::map<HWND, WebPluginGeometry> PluginWindowMoves; | 567 typedef std::map<HWND, WebPluginGeometry> PluginWindowMoves; |
| 570 // Contains information about each windowed plugin's clip and cutout rects ( | 568 // Contains information about each windowed plugin's clip and cutout rects ( |
| 571 // from the renderer). This is needed because when the transient windoiws | 569 // from the renderer). This is needed because when the transient windoiws |
| 572 // over this view changes, we need this information in order to create a new | 570 // over this view changes, we need this information in order to create a new |
| 573 // region for the HWND. | 571 // region for the HWND. |
| 574 PluginWindowMoves plugin_window_moves_; | 572 PluginWindowMoves plugin_window_moves_; |
| 575 | 573 |
| 576 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used | 574 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used |
|
ananta
2014/09/23 20:14:05
Can you also add this comment in the WCVA class wh
dmazzoni
2014/09/24 22:57:51
Done.
| |
| 577 // for accessibility, as the container for windowless plugins like | 575 // for accessibility, as the container for windowless plugins like |
| 578 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads, | 576 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads, |
| 579 // etc. | 577 // etc. |
| 580 // The LegacyRenderWidgetHostHWND instance is created during the first call | |
| 581 // to RenderWidgetHostViewAura::InternalSetBounds. The instance is destroyed | |
| 582 // when the LegacyRenderWidgetHostHWND hwnd is destroyed. | |
| 583 content::LegacyRenderWidgetHostHWND* legacy_render_widget_host_HWND_; | 578 content::LegacyRenderWidgetHostHWND* legacy_render_widget_host_HWND_; |
| 584 | |
| 585 // Set to true if the legacy_render_widget_host_HWND_ instance was destroyed | |
| 586 // by Windows. This could happen if the browser window was destroyed by | |
| 587 // DestroyWindow for e.g. This flag helps ensure that we don't try to create | |
| 588 // the LegacyRenderWidgetHostHWND instance again as that would be a futile | |
| 589 // exercise. | |
| 590 bool legacy_window_destroyed_; | 579 bool legacy_window_destroyed_; |
|
ananta
2014/09/23 20:14:06
Please remove this member.
dmazzoni
2014/09/24 22:57:51
Done.
| |
| 591 #endif | 580 #endif |
| 592 | 581 |
| 593 bool has_snapped_to_boundary_; | 582 bool has_snapped_to_boundary_; |
| 594 | 583 |
| 595 TouchEditingClient* touch_editing_client_; | 584 TouchEditingClient* touch_editing_client_; |
| 596 | 585 |
| 597 scoped_ptr<OverscrollController> overscroll_controller_; | 586 scoped_ptr<OverscrollController> overscroll_controller_; |
| 598 | 587 |
| 599 // The last scroll offset of the view. | 588 // The last scroll offset of the view. |
| 600 gfx::Vector2dF last_scroll_offset_; | 589 gfx::Vector2dF last_scroll_offset_; |
| 601 | 590 |
| 602 gfx::Insets insets_; | 591 gfx::Insets insets_; |
| 603 | 592 |
| 604 std::vector<ui::LatencyInfo> software_latency_info_; | 593 std::vector<ui::LatencyInfo> software_latency_info_; |
| 605 | 594 |
| 606 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; | 595 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; |
| 607 | 596 |
| 608 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; | 597 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
| 609 | 598 |
| 610 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 599 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
| 611 }; | 600 }; |
| 612 | 601 |
| 613 } // namespace content | 602 } // namespace content |
| 614 | 603 |
| 615 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 604 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| OLD | NEW |