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

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

Issue 2915613004: [PointerLock] Move "silent mouse lock" logic from renderer to RWHI (Closed)
Patch Set: Created 3 years, 6 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_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 // renderers involved in a page about a page-level focus update. Users other 289 // renderers involved in a page about a page-level focus update. Users other
290 // than WebContents and RenderWidgetHost should use Focus()/Blur(). 290 // than WebContents and RenderWidgetHost should use Focus()/Blur().
291 void SetPageFocus(bool focused); 291 void SetPageFocus(bool focused);
292 292
293 // Called to notify the RenderWidget that it has lost the mouse lock. 293 // Called to notify the RenderWidget that it has lost the mouse lock.
294 void LostMouseLock(); 294 void LostMouseLock();
295 295
296 // Notifies the RenderWidget that it lost the mouse lock. 296 // Notifies the RenderWidget that it lost the mouse lock.
297 void SendMouseLockLost(); 297 void SendMouseLockLost();
298 298
299 bool is_last_unlocked_by_target() const {
300 return is_last_unlocked_by_target_;
301 }
302
299 // Noifies the RenderWidget of the current mouse cursor visibility state. 303 // Noifies the RenderWidget of the current mouse cursor visibility state.
300 void SendCursorVisibilityState(bool is_visible); 304 void SendCursorVisibilityState(bool is_visible);
301 305
302 // Notifies the RenderWidgetHost that the View was destroyed. 306 // Notifies the RenderWidgetHost that the View was destroyed.
303 void ViewDestroyed(); 307 void ViewDestroyed();
304 308
305 // Signals if this host has forwarded a GestureScrollBegin without yet having 309 // Signals if this host has forwarded a GestureScrollBegin without yet having
306 // forwarded a matching GestureScrollEnd/GestureFlingStart. 310 // forwarded a matching GestureScrollEnd/GestureFlingStart.
307 bool is_in_touchscreen_gesture_scroll() const { 311 bool is_in_touchscreen_gesture_scroll() const {
308 return is_in_gesture_scroll_[blink::kWebGestureDeviceTouchscreen]; 312 return is_in_gesture_scroll_[blink::kWebGestureDeviceTouchscreen];
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 512
509 InputRouter* input_router() { return input_router_.get(); } 513 InputRouter* input_router() { return input_router_.get(); }
510 514
511 // Get the BrowserAccessibilityManager for the root of the frame tree, 515 // Get the BrowserAccessibilityManager for the root of the frame tree,
512 BrowserAccessibilityManager* GetRootBrowserAccessibilityManager(); 516 BrowserAccessibilityManager* GetRootBrowserAccessibilityManager();
513 517
514 // Get the BrowserAccessibilityManager for the root of the frame tree, 518 // Get the BrowserAccessibilityManager for the root of the frame tree,
515 // or create it if it doesn't already exist. 519 // or create it if it doesn't already exist.
516 BrowserAccessibilityManager* GetOrCreateRootBrowserAccessibilityManager(); 520 BrowserAccessibilityManager* GetOrCreateRootBrowserAccessibilityManager();
517 521
518 void RejectMouseLockOrUnlockIfNecessary(); 522 void RejectMouseLockOrUnlockIfNecessary(bool is_unlocked_by_target = false);
dtapuska 2017/05/31 20:04:03 You can't use default initialized parameters in ch
chongz 2017/06/01 14:58:20 Removed the parameter. Please see the other commen
519 523
520 void set_renderer_initialized(bool renderer_initialized) { 524 void set_renderer_initialized(bool renderer_initialized) {
521 renderer_initialized_ = renderer_initialized; 525 renderer_initialized_ = renderer_initialized;
522 } 526 }
523 527
524 // Indicates if the render widget host should track the render widget's size 528 // Indicates if the render widget host should track the render widget's size
525 // as opposed to visa versa. 529 // as opposed to visa versa.
526 void SetAutoResize(bool enable, 530 void SetAutoResize(bool enable,
527 const gfx::Size& min_size, 531 const gfx::Size& min_size,
528 const gfx::Size& max_size); 532 const gfx::Size& max_size);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); 659 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params);
656 void OnQueueSyntheticGesture(const SyntheticGesturePacket& gesture_packet); 660 void OnQueueSyntheticGesture(const SyntheticGesturePacket& gesture_packet);
657 void OnSetCursor(const WebCursor& cursor); 661 void OnSetCursor(const WebCursor& cursor);
658 void OnTextInputStateChanged(const TextInputState& params); 662 void OnTextInputStateChanged(const TextInputState& params);
659 663
660 void OnImeCompositionRangeChanged( 664 void OnImeCompositionRangeChanged(
661 const gfx::Range& range, 665 const gfx::Range& range,
662 const std::vector<gfx::Rect>& character_bounds); 666 const std::vector<gfx::Rect>& character_bounds);
663 void OnImeCancelComposition(); 667 void OnImeCancelComposition();
664 void OnLockMouse(bool user_gesture, 668 void OnLockMouse(bool user_gesture,
665 bool last_unlocked_by_target,
666 bool privileged); 669 bool privileged);
667 void OnUnlockMouse(); 670 void OnUnlockMouse();
668 void OnShowDisambiguationPopup(const gfx::Rect& rect_pixels, 671 void OnShowDisambiguationPopup(const gfx::Rect& rect_pixels,
669 const gfx::Size& size, 672 const gfx::Size& size,
670 const cc::SharedBitmapId& id); 673 const cc::SharedBitmapId& id);
671 void OnSelectionBoundsChanged( 674 void OnSelectionBoundsChanged(
672 const ViewHostMsg_SelectionBounds_Params& params); 675 const ViewHostMsg_SelectionBounds_Params& params);
673 void OnSetNeedsBeginFrames(bool needs_begin_frames); 676 void OnSetNeedsBeginFrames(bool needs_begin_frames);
674 void OnHittestData(const FrameHostMsg_HittestData_Params& params); 677 void OnHittestData(const FrameHostMsg_HittestData_Params& params);
675 void OnFocusedNodeTouched(bool editable); 678 void OnFocusedNodeTouched(bool editable);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 // see only the Char and KeyUp events and cause unexpected behavior. For 881 // see only the Char and KeyUp events and cause unexpected behavior. For
879 // example, pressing alt-2 may let the browser switch to the second tab, but 882 // example, pressing alt-2 may let the browser switch to the second tab, but
880 // the Char event generated by alt-2 may also activate a HTML element if its 883 // the Char event generated by alt-2 may also activate a HTML element if its
881 // accesskey happens to be "2", then the user may get confused when switching 884 // accesskey happens to be "2", then the user may get confused when switching
882 // back to the original tab, because the content may already have changed. 885 // back to the original tab, because the content may already have changed.
883 bool suppress_events_until_keydown_; 886 bool suppress_events_until_keydown_;
884 887
885 bool pending_mouse_lock_request_; 888 bool pending_mouse_lock_request_;
886 bool allow_privileged_mouse_lock_; 889 bool allow_privileged_mouse_lock_;
887 890
891 // Used when locking to indicate when a target application has voluntarily
892 // unlocked and desires to relock the mouse. If the mouse is unlocked due
893 // to ESC being pressed by the user, this will be false.
894 bool is_last_unlocked_by_target_;
895
888 // Keeps track of whether the webpage has any touch event handler. If it does, 896 // Keeps track of whether the webpage has any touch event handler. If it does,
889 // then touch events are sent to the renderer. Otherwise, the touch events are 897 // then touch events are sent to the renderer. Otherwise, the touch events are
890 // not sent to the renderer. 898 // not sent to the renderer.
891 bool has_touch_handler_; 899 bool has_touch_handler_;
892 900
893 // TODO(wjmaclean) Remove the code for supporting resending gesture events 901 // TODO(wjmaclean) Remove the code for supporting resending gesture events
894 // when WebView transitions to OOPIF and BrowserPlugin is removed. 902 // when WebView transitions to OOPIF and BrowserPlugin is removed.
895 // http://crbug.com/533069 903 // http://crbug.com/533069
896 bool is_in_gesture_scroll_[blink::kWebGestureDeviceCount] = {false}; 904 bool is_in_gesture_scroll_[blink::kWebGestureDeviceCount] = {false};
897 bool is_in_touchpad_gesture_fling_; 905 bool is_in_touchpad_gesture_fling_;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 base::OnceClosure begin_frame_callback_; 997 base::OnceClosure begin_frame_callback_;
990 998
991 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 999 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
992 1000
993 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 1001 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
994 }; 1002 };
995 1003
996 } // namespace content 1004 } // namespace content
997 1005
998 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 1006 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698