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 "content/browser/accessibility/browser_accessibility_manager.h" | 19 #include "content/browser/accessibility/browser_accessibility_manager.h" |
20 #include "content/browser/compositor/delegated_frame_host.h" | 20 #include "content/browser/compositor/delegated_frame_host.h" |
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/begin_frame_observer_proxy.h" | |
24 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 23 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
25 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
26 #include "content/common/cursors/webcursor.h" | 25 #include "content/common/cursors/webcursor.h" |
27 #include "third_party/skia/include/core/SkRegion.h" | 26 #include "third_party/skia/include/core/SkRegion.h" |
28 #include "ui/aura/client/cursor_client_observer.h" | 27 #include "ui/aura/client/cursor_client_observer.h" |
29 #include "ui/aura/client/focus_change_observer.h" | 28 #include "ui/aura/client/focus_change_observer.h" |
30 #include "ui/aura/window_delegate.h" | 29 #include "ui/aura/window_delegate.h" |
31 #include "ui/aura/window_tree_host_observer.h" | 30 #include "ui/aura/window_tree_host_observer.h" |
32 #include "ui/base/ime/text_input_client.h" | 31 #include "ui/base/ime/text_input_client.h" |
33 #include "ui/base/touch/selection_bound.h" | 32 #include "ui/base/touch/selection_bound.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 74 |
76 class OverscrollController; | 75 class OverscrollController; |
77 class RenderFrameHostImpl; | 76 class RenderFrameHostImpl; |
78 class RenderWidgetHostImpl; | 77 class RenderWidgetHostImpl; |
79 class RenderWidgetHostView; | 78 class RenderWidgetHostView; |
80 | 79 |
81 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 80 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
82 class CONTENT_EXPORT RenderWidgetHostViewAura | 81 class CONTENT_EXPORT RenderWidgetHostViewAura |
83 : public RenderWidgetHostViewBase, | 82 : public RenderWidgetHostViewBase, |
84 public DelegatedFrameHostClient, | 83 public DelegatedFrameHostClient, |
85 public BeginFrameObserverProxyClient, | |
86 public ui::TextInputClient, | 84 public ui::TextInputClient, |
87 public gfx::DisplayObserver, | 85 public gfx::DisplayObserver, |
88 public aura::WindowTreeHostObserver, | 86 public aura::WindowTreeHostObserver, |
89 public aura::WindowDelegate, | 87 public aura::WindowDelegate, |
90 public aura::client::ActivationDelegate, | 88 public aura::client::ActivationDelegate, |
91 public aura::client::ActivationChangeObserver, | 89 public aura::client::ActivationChangeObserver, |
92 public aura::client::FocusChangeObserver, | 90 public aura::client::FocusChangeObserver, |
93 public aura::client::CursorClientObserver { | 91 public aura::client::CursorClientObserver { |
94 public: | 92 public: |
95 // Displays and controls touch editing elements such as selection handles. | 93 // Displays and controls touch editing elements such as selection handles. |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( | 462 scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( |
465 bool defer_compositor_lock) override; | 463 bool defer_compositor_lock) override; |
466 void DelegatedFrameHostResizeLockWasReleased() override; | 464 void DelegatedFrameHostResizeLockWasReleased() override; |
467 void DelegatedFrameHostSendCompositorSwapAck( | 465 void DelegatedFrameHostSendCompositorSwapAck( |
468 int output_surface_id, | 466 int output_surface_id, |
469 const cc::CompositorFrameAck& ack) override; | 467 const cc::CompositorFrameAck& ack) override; |
470 void DelegatedFrameHostSendReclaimCompositorResources( | 468 void DelegatedFrameHostSendReclaimCompositorResources( |
471 int output_surface_id, | 469 int output_surface_id, |
472 const cc::CompositorFrameAck& ack) override; | 470 const cc::CompositorFrameAck& ack) override; |
473 void DelegatedFrameHostOnLostCompositorResources() override; | 471 void DelegatedFrameHostOnLostCompositorResources() override; |
474 | 472 void DelegatedFrameHostUpdateVSyncParameters( |
475 // BeginFrameObserverProxyClient implementation. | 473 const base::TimeTicks& timebase, |
476 void SendBeginFrame(const cc::BeginFrameArgs& args) override; | 474 const base::TimeDelta& interval) override; |
477 | 475 |
478 // Detaches |this| from the input method object. | 476 // Detaches |this| from the input method object. |
479 void DetachFromInputMethod(); | 477 void DetachFromInputMethod(); |
480 | 478 |
481 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method | 479 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method |
482 // calls our keybindings handler against the event and send matched | 480 // calls our keybindings handler against the event and send matched |
483 // edit commands to renderer instead. | 481 // edit commands to renderer instead. |
484 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event); | 482 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event); |
485 | 483 |
486 // Dismisses a Web Popup on a mouse or touch press outside the popup and its | 484 // Dismisses a Web Popup on a mouse or touch press outside the popup and its |
487 // parent. | 485 // parent. |
488 void ApplyEventFilterForPopupExit(ui::LocatedEvent* event); | 486 void ApplyEventFilterForPopupExit(ui::LocatedEvent* event); |
489 | 487 |
490 // Converts |rect| from window coordinate to screen coordinate. | 488 // Converts |rect| from window coordinate to screen coordinate. |
491 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; | 489 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; |
492 | 490 |
493 // Converts |rect| from screen coordinate to window coordinate. | 491 // Converts |rect| from screen coordinate to window coordinate. |
494 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; | 492 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; |
495 | 493 |
496 // Helper function to set keyboard focus to the main window. | 494 // Helper function to set keyboard focus to the main window. |
497 void SetKeyboardFocus(); | 495 void SetKeyboardFocus(); |
498 | 496 |
499 // Called when RenderWidget wants to start BeginFrame scheduling or stop. | |
500 void OnSetNeedsBeginFrames(bool needs_begin_frames); | |
501 | |
502 RenderFrameHostImpl* GetFocusedFrame(); | 497 RenderFrameHostImpl* GetFocusedFrame(); |
503 | 498 |
504 // The model object. | 499 // The model object. |
505 RenderWidgetHostImpl* host_; | 500 RenderWidgetHostImpl* host_; |
506 | 501 |
507 aura::Window* window_; | 502 aura::Window* window_; |
508 | 503 |
509 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; | 504 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; |
510 | 505 |
511 scoped_ptr<WindowObserver> window_observer_; | 506 scoped_ptr<WindowObserver> window_observer_; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 // RenderWidgetHostViewGuest. | 643 // RenderWidgetHostViewGuest. |
649 bool is_guest_view_hack_; | 644 bool is_guest_view_hack_; |
650 | 645 |
651 gfx::Rect disambiguation_target_rect_; | 646 gfx::Rect disambiguation_target_rect_; |
652 | 647 |
653 // The last scroll offset when we start to render the link disambiguation | 648 // The last scroll offset when we start to render the link disambiguation |
654 // view, so we can ensure the window hasn't moved between copying from the | 649 // view, so we can ensure the window hasn't moved between copying from the |
655 // compositing surface and showing the disambiguation popup. | 650 // compositing surface and showing the disambiguation popup. |
656 gfx::Vector2dF disambiguation_scroll_offset_; | 651 gfx::Vector2dF disambiguation_scroll_offset_; |
657 | 652 |
658 BeginFrameObserverProxy begin_frame_observer_proxy_; | |
659 | |
660 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; | 653 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
661 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 654 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
662 }; | 655 }; |
663 | 656 |
664 } // namespace content | 657 } // namespace content |
665 | 658 |
666 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 659 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |