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::NativeView GetNativeView() const OVERRIDE; | 138 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
139 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; | 139 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; |
140 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; | 140 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; |
141 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; | 141 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; | 220 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
221 virtual BrowserAccessibilityManager* CreateBrowserAccessibilityManager( | 221 virtual BrowserAccessibilityManager* CreateBrowserAccessibilityManager( |
222 BrowserAccessibilityDelegate* delegate) OVERRIDE; | 222 BrowserAccessibilityDelegate* delegate) OVERRIDE; |
223 virtual bool LockMouse() OVERRIDE; | 223 virtual bool LockMouse() OVERRIDE; |
224 virtual void UnlockMouse() OVERRIDE; | 224 virtual void UnlockMouse() OVERRIDE; |
225 virtual void OnSwapCompositorFrame( | 225 virtual void OnSwapCompositorFrame( |
226 uint32 output_surface_id, | 226 uint32 output_surface_id, |
227 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; | 227 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; |
228 | 228 |
229 #if defined(OS_WIN) | 229 #if defined(OS_WIN) |
| 230 void SetLegacyRenderWidgetHostHWND(LegacyRenderWidgetHostHWND* legacy_hwnd); |
230 virtual void SetParentNativeViewAccessible( | 231 virtual void SetParentNativeViewAccessible( |
231 gfx::NativeViewAccessible accessible_parent) OVERRIDE; | 232 gfx::NativeViewAccessible accessible_parent) OVERRIDE; |
232 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const OVERRIDE; | 233 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const OVERRIDE; |
233 #endif | 234 #endif |
234 | 235 |
235 // Overridden from ui::TextInputClient: | 236 // Overridden from ui::TextInputClient: |
236 virtual void SetCompositionText( | 237 virtual void SetCompositionText( |
237 const ui::CompositionText& composition) OVERRIDE; | 238 const ui::CompositionText& composition) OVERRIDE; |
238 virtual void ConfirmCompositionText() OVERRIDE; | 239 virtual void ConfirmCompositionText() OVERRIDE; |
239 virtual void ClearCompositionText() OVERRIDE; | 240 virtual void ClearCompositionText() OVERRIDE; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 const gfx::Point& new_origin) OVERRIDE; | 318 const gfx::Point& new_origin) OVERRIDE; |
318 | 319 |
319 #if defined(OS_WIN) | 320 #if defined(OS_WIN) |
320 // Sets the cutout rects from constrained windows. These are rectangles that | 321 // Sets the cutout rects from constrained windows. These are rectangles that |
321 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout | 322 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout |
322 // rects. | 323 // rects. |
323 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); | 324 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); |
324 | 325 |
325 // Updates the cursor clip region. Used for mouse locking. | 326 // Updates the cursor clip region. Used for mouse locking. |
326 void UpdateMouseLockRegion(); | 327 void UpdateMouseLockRegion(); |
327 | |
328 // Notification that the LegacyRenderWidgetHostHWND was destroyed. | |
329 void OnLegacyWindowDestroyed(); | |
330 #endif | 328 #endif |
331 | 329 |
332 // Method to indicate if this instance is shutting down or closing. | 330 // Method to indicate if this instance is shutting down or closing. |
333 // 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 |
334 // as part of RenderWidgetHostView. | 332 // as part of RenderWidgetHostView. |
335 bool IsClosing() const { return in_shutdown_; } | 333 bool IsClosing() const { return in_shutdown_; } |
336 | 334 |
337 // Sets whether the overscroll controller should be enabled for this page. | 335 // Sets whether the overscroll controller should be enabled for this page. |
338 void SetOverscrollControllerEnabled(bool enabled); | 336 void SetOverscrollControllerEnabled(bool enabled); |
339 | 337 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 // Contains information about each windowed plugin's clip and cutout rects ( | 561 // Contains information about each windowed plugin's clip and cutout rects ( |
564 // from the renderer). This is needed because when the transient windoiws | 562 // from the renderer). This is needed because when the transient windoiws |
565 // over this view changes, we need this information in order to create a new | 563 // over this view changes, we need this information in order to create a new |
566 // region for the HWND. | 564 // region for the HWND. |
567 PluginWindowMoves plugin_window_moves_; | 565 PluginWindowMoves plugin_window_moves_; |
568 | 566 |
569 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used | 567 // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used |
570 // for accessibility, as the container for windowless plugins like | 568 // for accessibility, as the container for windowless plugins like |
571 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads, | 569 // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads, |
572 // etc. | 570 // etc. |
573 // The LegacyRenderWidgetHostHWND instance is created during the first call | |
574 // to RenderWidgetHostViewAura::InternalSetBounds. The instance is destroyed | |
575 // when the LegacyRenderWidgetHostHWND hwnd is destroyed. | |
576 content::LegacyRenderWidgetHostHWND* legacy_render_widget_host_HWND_; | 571 content::LegacyRenderWidgetHostHWND* legacy_render_widget_host_HWND_; |
577 | |
578 // Set to true if the legacy_render_widget_host_HWND_ instance was destroyed | |
579 // by Windows. This could happen if the browser window was destroyed by | |
580 // DestroyWindow for e.g. This flag helps ensure that we don't try to create | |
581 // the LegacyRenderWidgetHostHWND instance again as that would be a futile | |
582 // exercise. | |
583 bool legacy_window_destroyed_; | 572 bool legacy_window_destroyed_; |
584 #endif | 573 #endif |
585 | 574 |
586 TouchEditingClient* touch_editing_client_; | 575 TouchEditingClient* touch_editing_client_; |
587 | 576 |
588 scoped_ptr<OverscrollController> overscroll_controller_; | 577 scoped_ptr<OverscrollController> overscroll_controller_; |
589 | 578 |
590 gfx::Insets insets_; | 579 gfx::Insets insets_; |
591 | 580 |
592 std::vector<ui::LatencyInfo> software_latency_info_; | 581 std::vector<ui::LatencyInfo> software_latency_info_; |
593 | 582 |
594 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; | 583 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; |
595 | 584 |
596 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; | 585 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
597 | 586 |
598 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 587 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
599 }; | 588 }; |
600 | 589 |
601 } // namespace content | 590 } // namespace content |
602 | 591 |
603 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 592 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |