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 10 matching lines...) Expand all Loading... |
21 #include "content/browser/compositor/image_transport_factory.h" | 21 #include "content/browser/compositor/image_transport_factory.h" |
22 #include "content/browser/compositor/owned_mailbox.h" | 22 #include "content/browser/compositor/owned_mailbox.h" |
23 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 23 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
24 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
25 #include "content/common/cursors/webcursor.h" | 25 #include "content/common/cursors/webcursor.h" |
26 #include "third_party/skia/include/core/SkRegion.h" | 26 #include "third_party/skia/include/core/SkRegion.h" |
27 #include "ui/aura/client/cursor_client_observer.h" | 27 #include "ui/aura/client/cursor_client_observer.h" |
28 #include "ui/aura/client/focus_change_observer.h" | 28 #include "ui/aura/client/focus_change_observer.h" |
29 #include "ui/aura/window_delegate.h" | 29 #include "ui/aura/window_delegate.h" |
30 #include "ui/aura/window_tree_host_observer.h" | 30 #include "ui/aura/window_tree_host_observer.h" |
| 31 #include "ui/base/compositor/compositor_begin_frame_observer.h" |
31 #include "ui/base/ime/text_input_client.h" | 32 #include "ui/base/ime/text_input_client.h" |
32 #include "ui/gfx/display_observer.h" | 33 #include "ui/gfx/display_observer.h" |
33 #include "ui/gfx/insets.h" | 34 #include "ui/gfx/insets.h" |
34 #include "ui/gfx/rect.h" | 35 #include "ui/gfx/rect.h" |
35 #include "ui/wm/public/activation_change_observer.h" | 36 #include "ui/wm/public/activation_change_observer.h" |
36 #include "ui/wm/public/activation_delegate.h" | 37 #include "ui/wm/public/activation_delegate.h" |
37 | 38 |
38 struct ViewHostMsg_TextInputState_Params; | 39 struct ViewHostMsg_TextInputState_Params; |
39 | 40 |
40 namespace aura { | 41 namespace aura { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 : public RenderWidgetHostViewBase, | 82 : public RenderWidgetHostViewBase, |
82 public DelegatedFrameHostClient, | 83 public DelegatedFrameHostClient, |
83 public ui::TextInputClient, | 84 public ui::TextInputClient, |
84 public gfx::DisplayObserver, | 85 public gfx::DisplayObserver, |
85 public aura::WindowTreeHostObserver, | 86 public aura::WindowTreeHostObserver, |
86 public aura::WindowDelegate, | 87 public aura::WindowDelegate, |
87 public aura::client::ActivationDelegate, | 88 public aura::client::ActivationDelegate, |
88 public aura::client::ActivationChangeObserver, | 89 public aura::client::ActivationChangeObserver, |
89 public aura::client::FocusChangeObserver, | 90 public aura::client::FocusChangeObserver, |
90 public aura::client::CursorClientObserver, | 91 public aura::client::CursorClientObserver, |
| 92 public ui::CompositorBeginFrameObserver, |
91 public base::SupportsWeakPtr<RenderWidgetHostViewAura> { | 93 public base::SupportsWeakPtr<RenderWidgetHostViewAura> { |
92 public: | 94 public: |
93 // Displays and controls touch editing elements such as selection handles. | 95 // Displays and controls touch editing elements such as selection handles. |
94 class TouchEditingClient { | 96 class TouchEditingClient { |
95 public: | 97 public: |
96 TouchEditingClient() {} | 98 TouchEditingClient() {} |
97 | 99 |
98 // Tells the client to start showing touch editing handles. | 100 // Tells the client to start showing touch editing handles. |
99 virtual void StartTouchEditing() = 0; | 101 virtual void StartTouchEditing() = 0; |
100 | 102 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; | 146 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; |
145 virtual void Show() OVERRIDE; | 147 virtual void Show() OVERRIDE; |
146 virtual void Hide() OVERRIDE; | 148 virtual void Hide() OVERRIDE; |
147 virtual bool IsShowing() OVERRIDE; | 149 virtual bool IsShowing() OVERRIDE; |
148 virtual gfx::Rect GetViewBounds() const OVERRIDE; | 150 virtual gfx::Rect GetViewBounds() const OVERRIDE; |
149 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; | 151 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; |
150 virtual gfx::Size GetVisibleViewportSize() const OVERRIDE; | 152 virtual gfx::Size GetVisibleViewportSize() const OVERRIDE; |
151 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; | 153 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; |
152 | 154 |
153 // Overridden from RenderWidgetHostViewBase: | 155 // Overridden from RenderWidgetHostViewBase: |
| 156 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
154 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 157 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
155 const gfx::Rect& pos) OVERRIDE; | 158 const gfx::Rect& pos) OVERRIDE; |
156 virtual void InitAsFullscreen( | 159 virtual void InitAsFullscreen( |
157 RenderWidgetHostView* reference_host_view) OVERRIDE; | 160 RenderWidgetHostView* reference_host_view) OVERRIDE; |
158 virtual void WasShown() OVERRIDE; | 161 virtual void WasShown() OVERRIDE; |
159 virtual void WasHidden() OVERRIDE; | 162 virtual void WasHidden() OVERRIDE; |
160 virtual void MovePluginWindows( | 163 virtual void MovePluginWindows( |
161 const std::vector<WebPluginGeometry>& moves) OVERRIDE; | 164 const std::vector<WebPluginGeometry>& moves) OVERRIDE; |
162 virtual void Focus() OVERRIDE; | 165 virtual void Focus() OVERRIDE; |
163 virtual void Blur() OVERRIDE; | 166 virtual void Blur() OVERRIDE; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE; | 315 virtual void OnCursorVisibilityChanged(bool is_visible) OVERRIDE; |
313 | 316 |
314 // Overridden from aura::client::FocusChangeObserver: | 317 // Overridden from aura::client::FocusChangeObserver: |
315 virtual void OnWindowFocused(aura::Window* gained_focus, | 318 virtual void OnWindowFocused(aura::Window* gained_focus, |
316 aura::Window* lost_focus) OVERRIDE; | 319 aura::Window* lost_focus) OVERRIDE; |
317 | 320 |
318 // Overridden from aura::WindowTreeHostObserver: | 321 // Overridden from aura::WindowTreeHostObserver: |
319 virtual void OnHostMoved(const aura::WindowTreeHost* host, | 322 virtual void OnHostMoved(const aura::WindowTreeHost* host, |
320 const gfx::Point& new_origin) OVERRIDE; | 323 const gfx::Point& new_origin) OVERRIDE; |
321 | 324 |
| 325 // Overridden from ui::CompositorBeginFrameObserver: |
| 326 virtual void OnSendBeginFrame(const cc::BeginFrameArgs& args) OVERRIDE; |
| 327 |
322 #if defined(OS_WIN) | 328 #if defined(OS_WIN) |
323 // Sets the cutout rects from constrained windows. These are rectangles that | 329 // Sets the cutout rects from constrained windows. These are rectangles that |
324 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout | 330 // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout |
325 // rects. | 331 // rects. |
326 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); | 332 void UpdateConstrainedWindowRects(const std::vector<gfx::Rect>& rects); |
327 | 333 |
328 // Updates the cursor clip region. Used for mouse locking. | 334 // Updates the cursor clip region. Used for mouse locking. |
329 void UpdateMouseLockRegion(); | 335 void UpdateMouseLockRegion(); |
330 | 336 |
331 // Notification that the LegacyRenderWidgetHostHWND was destroyed. | 337 // Notification that the LegacyRenderWidgetHostHWND was destroyed. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 460 |
455 // Converts |rect| from window coordinate to screen coordinate. | 461 // Converts |rect| from window coordinate to screen coordinate. |
456 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; | 462 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; |
457 | 463 |
458 // Converts |rect| from screen coordinate to window coordinate. | 464 // Converts |rect| from screen coordinate to window coordinate. |
459 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; | 465 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; |
460 | 466 |
461 // Helper function to set keyboard focus to the main window. | 467 // Helper function to set keyboard focus to the main window. |
462 void SetKeyboardFocus(); | 468 void SetKeyboardFocus(); |
463 | 469 |
| 470 // Called when RenderWidget want to start BeginFrame scheduling or stop. |
| 471 void OnSetNeedsBeginFrame(bool enabled); |
| 472 |
464 RenderFrameHostImpl* GetFocusedFrame(); | 473 RenderFrameHostImpl* GetFocusedFrame(); |
465 | 474 |
466 // The model object. | 475 // The model object. |
467 RenderWidgetHostImpl* host_; | 476 RenderWidgetHostImpl* host_; |
468 | 477 |
469 aura::Window* window_; | 478 aura::Window* window_; |
470 | 479 |
471 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; | 480 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; |
472 | 481 |
473 scoped_ptr<WindowObserver> window_observer_; | 482 scoped_ptr<WindowObserver> window_observer_; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 607 |
599 // The last scroll offset of the view. | 608 // The last scroll offset of the view. |
600 gfx::Vector2dF last_scroll_offset_; | 609 gfx::Vector2dF last_scroll_offset_; |
601 | 610 |
602 gfx::Insets insets_; | 611 gfx::Insets insets_; |
603 | 612 |
604 std::vector<ui::LatencyInfo> software_latency_info_; | 613 std::vector<ui::LatencyInfo> software_latency_info_; |
605 | 614 |
606 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; | 615 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; |
607 | 616 |
| 617 // True when RenderWidget needs a BeginFrame. |
| 618 bool needs_begin_frame_; |
| 619 |
| 620 // True when unified BeginFrame scheduling is used. |
| 621 bool begin_frame_scheduling_is_enabled_; |
| 622 |
| 623 // Pass |last_begin_frame_args_| to BeginFrameManager when |this| is added |
| 624 // as its observer. With this, BeginFrameManager can determine whether latest |
| 625 // BeginFrameArgs is used immediately or not. |
| 626 cc::BeginFrameArgs last_begin_frame_args_; |
| 627 |
608 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; | 628 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
609 | 629 |
610 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 630 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
611 }; | 631 }; |
612 | 632 |
613 } // namespace content | 633 } // namespace content |
614 | 634 |
615 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 635 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |