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

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

Issue 2317333002: Refactor EventHandler out of RenderWidgetHostViewAura (Closed)
Patch Set: Docs and Windows compile Created 4 years, 3 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <set> 13 #include <set>
14 #include <string> 14 #include <string>
15 #include <vector> 15 #include <vector>
16 16
17 #include "base/callback.h" 17 #include "base/callback.h"
18 #include "base/compiler_specific.h"
18 #include "base/gtest_prod_util.h" 19 #include "base/gtest_prod_util.h"
19 #include "base/macros.h" 20 #include "base/macros.h"
20 #include "base/memory/linked_ptr.h" 21 #include "base/memory/linked_ptr.h"
21 #include "base/memory/ref_counted.h" 22 #include "base/memory/ref_counted.h"
22 #include "base/memory/weak_ptr.h" 23 #include "base/memory/weak_ptr.h"
23 #include "build/build_config.h" 24 #include "build/build_config.h"
24 #include "cc/scheduler/begin_frame_source.h" 25 #include "cc/scheduler/begin_frame_source.h"
25 #include "content/browser/accessibility/browser_accessibility_manager.h" 26 #include "content/browser/accessibility/browser_accessibility_manager.h"
26 #include "content/browser/compositor/image_transport_factory.h" 27 #include "content/browser/compositor/image_transport_factory.h"
27 #include "content/browser/compositor/owned_mailbox.h" 28 #include "content/browser/compositor/owned_mailbox.h"
28 #include "content/browser/renderer_host/delegated_frame_host.h" 29 #include "content/browser/renderer_host/delegated_frame_host.h"
29 #include "content/browser/renderer_host/render_widget_host_view_base.h" 30 #include "content/browser/renderer_host/render_widget_host_view_base.h"
31 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h"
30 #include "content/browser/renderer_host/text_input_manager.h" 32 #include "content/browser/renderer_host/text_input_manager.h"
31 #include "content/common/content_export.h" 33 #include "content/common/content_export.h"
32 #include "content/common/cursors/webcursor.h" 34 #include "content/common/cursors/webcursor.h"
33 #include "content/public/common/context_menu_params.h" 35 #include "content/public/common/context_menu_params.h"
34 #include "third_party/skia/include/core/SkRegion.h" 36 #include "third_party/skia/include/core/SkRegion.h"
35 #include "ui/aura/client/cursor_client_observer.h" 37 #include "ui/aura/client/cursor_client_observer.h"
36 #include "ui/aura/client/focus_change_observer.h" 38 #include "ui/aura/client/focus_change_observer.h"
37 #include "ui/aura/window_delegate.h" 39 #include "ui/aura/window_delegate.h"
38 #include "ui/aura/window_tracker.h"
39 #include "ui/aura/window_tree_host_observer.h" 40 #include "ui/aura/window_tree_host_observer.h"
40 #include "ui/base/ime/text_input_client.h" 41 #include "ui/base/ime/text_input_client.h"
41 #include "ui/display/display_observer.h" 42 #include "ui/display/display_observer.h"
42 #include "ui/events/gestures/motion_event_aura.h"
43 #include "ui/gfx/geometry/insets.h" 43 #include "ui/gfx/geometry/insets.h"
44 #include "ui/gfx/geometry/rect.h" 44 #include "ui/gfx/geometry/rect.h"
45 #include "ui/gfx/selection_bound.h" 45 #include "ui/gfx/selection_bound.h"
46 #include "ui/wm/public/activation_delegate.h" 46 #include "ui/wm/public/activation_delegate.h"
47 47
48 namespace aura { 48 namespace aura {
49 namespace client { 49 namespace client {
50 class ScopedTooltipDisabler; 50 class ScopedTooltipDisabler;
51 } 51 }
52 } 52 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 class RenderFrameHostImpl; 88 class RenderFrameHostImpl;
89 class RenderViewHostDelegateView; 89 class RenderViewHostDelegateView;
90 class RenderWidgetHostImpl; 90 class RenderWidgetHostImpl;
91 class RenderWidgetHostView; 91 class RenderWidgetHostView;
92 class TouchSelectionControllerClientAura; 92 class TouchSelectionControllerClientAura;
93 struct TextInputState; 93 struct TextInputState;
94 94
95 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. 95 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
96 class CONTENT_EXPORT RenderWidgetHostViewAura 96 class CONTENT_EXPORT RenderWidgetHostViewAura
97 : public RenderWidgetHostViewBase, 97 : public RenderWidgetHostViewBase,
98 NON_EXPORTED_BASE(public RenderWidgetHostViewEventHandler::Delegate),
98 public DelegatedFrameHostClient, 99 public DelegatedFrameHostClient,
99 public TextInputManager::Observer, 100 public TextInputManager::Observer,
100 public ui::TextInputClient, 101 public ui::TextInputClient,
101 public display::DisplayObserver, 102 public display::DisplayObserver,
102 public aura::WindowTreeHostObserver, 103 public aura::WindowTreeHostObserver,
103 public aura::WindowDelegate, 104 public aura::WindowDelegate,
104 public aura::client::ActivationDelegate, 105 public aura::client::ActivationDelegate,
105 public aura::client::FocusChangeObserver, 106 public aura::client::FocusChangeObserver,
106 public aura::client::CursorClientObserver, 107 public aura::client::CursorClientObserver,
107 public cc::BeginFrameObserver { 108 public cc::BeginFrameObserver {
(...skipping 14 matching lines...) Expand all
122 gfx::NativeView GetNativeView() const override; 123 gfx::NativeView GetNativeView() const override;
123 gfx::NativeViewAccessible GetNativeViewAccessible() override; 124 gfx::NativeViewAccessible GetNativeViewAccessible() override;
124 ui::TextInputClient* GetTextInputClient() override; 125 ui::TextInputClient* GetTextInputClient() override;
125 bool HasFocus() const override; 126 bool HasFocus() const override;
126 bool IsSurfaceAvailableForCopy() const override; 127 bool IsSurfaceAvailableForCopy() const override;
127 void Show() override; 128 void Show() override;
128 void Hide() override; 129 void Hide() override;
129 bool IsShowing() override; 130 bool IsShowing() override;
130 gfx::Rect GetViewBounds() const override; 131 gfx::Rect GetViewBounds() const override;
131 void SetBackgroundColor(SkColor color) override; 132 void SetBackgroundColor(SkColor color) override;
133 bool IsMouseLocked() override;
132 gfx::Size GetVisibleViewportSize() const override; 134 gfx::Size GetVisibleViewportSize() const override;
133 void SetInsets(const gfx::Insets& insets) override; 135 void SetInsets(const gfx::Insets& insets) override;
134 void FocusedNodeTouched(const gfx::Point& location_dips_screen, 136 void FocusedNodeTouched(const gfx::Point& location_dips_screen,
135 bool editable) override; 137 bool editable) override;
136 void SetNeedsBeginFrames(bool needs_begin_frames) override; 138 void SetNeedsBeginFrames(bool needs_begin_frames) override;
137 139
138 // Overridden from RenderWidgetHostViewBase: 140 // Overridden from RenderWidgetHostViewBase:
139 void InitAsPopup(RenderWidgetHostView* parent_host_view, 141 void InitAsPopup(RenderWidgetHostView* parent_host_view,
140 const gfx::Rect& pos) override; 142 const gfx::Rect& pos) override;
141 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; 143 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // Method to indicate if this instance is shutting down or closing. 299 // Method to indicate if this instance is shutting down or closing.
298 // TODO(shrikant): Discuss around to see if it makes sense to add this method 300 // TODO(shrikant): Discuss around to see if it makes sense to add this method
299 // as part of RenderWidgetHostView. 301 // as part of RenderWidgetHostView.
300 bool IsClosing() const { return in_shutdown_; } 302 bool IsClosing() const { return in_shutdown_; }
301 303
302 // Sets whether the overscroll controller should be enabled for this page. 304 // Sets whether the overscroll controller should be enabled for this page.
303 void SetOverscrollControllerEnabled(bool enabled); 305 void SetOverscrollControllerEnabled(bool enabled);
304 306
305 void SnapToPhysicalPixelBoundary(); 307 void SnapToPhysicalPixelBoundary();
306 308
307 ui::TouchSelectionController* selection_controller() const {
308 return selection_controller_.get();
309 }
310
311 TouchSelectionControllerClientAura* selection_controller_client() const {
312 return selection_controller_client_.get();
313 }
314
315 OverscrollController* overscroll_controller() const {
316 return overscroll_controller_.get();
317 }
318
319 // Called when the context menu is about to be displayed. 309 // Called when the context menu is about to be displayed.
320 // Returns true if the context menu should be displayed. We only return false 310 // Returns true if the context menu should be displayed. We only return false
321 // on Windows if the context menu is being displayed in response to a long 311 // on Windows if the context menu is being displayed in response to a long
322 // press gesture. On Windows we should be consistent like other apps and 312 // press gesture. On Windows we should be consistent like other apps and
323 // display the menu when the touch is released. 313 // display the menu when the touch is released.
324 bool OnShowContextMenu(const ContextMenuParams& params); 314 bool OnShowContextMenu(const ContextMenuParams& params);
325 315
326 // Used in tests to set a mock client for touch selection controller. It will 316 // Used in tests to set a mock client for touch selection controller. It will
327 // create a new touch selection controller for the new client. 317 // create a new touch selection controller for the new client.
328 void SetSelectionControllerClientForTest( 318 void SetSelectionControllerClientForTest(
329 std::unique_ptr<TouchSelectionControllerClientAura> client); 319 std::unique_ptr<TouchSelectionControllerClientAura> client);
330 320
331 // Exposed for tests. 321 // Exposed for tests.
332 cc::SurfaceId SurfaceIdForTesting() const override; 322 cc::SurfaceId SurfaceIdForTesting() const override;
333 323
324 // RenderWidgetHostViewEventHandler::Delegate:
325 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const override;
326 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event) override;
327 RenderFrameHostImpl* GetFocusedFrame() override;
328 bool NeedsMouseCapture() override;
329 void SetTooltipsEnabled(bool enable) override;
330 void Shutdown() override;
331
332 RenderWidgetHostViewEventHandler* event_handler() {
333 return event_handler_.get();
334 }
335
334 protected: 336 protected:
335 ~RenderWidgetHostViewAura() override; 337 ~RenderWidgetHostViewAura() override;
336 338
337 // Exposed for tests. 339 // Exposed for tests.
338 aura::Window* window() { return window_; } 340 aura::Window* window() { return window_; }
339 341
340 DelegatedFrameHost* GetDelegatedFrameHost() const { 342 DelegatedFrameHost* GetDelegatedFrameHost() const {
341 return delegated_frame_host_.get(); 343 return delegated_frame_host_.get();
342 } 344 }
343 345
344 const ui::MotionEventAura& pointer_state() const { return pointer_state_; }
345
346 private: 346 private:
347 friend class InputMethodAuraTestBase; 347 friend class InputMethodAuraTestBase;
348 friend class RenderWidgetHostViewAuraCopyRequestTest; 348 friend class RenderWidgetHostViewAuraCopyRequestTest;
349 friend class TestInputMethodObserver; 349 friend class TestInputMethodObserver;
350 FRIEND_TEST_ALL_PREFIXES(InputMethodResultAuraTest, 350 FRIEND_TEST_ALL_PREFIXES(InputMethodResultAuraTest,
351 FinishImeCompositionSession); 351 FinishImeCompositionSession);
352 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, 352 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest,
353 PopupRetainsCaptureAfterMouseRelease); 353 PopupRetainsCaptureAfterMouseRelease);
354 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText); 354 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, SetCompositionText);
355 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState); 355 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewAuraTest, TouchEventState);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 // Creates and/or updates the legacy dummy window which corresponds to 401 // Creates and/or updates the legacy dummy window which corresponds to
402 // the bounds of the webcontents. It is needed for accessibility and 402 // the bounds of the webcontents. It is needed for accessibility and
403 // for scrolling to work in legacy drivers for trackpoints/trackpads, etc. 403 // for scrolling to work in legacy drivers for trackpoints/trackpads, etc.
404 void UpdateLegacyWin(); 404 void UpdateLegacyWin();
405 405
406 bool UsesNativeWindowFrame() const; 406 bool UsesNativeWindowFrame() const;
407 #endif 407 #endif
408 408
409 ui::InputMethod* GetInputMethod() const; 409 ui::InputMethod* GetInputMethod() const;
410 410
411 // Sends shutdown request.
412 void Shutdown();
413
414 // Returns whether the widget needs an input grab to work properly. 411 // Returns whether the widget needs an input grab to work properly.
415 bool NeedsInputGrab(); 412 bool NeedsInputGrab();
416 413
417 // Returns whether the widget needs to grab mouse capture to work properly.
418 bool NeedsMouseCapture();
419
420 // Confirm existing composition text in the webpage and ask the input method
421 // to cancel its ongoing composition session.
422 void FinishImeCompositionSession();
423
424 // This method computes movementX/Y and keeps track of mouse location for
425 // mouse lock on all mouse move events.
426 void ModifyEventMovementAndCoords(blink::WebMouseEvent* event);
427
428 // Sends an IPC to the renderer process to communicate whether or not 414 // Sends an IPC to the renderer process to communicate whether or not
429 // the mouse cursor is visible anywhere on the screen. 415 // the mouse cursor is visible anywhere on the screen.
430 void NotifyRendererOfCursorVisibilityState(bool is_visible); 416 void NotifyRendererOfCursorVisibilityState(bool is_visible);
431 417
432 // If |clip| is non-empty and and doesn't contain |rect| or |clip| is empty 418 // If |clip| is non-empty and and doesn't contain |rect| or |clip| is empty
433 // SchedulePaint() is invoked for |rect|. 419 // SchedulePaint() is invoked for |rect|.
434 void SchedulePaintIfNotInClip(const gfx::Rect& rect, const gfx::Rect& clip); 420 void SchedulePaintIfNotInClip(const gfx::Rect& rect, const gfx::Rect& clip);
435 421
436 // Helper method to determine if, in mouse locked mode, the cursor should be
437 // moved to center.
438 bool ShouldMoveToCenter();
439
440 // Called after |window_| is parented to a WindowEventDispatcher. 422 // Called after |window_| is parented to a WindowEventDispatcher.
441 void AddedToRootWindow(); 423 void AddedToRootWindow();
442 424
443 // Called prior to removing |window_| from a WindowEventDispatcher. 425 // Called prior to removing |window_| from a WindowEventDispatcher.
444 void RemovingFromRootWindow(); 426 void RemovingFromRootWindow();
445 427
446 // DelegatedFrameHostClient implementation. 428 // DelegatedFrameHostClient implementation.
447 ui::Layer* DelegatedFrameHostGetLayer() const override; 429 ui::Layer* DelegatedFrameHostGetLayer() const override;
448 bool DelegatedFrameHostIsVisible() const override; 430 bool DelegatedFrameHostIsVisible() const override;
449 SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override; 431 SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override;
(...skipping 23 matching lines...) Expand all
473 RenderWidgetHostViewBase* updated_view) override; 455 RenderWidgetHostViewBase* updated_view) override;
474 456
475 // cc::BeginFrameObserver implementation. 457 // cc::BeginFrameObserver implementation.
476 void OnBeginFrame(const cc::BeginFrameArgs& args) override; 458 void OnBeginFrame(const cc::BeginFrameArgs& args) override;
477 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override; 459 const cc::BeginFrameArgs& LastUsedBeginFrameArgs() const override;
478 void OnBeginFrameSourcePausedChanged(bool paused) override; 460 void OnBeginFrameSourcePausedChanged(bool paused) override;
479 461
480 // Detaches |this| from the input method object. 462 // Detaches |this| from the input method object.
481 void DetachFromInputMethod(); 463 void DetachFromInputMethod();
482 464
483 // Before calling RenderWidgetHost::ForwardKeyboardEvent(), this method
484 // calls our keybindings handler against the event and send matched
485 // edit commands to renderer instead.
486 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event);
487
488 // Dismisses a Web Popup on a mouse or touch press outside the popup and its 465 // Dismisses a Web Popup on a mouse or touch press outside the popup and its
489 // parent. 466 // parent.
490 void ApplyEventFilterForPopupExit(ui::LocatedEvent* event); 467 void ApplyEventFilterForPopupExit(ui::LocatedEvent* event);
491 468
492 // Converts |rect| from window coordinate to screen coordinate.
493 gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const;
494
495 // Converts |rect| from screen coordinate to window coordinate. 469 // Converts |rect| from screen coordinate to window coordinate.
496 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const; 470 gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const;
497 471
498 // Helper function to set keyboard focus to the main window.
499 void SetKeyboardFocus();
500
501 RenderFrameHostImpl* GetFocusedFrame();
502
503 // Returns true if the |event| passed in can be forwarded to the renderer.
504 bool CanRendererHandleEvent(const ui::MouseEvent* event,
505 bool mouse_locked,
506 bool selection_popup) const;
507
508 // Returns true when we can do SurfaceHitTesting for the event type.
509 bool ShouldRouteEvent(const ui::Event* event) const;
510
511 // Called when the parent window bounds change. 472 // Called when the parent window bounds change.
512 void HandleParentBoundsChanged(); 473 void HandleParentBoundsChanged();
513 474
514 // Called when the parent window hierarchy for our window changes. 475 // Called when the parent window hierarchy for our window changes.
515 void ParentHierarchyChanged(); 476 void ParentHierarchyChanged();
516 477
517 // Helper function to be called whenever new selection information is 478 // Helper function to be called whenever new selection information is
518 // received. It will update selection controller. 479 // received. It will update selection controller.
519 void SelectionUpdated(bool is_editable, 480 void SelectionUpdated(bool is_editable,
520 bool is_empty_text_form_control, 481 bool is_empty_text_form_control,
521 const gfx::SelectionBound& start, 482 const gfx::SelectionBound& start,
522 const gfx::SelectionBound& end); 483 const gfx::SelectionBound& end);
523 484
524 // Helper function to create a selection controller. 485 // Helper function to create a selection controller.
525 void CreateSelectionController(); 486 void CreateSelectionController();
526 487
527 // Performs gesture handling needed for touch text selection. Sets event as 488 // Used to set the |popup_child_host_view_| on the |popup_parent_host_view_|
528 // handled if it should not be further processed. 489 // and to notify the |event_handler_|.
529 void HandleGestureForTouchSelection(ui::GestureEvent* event); 490 void SetPopupChild(RenderWidgetHostViewAura* popup_child_host_view);
530
531 // Forwards a mouse event to this view's parent window delegate.
532 void ForwardMouseEventToParent(ui::MouseEvent* event);
533
534 // Returns the RenderViewHostDelegateView instance for this view. Returns
535 // NULL on failure.
536 RenderViewHostDelegateView* GetRenderViewHostDelegateView();
537 491
538 // The model object. 492 // The model object.
539 RenderWidgetHostImpl* const host_; 493 RenderWidgetHostImpl* const host_;
540 494
541 aura::Window* window_; 495 aura::Window* window_;
542 496
543 std::unique_ptr<DelegatedFrameHost> delegated_frame_host_; 497 std::unique_ptr<DelegatedFrameHost> delegated_frame_host_;
544 498
545 std::unique_ptr<WindowObserver> window_observer_; 499 std::unique_ptr<WindowObserver> window_observer_;
546 500
547 // Tracks the ancestors of the RWHVA window for window location changes. 501 // Tracks the ancestors of the RWHVA window for window location changes.
548 std::unique_ptr<WindowAncestorObserver> ancestor_window_observer_; 502 std::unique_ptr<WindowAncestorObserver> ancestor_window_observer_;
549 503
550 // Are we in the process of closing? Tracked so fullscreen views can avoid 504 // Are we in the process of closing? Tracked so fullscreen views can avoid
551 // sending a second shutdown request to the host when they lose the focus 505 // sending a second shutdown request to the host when they lose the focus
552 // after requesting shutdown for another reason (e.g. Escape key). 506 // after requesting shutdown for another reason (e.g. Escape key).
553 bool in_shutdown_; 507 bool in_shutdown_;
554 508
555 // True if in the process of handling a window bounds changed notification. 509 // True if in the process of handling a window bounds changed notification.
556 bool in_bounds_changed_; 510 bool in_bounds_changed_;
557 511
558 // Is this a fullscreen view?
559 bool is_fullscreen_;
560
561 // Our parent host view, if this is a popup. NULL otherwise. 512 // Our parent host view, if this is a popup. NULL otherwise.
562 RenderWidgetHostViewAura* popup_parent_host_view_; 513 RenderWidgetHostViewAura* popup_parent_host_view_;
563 514
564 // Our child popup host. NULL if we do not have a child popup. 515 // Our child popup host. NULL if we do not have a child popup.
565 RenderWidgetHostViewAura* popup_child_host_view_; 516 RenderWidgetHostViewAura* popup_child_host_view_;
566 517
567 class EventFilterForPopupExit; 518 class EventFilterForPopupExit;
568 friend class EventFilterForPopupExit; 519 friend class EventFilterForPopupExit;
569 std::unique_ptr<ui::EventHandler> event_filter_for_popup_exit_; 520 std::unique_ptr<ui::EventHandler> event_filter_for_popup_exit_;
570 521
571 // True when content is being loaded. Used to show an hourglass cursor. 522 // True when content is being loaded. Used to show an hourglass cursor.
572 bool is_loading_; 523 bool is_loading_;
573 524
574 // The cursor for the page. This is passed up from the renderer. 525 // The cursor for the page. This is passed up from the renderer.
575 WebCursor current_cursor_; 526 WebCursor current_cursor_;
576 527
577 // Stores the current state of the active pointers targeting this
578 // object.
579 ui::MotionEventAura pointer_state_;
580
581
582 // Indicates if there is onging composition text. 528 // Indicates if there is onging composition text.
583 bool has_composition_text_; 529 bool has_composition_text_;
584 530
585 // Whether return characters should be passed on to the RenderWidgetHostImpl.
586 bool accept_return_character_;
587
588 // Current tooltip text. 531 // Current tooltip text.
589 base::string16 tooltip_; 532 base::string16 tooltip_;
590 533
591 // The begin frame source being observed. Null if none. 534 // The begin frame source being observed. Null if none.
592 cc::BeginFrameSource* begin_frame_source_; 535 cc::BeginFrameSource* begin_frame_source_;
593 cc::BeginFrameArgs last_begin_frame_args_; 536 cc::BeginFrameArgs last_begin_frame_args_;
594 bool needs_begin_frames_; 537 bool needs_begin_frames_;
595 538
596 // Used to record the last position of the mouse.
597 // While the mouse is locked, they store the last known position just as mouse
598 // lock was entered.
599 // Relative to the upper-left corner of the view.
600 gfx::Point unlocked_mouse_position_;
601 // Relative to the upper-left corner of the screen.
602 gfx::Point unlocked_global_mouse_position_;
603 // Last cursor position relative to screen. Used to compute movementX/Y.
604 gfx::Point global_mouse_position_;
605 // In mouse locked mode, we synthetically move the mouse cursor to the center
606 // of the window when it reaches the window borders to avoid it going outside.
607 // This flag is used to differentiate between these synthetic mouse move
608 // events vs. normal mouse move events.
609 bool synthetic_move_sent_;
610
611 // Used to track the state of the window we're created from. Only used when
612 // created fullscreen.
613 std::unique_ptr<aura::WindowTracker> host_tracker_;
614
615 // Used to track the last cursor visibility update that was sent to the 539 // Used to track the last cursor visibility update that was sent to the
616 // renderer via NotifyRendererOfCursorVisibilityState(). 540 // renderer via NotifyRendererOfCursorVisibilityState().
617 enum CursorVisibilityState { 541 enum CursorVisibilityState {
618 UNKNOWN, 542 UNKNOWN,
619 VISIBLE, 543 VISIBLE,
620 NOT_VISIBLE, 544 NOT_VISIBLE,
621 }; 545 };
622 CursorVisibilityState cursor_visibility_state_in_renderer_; 546 CursorVisibilityState cursor_visibility_state_in_renderer_;
623 547
624 #if defined(OS_WIN) 548 #if defined(OS_WIN)
(...skipping 18 matching lines...) Expand all
643 std::unique_ptr<ContextMenuParams> last_context_menu_params_; 567 std::unique_ptr<ContextMenuParams> last_context_menu_params_;
644 568
645 // Set to true if we requested the on screen keyboard to be displayed. 569 // Set to true if we requested the on screen keyboard to be displayed.
646 bool virtual_keyboard_requested_; 570 bool virtual_keyboard_requested_;
647 571
648 std::unique_ptr<ui::OnScreenKeyboardObserver> keyboard_observer_; 572 std::unique_ptr<ui::OnScreenKeyboardObserver> keyboard_observer_;
649 #endif 573 #endif
650 574
651 bool has_snapped_to_boundary_; 575 bool has_snapped_to_boundary_;
652 576
653 std::unique_ptr<TouchSelectionControllerClientAura>
654 selection_controller_client_;
655 std::unique_ptr<ui::TouchSelectionController> selection_controller_;
656
657 std::unique_ptr<OverscrollController> overscroll_controller_;
658
659 // The last scroll offset of the view. 577 // The last scroll offset of the view.
660 gfx::Vector2dF last_scroll_offset_; 578 gfx::Vector2dF last_scroll_offset_;
661 579
662 gfx::Insets insets_; 580 gfx::Insets insets_;
663 581
664 std::vector<ui::LatencyInfo> software_latency_info_; 582 std::vector<ui::LatencyInfo> software_latency_info_;
665 583
666 std::unique_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_; 584 std::unique_ptr<aura::client::ScopedTooltipDisabler> tooltip_disabler_;
667 585
668 // True when this view acts as a platform view hack for a 586 // True when this view acts as a platform view hack for a
669 // RenderWidgetHostViewGuest. 587 // RenderWidgetHostViewGuest.
670 bool is_guest_view_hack_; 588 bool is_guest_view_hack_;
671 589
672 // This flag when set ensures that we send over a notification to blink that
673 // the current view has focus. Defaults to false.
674 bool set_focus_on_mouse_down_or_key_event_;
675
676 float device_scale_factor_; 590 float device_scale_factor_;
677 591
678 // Allows tests to send gesture events for testing without first sending a
679 // corresponding touch sequence, as would be required by
680 // RenderWidgetHostInputEventRouter.
681 bool disable_input_event_router_for_testing_;
682
683 // The routing and process IDs for the last RenderWidgetHost which had a 592 // The routing and process IDs for the last RenderWidgetHost which had a
684 // TextInputState of non-NONE. 593 // TextInputState of non-NONE.
685 int32_t last_active_widget_process_id_; 594 int32_t last_active_widget_process_id_;
686 int32_t last_active_widget_routing_id_; 595 int32_t last_active_widget_routing_id_;
687 596
597 // While this is an ui::EventHandler for targetting, |event_handler_| actually
tdresser 2016/09/23 13:54:09 an -> a
jonross 2016/10/05 15:37:57 Done.
598 // provides an implementation, and directs events to |host_|.
599 std::unique_ptr<RenderWidgetHostViewEventHandler> event_handler_;
600
688 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_; 601 base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_;
689 602
690 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 603 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
691 }; 604 };
692 605
693 } // namespace content 606 } // namespace content
694 607
695 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 608 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698