| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "cc/scheduler/begin_frame_manager.h" |
| 19 #include "content/browser/accessibility/browser_accessibility_manager.h" | 20 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 20 #include "content/browser/compositor/delegated_frame_host.h" | 21 #include "content/browser/compositor/delegated_frame_host.h" |
| 21 #include "content/browser/compositor/image_transport_factory.h" | 22 #include "content/browser/compositor/image_transport_factory.h" |
| 22 #include "content/browser/compositor/owned_mailbox.h" | 23 #include "content/browser/compositor/owned_mailbox.h" |
| 23 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 24 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
| 25 #include "content/common/cursors/webcursor.h" | 26 #include "content/common/cursors/webcursor.h" |
| 26 #include "third_party/skia/include/core/SkRegion.h" | 27 #include "third_party/skia/include/core/SkRegion.h" |
| 27 #include "ui/aura/client/cursor_client_observer.h" | 28 #include "ui/aura/client/cursor_client_observer.h" |
| 28 #include "ui/aura/client/focus_change_observer.h" | 29 #include "ui/aura/client/focus_change_observer.h" |
| (...skipping 52 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 cc::BeginFrameManager::Observer, |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; | 145 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; |
| 144 virtual void Show() OVERRIDE; | 146 virtual void Show() OVERRIDE; |
| 145 virtual void Hide() OVERRIDE; | 147 virtual void Hide() OVERRIDE; |
| 146 virtual bool IsShowing() OVERRIDE; | 148 virtual bool IsShowing() OVERRIDE; |
| 147 virtual gfx::Rect GetViewBounds() const OVERRIDE; | 149 virtual gfx::Rect GetViewBounds() const OVERRIDE; |
| 148 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; | 150 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; |
| 149 virtual gfx::Size GetVisibleViewportSize() const OVERRIDE; | 151 virtual gfx::Size GetVisibleViewportSize() const OVERRIDE; |
| 150 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; | 152 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; |
| 151 | 153 |
| 152 // Overridden from RenderWidgetHostViewBase: | 154 // Overridden from RenderWidgetHostViewBase: |
| 155 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 153 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 156 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
| 154 const gfx::Rect& pos) OVERRIDE; | 157 const gfx::Rect& pos) OVERRIDE; |
| 155 virtual void InitAsFullscreen( | 158 virtual void InitAsFullscreen( |
| 156 RenderWidgetHostView* reference_host_view) OVERRIDE; | 159 RenderWidgetHostView* reference_host_view) OVERRIDE; |
| 157 virtual void WasShown() OVERRIDE; | 160 virtual void WasShown() OVERRIDE; |
| 158 virtual void WasHidden() OVERRIDE; | 161 virtual void WasHidden() OVERRIDE; |
| 159 virtual void MovePluginWindows( | 162 virtual void MovePluginWindows( |
| 160 const std::vector<WebPluginGeometry>& moves) OVERRIDE; | 163 const std::vector<WebPluginGeometry>& moves) OVERRIDE; |
| 161 virtual void Focus() OVERRIDE; | 164 virtual void Focus() OVERRIDE; |
| 162 virtual void Blur() OVERRIDE; | 165 virtual void Blur() OVERRIDE; |
| (...skipping 149 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 cc::BeginFrameManager::Observer: |
| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 462 |
| 457 // Converts |rect| from window coordinate to screen coordinate. | 463 // Converts |rect| from window coordinate to screen coordinate. |
| 458 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; | 464 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; |
| 459 | 465 |
| 460 // Converts |rect| from screen coordinate to window coordinate. | 466 // Converts |rect| from screen coordinate to window coordinate. |
| 461 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; | 467 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; |
| 462 | 468 |
| 463 // Helper function to set keyboard focus to the main window. | 469 // Helper function to set keyboard focus to the main window. |
| 464 void SetKeyboardFocus(); | 470 void SetKeyboardFocus(); |
| 465 | 471 |
| 472 // Called when RenderWidget want to start BeginFrame scheduling or stop. |
| 473 void OnSetNeedsBeginFrame(bool enabled); |
| 474 |
| 466 RenderFrameHostImpl* GetFocusedFrame(); | 475 RenderFrameHostImpl* GetFocusedFrame(); |
| 467 | 476 |
| 468 // The model object. | 477 // The model object. |
| 469 RenderWidgetHostImpl* host_; | 478 RenderWidgetHostImpl* host_; |
| 470 | 479 |
| 471 aura::Window* window_; | 480 aura::Window* window_; |
| 472 | 481 |
| 473 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; | 482 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; |
| 474 | 483 |
| 475 scoped_ptr<WindowObserver> window_observer_; | 484 scoped_ptr<WindowObserver> window_observer_; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 TouchEditingClient* touch_editing_client_; | 606 TouchEditingClient* touch_editing_client_; |
| 598 | 607 |
| 599 scoped_ptr<OverscrollController> overscroll_controller_; | 608 scoped_ptr<OverscrollController> overscroll_controller_; |
| 600 | 609 |
| 601 gfx::Insets insets_; | 610 gfx::Insets insets_; |
| 602 | 611 |
| 603 std::vector<ui::LatencyInfo> software_latency_info_; | 612 std::vector<ui::LatencyInfo> software_latency_info_; |
| 604 | 613 |
| 605 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; | 614 scoped_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; |
| 606 | 615 |
| 616 // True when RenderWidget needs a BeginFrame. |
| 617 bool needs_begin_frame_; |
| 618 |
| 619 // True when --enable-begin-frame-scheduling is used. |
| 620 bool begin_frame_scheduling_is_enabled_; |
| 621 |
| 622 // Pass |last_begin_frame_args_| to BeginFrameManager when |this| is added |
| 623 // as its observer. With this, BeginFrameManager can determine whether latest |
| 624 // BeginFrameArgs is used immediately or not. |
| 625 cc::BeginFrameArgs last_begin_frame_args_; |
| 626 |
| 607 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; | 627 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
| 608 | 628 |
| 609 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 629 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
| 610 }; | 630 }; |
| 611 | 631 |
| 612 } // namespace content | 632 } // namespace content |
| 613 | 633 |
| 614 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 634 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
| OLD | NEW |