Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.h

Issue 1016033006: Enable BeginFrame scheduling on aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address dana's comment Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
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"
29 #include "ui/aura/window_delegate.h" 30 #include "ui/aura/window_delegate.h"
30 #include "ui/aura/window_tree_host_observer.h" 31 #include "ui/aura/window_tree_host_observer.h"
31 #include "ui/base/ime/text_input_client.h" 32 #include "ui/base/ime/text_input_client.h"
32 #include "ui/base/touch/selection_bound.h" 33 #include "ui/base/touch/selection_bound.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 75
75 class OverscrollController; 76 class OverscrollController;
76 class RenderFrameHostImpl; 77 class RenderFrameHostImpl;
77 class RenderWidgetHostImpl; 78 class RenderWidgetHostImpl;
78 class RenderWidgetHostView; 79 class RenderWidgetHostView;
79 80
80 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. 81 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
81 class CONTENT_EXPORT RenderWidgetHostViewAura 82 class CONTENT_EXPORT RenderWidgetHostViewAura
82 : public RenderWidgetHostViewBase, 83 : public RenderWidgetHostViewBase,
83 public DelegatedFrameHostClient, 84 public DelegatedFrameHostClient,
85 public BeginFrameObserverProxyClient,
84 public ui::TextInputClient, 86 public ui::TextInputClient,
85 public gfx::DisplayObserver, 87 public gfx::DisplayObserver,
86 public aura::WindowTreeHostObserver, 88 public aura::WindowTreeHostObserver,
87 public aura::WindowDelegate, 89 public aura::WindowDelegate,
88 public aura::client::ActivationDelegate, 90 public aura::client::ActivationDelegate,
89 public aura::client::ActivationChangeObserver, 91 public aura::client::ActivationChangeObserver,
90 public aura::client::FocusChangeObserver, 92 public aura::client::FocusChangeObserver,
91 public aura::client::CursorClientObserver { 93 public aura::client::CursorClientObserver {
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.
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( 466 scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock(
465 bool defer_compositor_lock) override; 467 bool defer_compositor_lock) override;
466 void DelegatedFrameHostResizeLockWasReleased() override; 468 void DelegatedFrameHostResizeLockWasReleased() override;
467 void DelegatedFrameHostSendCompositorSwapAck( 469 void DelegatedFrameHostSendCompositorSwapAck(
468 int output_surface_id, 470 int output_surface_id,
469 const cc::CompositorFrameAck& ack) override; 471 const cc::CompositorFrameAck& ack) override;
470 void DelegatedFrameHostSendReclaimCompositorResources( 472 void DelegatedFrameHostSendReclaimCompositorResources(
471 int output_surface_id, 473 int output_surface_id,
472 const cc::CompositorFrameAck& ack) override; 474 const cc::CompositorFrameAck& ack) override;
473 void DelegatedFrameHostOnLostCompositorResources() override; 475 void DelegatedFrameHostOnLostCompositorResources() override;
474 void DelegatedFrameHostUpdateVSyncParameters( 476
475 const base::TimeTicks& timebase, 477 // BeginFrameObserverProxyClient implementation.
476 const base::TimeDelta& interval) override; 478 void SendBeginFrame(const cc::BeginFrameArgs& args) override;
477 479
478 // Detaches |this| from the input method object. 480 // Detaches |this| from the input method object.
479 void DetachFromInputMethod(); 481 void DetachFromInputMethod();
480 482
481 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method 483 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method
482 // calls our keybindings handler against the event and send matched 484 // calls our keybindings handler against the event and send matched
483 // edit commands to renderer instead. 485 // edit commands to renderer instead.
484 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event); 486 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event);
485 487
486 // Dismisses a Web Popup on a mouse or touch press outside the popup and its 488 // Dismisses a Web Popup on a mouse or touch press outside the popup and its
487 // parent. 489 // parent.
488 void ApplyEventFilterForPopupExit(ui::LocatedEvent* event); 490 void ApplyEventFilterForPopupExit(ui::LocatedEvent* event);
489 491
490 // Converts |rect| from window coordinate to screen coordinate. 492 // Converts |rect| from window coordinate to screen coordinate.
491 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const; 493 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const;
492 494
493 // Converts |rect| from screen coordinate to window coordinate. 495 // Converts |rect| from screen coordinate to window coordinate.
494 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; 496 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const;
495 497
496 // Helper function to set keyboard focus to the main window. 498 // Helper function to set keyboard focus to the main window.
497 void SetKeyboardFocus(); 499 void SetKeyboardFocus();
498 500
501 // Called when RenderWidget wants to start BeginFrame scheduling or stop.
502 void OnSetNeedsBeginFrames(bool needs_begin_frames);
503
499 RenderFrameHostImpl* GetFocusedFrame(); 504 RenderFrameHostImpl* GetFocusedFrame();
500 505
501 // The model object. 506 // The model object.
502 RenderWidgetHostImpl* host_; 507 RenderWidgetHostImpl* host_;
503 508
504 aura::Window* window_; 509 aura::Window* window_;
505 510
506 scoped_ptr<DelegatedFrameHost> delegated_frame_host_; 511 scoped_ptr<DelegatedFrameHost> delegated_frame_host_;
507 512
508 scoped_ptr<WindowObserver> window_observer_; 513 scoped_ptr<WindowObserver> window_observer_;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 // RenderWidgetHostViewGuest. 650 // RenderWidgetHostViewGuest.
646 bool is_guest_view_hack_; 651 bool is_guest_view_hack_;
647 652
648 gfx::Rect disambiguation_target_rect_; 653 gfx::Rect disambiguation_target_rect_;
649 654
650 // The last scroll offset when we start to render the link disambiguation 655 // The last scroll offset when we start to render the link disambiguation
651 // view, so we can ensure the window hasn't moved between copying from the 656 // view, so we can ensure the window hasn't moved between copying from the
652 // compositing surface and showing the disambiguation popup. 657 // compositing surface and showing the disambiguation popup.
653 gfx::Vector2dF disambiguation_scroll_offset_; 658 gfx::Vector2dF disambiguation_scroll_offset_;
654 659
660 scoped_ptr<BeginFrameObserverProxy> begin_frame_observer_proxy_;
brianderson 2015/03/25 20:25:54 Can this be a straight up BeginFrameObserverProxy
simonhong 2015/03/25 23:21:49 Yep, scoped_ptr is not needed in this case because
661
655 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; 662 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_;
656 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 663 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
657 }; 664 };
658 665
659 } // namespace content 666 } // namespace content
660 667
661 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 668 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698