Commit 121f47f1 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Move default values to RenderWidgetHostViewEventHandler header

This makes initializer lists easier to follow. Also added some consts
where that made sense.

Bug: None
Change-Id: I86dffdbdfc4eb87df52e2eefbe9aa2a92d0f2fe6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1914607
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715272}
parent 826f07c2
...@@ -104,10 +104,7 @@ bool NeedsInputGrab(content::RenderWidgetHostViewBase* view) { ...@@ -104,10 +104,7 @@ bool NeedsInputGrab(content::RenderWidgetHostViewBase* view) {
namespace content { namespace content {
RenderWidgetHostViewEventHandler::Delegate::Delegate() RenderWidgetHostViewEventHandler::Delegate::Delegate() = default;
: selection_controller_client_(nullptr),
selection_controller_(nullptr),
overscroll_controller_(nullptr) {}
RenderWidgetHostViewEventHandler::Delegate::~Delegate() {} RenderWidgetHostViewEventHandler::Delegate::~Delegate() {}
...@@ -115,18 +112,12 @@ RenderWidgetHostViewEventHandler::RenderWidgetHostViewEventHandler( ...@@ -115,18 +112,12 @@ RenderWidgetHostViewEventHandler::RenderWidgetHostViewEventHandler(
RenderWidgetHostImpl* host, RenderWidgetHostImpl* host,
RenderWidgetHostViewBase* host_view, RenderWidgetHostViewBase* host_view,
Delegate* delegate) Delegate* delegate)
: accept_return_character_(false), : pinch_zoom_enabled_(content::IsPinchToZoomEnabled()),
mouse_locked_(false),
pinch_zoom_enabled_(content::IsPinchToZoomEnabled()),
set_focus_on_mouse_down_or_key_event_(false),
enable_consolidated_movement_( enable_consolidated_movement_(
base::FeatureList::IsEnabled(features::kConsolidatedMovementXY)), base::FeatureList::IsEnabled(features::kConsolidatedMovementXY)),
host_(host), host_(host),
host_view_(host_view), host_view_(host_view),
popup_child_host_view_(nullptr),
popup_child_event_handler_(nullptr),
delegate_(delegate), delegate_(delegate),
window_(nullptr),
mouse_wheel_phase_handler_(host_view), mouse_wheel_phase_handler_(host_view),
debug_observer_(features::IsVizHitTestingDebugEnabled() debug_observer_(features::IsVizHitTestingDebugEnabled()
? std::make_unique<HitTestDebugKeyEventObserver>(host) ? std::make_unique<HitTestDebugKeyEventObserver>(host)
......
...@@ -248,7 +248,7 @@ class CONTENT_EXPORT RenderWidgetHostViewEventHandler ...@@ -248,7 +248,7 @@ class CONTENT_EXPORT RenderWidgetHostViewEventHandler
bool IsKeyLocked(const ui::KeyEvent& event); bool IsKeyLocked(const ui::KeyEvent& event);
// Whether return characters should be passed on to the RenderWidgetHostImpl. // Whether return characters should be passed on to the RenderWidgetHostImpl.
bool accept_return_character_; bool accept_return_character_ = false;
// Deactivates keyboard lock when destroyed. // Deactivates keyboard lock when destroyed.
std::unique_ptr<aura::ScopedKeyboardHook> scoped_keyboard_hook_; std::unique_ptr<aura::ScopedKeyboardHook> scoped_keyboard_hook_;
...@@ -258,7 +258,7 @@ class CONTENT_EXPORT RenderWidgetHostViewEventHandler ...@@ -258,7 +258,7 @@ class CONTENT_EXPORT RenderWidgetHostViewEventHandler
// mouse position just as mouse lock was entered; the movement they report // mouse position just as mouse lock was entered; the movement they report
// indicates what the change in position of the mouse would be had it not been // indicates what the change in position of the mouse would be had it not been
// locked. // locked.
bool mouse_locked_; bool mouse_locked_ = false;
// Use to track whether pointer lock is in the unadjusted movement mode and // Use to track whether pointer lock is in the unadjusted movement mode and
// mousemoves are using unadjusted movement value (without mouse // mousemoves are using unadjusted movement value (without mouse
...@@ -269,11 +269,11 @@ class CONTENT_EXPORT RenderWidgetHostViewEventHandler ...@@ -269,11 +269,11 @@ class CONTENT_EXPORT RenderWidgetHostViewEventHandler
// Whether pinch-to-zoom should be enabled and pinch events forwarded to the // Whether pinch-to-zoom should be enabled and pinch events forwarded to the
// renderer. // renderer.
bool pinch_zoom_enabled_; const bool pinch_zoom_enabled_;
// This flag when set ensures that we send over a notification to blink that // This flag when set ensures that we send over a notification to blink that
// the current view has focus. Defaults to false. // the current view has focus.
bool set_focus_on_mouse_down_or_key_event_; bool set_focus_on_mouse_down_or_key_event_ = false;
// Used to track the state of the window we're created from. Only used when // Used to track the state of the window we're created from. Only used when
// created fullscreen. // created fullscreen.
...@@ -305,10 +305,10 @@ class CONTENT_EXPORT RenderWidgetHostViewEventHandler ...@@ -305,10 +305,10 @@ class CONTENT_EXPORT RenderWidgetHostViewEventHandler
// Should create |this| and own it. // Should create |this| and own it.
RenderWidgetHostViewBase* const host_view_; RenderWidgetHostViewBase* const host_view_;
// Optional, used to redirect events to a popup and associated handler. // Optional, used to redirect events to a popup and associated handler.
RenderWidgetHostViewBase* popup_child_host_view_; RenderWidgetHostViewBase* popup_child_host_view_ = nullptr;
ui::EventHandler* popup_child_event_handler_; ui::EventHandler* popup_child_event_handler_ = nullptr;
Delegate* const delegate_; Delegate* const delegate_;
aura::Window* window_; aura::Window* window_ = nullptr;
MouseWheelPhaseHandler mouse_wheel_phase_handler_; MouseWheelPhaseHandler mouse_wheel_phase_handler_;
std::unique_ptr<HitTestDebugKeyEventObserver> debug_observer_; std::unique_ptr<HitTestDebugKeyEventObserver> debug_observer_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment