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

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

Powered by Google App Engine
This is Rietveld 408576698