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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 73 |
75 class OverscrollController; | 74 class OverscrollController; |
76 class RenderFrameHostImpl; | 75 class RenderFrameHostImpl; |
77 class RenderWidgetHostImpl; | 76 class RenderWidgetHostImpl; |
78 class RenderWidgetHostView; | 77 class RenderWidgetHostView; |
79 | 78 |
80 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 79 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
81 class CONTENT_EXPORT RenderWidgetHostViewAura | 80 class CONTENT_EXPORT RenderWidgetHostViewAura |
82 : public RenderWidgetHostViewBase, | 81 : public RenderWidgetHostViewBase, |
83 public DelegatedFrameHostClient, | 82 public DelegatedFrameHostClient, |
84 public BeginFrameObserverProxyClient, | |
85 public ui::TextInputClient, | 83 public ui::TextInputClient, |
86 public gfx::DisplayObserver, | 84 public gfx::DisplayObserver, |
87 public aura::WindowTreeHostObserver, | 85 public aura::WindowTreeHostObserver, |
88 public aura::WindowDelegate, | 86 public aura::WindowDelegate, |
89 public aura::client::ActivationDelegate, | 87 public aura::client::ActivationDelegate, |
90 public aura::client::FocusChangeObserver, | 88 public aura::client::FocusChangeObserver, |
91 public aura::client::CursorClientObserver { | 89 public aura::client::CursorClientObserver { |
92 public: | 90 public: |
93 // Displays and controls touch editing elements such as selection handles. | 91 // Displays and controls touch editing elements such as selection handles. |
94 class TouchEditingClient { | 92 class TouchEditingClient { |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( | 464 scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( |
467 bool defer_compositor_lock) override; | 465 bool defer_compositor_lock) override; |
468 void DelegatedFrameHostResizeLockWasReleased() override; | 466 void DelegatedFrameHostResizeLockWasReleased() override; |
469 void DelegatedFrameHostSendCompositorSwapAck( | 467 void DelegatedFrameHostSendCompositorSwapAck( |
470 int output_surface_id, | 468 int output_surface_id, |
471 const cc::CompositorFrameAck& ack) override; | 469 const cc::CompositorFrameAck& ack) override; |
472 void DelegatedFrameHostSendReclaimCompositorResources( | 470 void DelegatedFrameHostSendReclaimCompositorResources( |
473 int output_surface_id, | 471 int output_surface_id, |
474 const cc::CompositorFrameAck& ack) override; | 472 const cc::CompositorFrameAck& ack) override; |
475 void DelegatedFrameHostOnLostCompositorResources() override; | 473 void DelegatedFrameHostOnLostCompositorResources() override; |
476 | 474 void DelegatedFrameHostUpdateVSyncParameters( |
477 // BeginFrameObserverProxyClient implementation. | 475 const base::TimeTicks& timebase, |
478 void SendBeginFrame(const cc::BeginFrameArgs& args) override; | 476 const base::TimeDelta& interval) override; |
479 | 477 |
480 // Detaches |this| from the input method object. | 478 // Detaches |this| from the input method object. |
481 void DetachFromInputMethod(); | 479 void DetachFromInputMethod(); |
482 | 480 |
483 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method | 481 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method |
484 // calls our keybindings handler against the event and send matched | 482 // calls our keybindings handler against the event and send matched |
485 // edit commands to renderer instead. | 483 // edit commands to renderer instead. |
486 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event); | 484 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event); |
487 | 485 |
488 // Dismisses a Web Popup on a mouse or touch press outside the popup and its | 486 // Dismisses a Web Popup on a mouse or touch press outside the popup and its |
489 // parent. | 487 // parent. |
490 void ApplyEventFilterForPopupExit(ui::LocatedEvent* event); | 488 void ApplyEventFilterForPopupExit(ui::LocatedEvent* event); |
491 | 489 |
492 // Converts |rect| from window coordinate to screen coordinate. | 490 // Converts |rect| from window coordinate to screen coordinate. |
493 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; | 491 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; |
494 | 492 |
495 // Converts |rect| from screen coordinate to window coordinate. | 493 // Converts |rect| from screen coordinate to window coordinate. |
496 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; | 494 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; |
497 | 495 |
498 // Helper function to set keyboard focus to the main window. | 496 // Helper function to set keyboard focus to the main window. |
499 void SetKeyboardFocus(); | 497 void SetKeyboardFocus(); |
500 | 498 |
501 // Called when RenderWidget wants to start BeginFrame scheduling or stop. | |
502 void OnSetNeedsBeginFrames(bool needs_begin_frames); | |
503 | |
504 RenderFrameHostImpl* GetFocusedFrame(); | 499 RenderFrameHostImpl* GetFocusedFrame(); |
505 | 500 |
506 // Returns true if the |event| passed in can be forwarded to the renderer. | 501 // Returns true if the |event| passed in can be forwarded to the renderer. |
507 bool CanRendererHandleEvent(const ui::MouseEvent* event, | 502 bool CanRendererHandleEvent(const ui::MouseEvent* event, |
508 bool mouse_locked, | 503 bool mouse_locked, |
509 bool selection_popup); | 504 bool selection_popup); |
510 | 505 |
511 // Called when the parent window bounds change. | 506 // Called when the parent window bounds change. |
512 void HandleParentBoundsChanged(); | 507 void HandleParentBoundsChanged(); |
513 | 508 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 // RenderWidgetHostViewGuest. | 663 // RenderWidgetHostViewGuest. |
669 bool is_guest_view_hack_; | 664 bool is_guest_view_hack_; |
670 | 665 |
671 gfx::Rect disambiguation_target_rect_; | 666 gfx::Rect disambiguation_target_rect_; |
672 | 667 |
673 // The last scroll offset when we start to render the link disambiguation | 668 // The last scroll offset when we start to render the link disambiguation |
674 // view, so we can ensure the window hasn't moved between copying from the | 669 // view, so we can ensure the window hasn't moved between copying from the |
675 // compositing surface and showing the disambiguation popup. | 670 // compositing surface and showing the disambiguation popup. |
676 gfx::Vector2dF disambiguation_scroll_offset_; | 671 gfx::Vector2dF disambiguation_scroll_offset_; |
677 | 672 |
678 BeginFrameObserverProxy begin_frame_observer_proxy_; | |
679 | |
680 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; | 673 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; |
681 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 674 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
682 }; | 675 }; |
683 | 676 |
684 } // namespace content | 677 } // namespace content |
685 | 678 |
686 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 679 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |