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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetBase.h

Issue 2696523003: Unify the code paths for handling mouse events when pointer is locked on (Closed)
Patch Set: remove null check Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebFrameWidgetBase.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 WebFrameWidgetBase_h 5 #ifndef WebFrameWidgetBase_h
6 #define WebFrameWidgetBase_h 6 #define WebFrameWidgetBase_h
7 7
8 #include "core/clipboard/DataObject.h" 8 #include "core/clipboard/DataObject.h"
9 9 #include "platform/UserGestureIndicator.h"
10 #include "public/platform/WebDragData.h" 10 #include "public/platform/WebDragData.h"
11 #include "public/web/WebFrameWidget.h" 11 #include "public/web/WebFrameWidget.h"
12 #include "wtf/Assertions.h" 12 #include "wtf/Assertions.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class AnimationWorkletProxyClient; 16 class AnimationWorkletProxyClient;
17 class CompositorAnimationHost; 17 class CompositorAnimationHost;
18 class CompositorWorkerProxyClient; 18 class CompositorWorkerProxyClient;
19 class GraphicsLayer; 19 class GraphicsLayer;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 void startDragging(WebReferrerPolicy, 69 void startDragging(WebReferrerPolicy,
70 const WebDragData&, 70 const WebDragData&,
71 WebDragOperationsMask, 71 WebDragOperationsMask,
72 const WebImage& dragImage, 72 const WebImage& dragImage,
73 const WebPoint& dragImageOffset); 73 const WebPoint& dragImageOffset);
74 74
75 bool doingDragAndDrop() { return m_doingDragAndDrop; } 75 bool doingDragAndDrop() { return m_doingDragAndDrop; }
76 static void setIgnoreInputEvents(bool value) { s_ignoreInputEvents = value; } 76 static void setIgnoreInputEvents(bool value) { s_ignoreInputEvents = value; }
77 static bool ignoreInputEvents() { return s_ignoreInputEvents; } 77 static bool ignoreInputEvents() { return s_ignoreInputEvents; }
78 78
79 // WebWidget methods.
80 void didAcquirePointerLock() override;
81 void didNotAcquirePointerLock() override;
82 void didLosePointerLock() override;
83
79 protected: 84 protected:
80 enum DragAction { DragEnter, DragOver }; 85 enum DragAction { DragEnter, DragOver };
81 86
82 // Consolidate some common code between starting a drag over a target and 87 // Consolidate some common code between starting a drag over a target and
83 // updating a drag over a target. If we're starting a drag, |isEntering| 88 // updating a drag over a target. If we're starting a drag, |isEntering|
84 // should be true. 89 // should be true.
85 WebDragOperation dragTargetDragEnterOrOver(const WebPoint& pointInViewport, 90 WebDragOperation dragTargetDragEnterOrOver(const WebPoint& pointInViewport,
86 const WebPoint& screenPoint, 91 const WebPoint& screenPoint,
87 DragAction, 92 DragAction,
88 int modifiers); 93 int modifiers);
(...skipping 13 matching lines...) Expand all
102 bool m_doingDragAndDrop = false; 107 bool m_doingDragAndDrop = false;
103 108
104 // The available drag operations (copy, move link...) allowed by the source. 109 // The available drag operations (copy, move link...) allowed by the source.
105 WebDragOperation m_operationsAllowed = WebDragOperationNone; 110 WebDragOperation m_operationsAllowed = WebDragOperationNone;
106 111
107 // The current drag operation as negotiated by the source and destination. 112 // The current drag operation as negotiated by the source and destination.
108 // When not equal to DragOperationNone, the drag data can be dropped onto the 113 // When not equal to DragOperationNone, the drag data can be dropped onto the
109 // current drop target in this WebView (the drop target can accept the drop). 114 // current drop target in this WebView (the drop target can accept the drop).
110 WebDragOperation m_dragOperation = WebDragOperationNone; 115 WebDragOperation m_dragOperation = WebDragOperationNone;
111 116
117 // Helper function to process events while pointer locked.
118 void pointerLockMouseEvent(const WebInputEvent&);
119
112 private: 120 private:
113 void cancelDrag(); 121 void cancelDrag();
114 122
115 static bool s_ignoreInputEvents; 123 static bool s_ignoreInputEvents;
124 RefPtr<UserGestureToken> m_pointerLockGestureToken;
125
126 friend class WebViewImpl;
116 }; 127 };
117 128
118 DEFINE_TYPE_CASTS(WebFrameWidgetBase, WebFrameWidget, widget, true, true); 129 DEFINE_TYPE_CASTS(WebFrameWidgetBase, WebFrameWidget, widget, true, true);
119 130
120 } // namespace blink 131 } // namespace blink
121 132
122 #endif 133 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebFrameWidgetBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698