OLD | NEW |
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/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/clipboard/DataObject.h" | 9 #include "core/clipboard/DataObject.h" |
10 #include "core/dom/UserGestureIndicator.h" | 10 #include "core/dom/UserGestureIndicator.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 // Helper function to call VisualViewport::viewportToRootFrame(). | 104 // Helper function to call VisualViewport::viewportToRootFrame(). |
105 WebPoint ViewportToRootFrame(const WebPoint& point_in_viewport) const; | 105 WebPoint ViewportToRootFrame(const WebPoint& point_in_viewport) const; |
106 | 106 |
107 WebViewBase* View() const; | 107 WebViewBase* View() const; |
108 | 108 |
109 // Returns the page object associated with this widget. This may be null when | 109 // Returns the page object associated with this widget. This may be null when |
110 // the page is shutting down, but will be valid at all other times. | 110 // the page is shutting down, but will be valid at all other times. |
111 Page* GetPage() const; | 111 Page* GetPage() const; |
112 | 112 |
| 113 // This method returns the focused frame belonging to this WebWidget: that is |
| 114 // a focused frame with the same local root as the one corresponding to this |
| 115 // widget. It will return nullptr if no frame is focused or the focused frame |
| 116 // has a different local root. |
| 117 LocalFrame* FocusedLocalFrame() const; |
| 118 |
113 // A copy of the web drop data object we received from the browser. | 119 // A copy of the web drop data object we received from the browser. |
114 Persistent<DataObject> current_drag_data_; | 120 Persistent<DataObject> current_drag_data_; |
115 | 121 |
116 bool doing_drag_and_drop_ = false; | 122 bool doing_drag_and_drop_ = false; |
117 | 123 |
118 // The available drag operations (copy, move link...) allowed by the source. | 124 // The available drag operations (copy, move link...) allowed by the source. |
119 WebDragOperation operations_allowed_ = kWebDragOperationNone; | 125 WebDragOperation operations_allowed_ = kWebDragOperationNone; |
120 | 126 |
121 // The current drag operation as negotiated by the source and destination. | 127 // The current drag operation as negotiated by the source and destination. |
122 // When not equal to DragOperationNone, the drag data can be dropped onto the | 128 // When not equal to DragOperationNone, the drag data can be dropped onto the |
123 // current drop target in this WebView (the drop target can accept the drop). | 129 // current drop target in this WebView (the drop target can accept the drop). |
124 WebDragOperation drag_operation_ = kWebDragOperationNone; | 130 WebDragOperation drag_operation_ = kWebDragOperationNone; |
125 | 131 |
126 // Helper function to process events while pointer locked. | 132 // Helper function to process events while pointer locked. |
127 void PointerLockMouseEvent(const WebCoalescedInputEvent&); | 133 void PointerLockMouseEvent(const WebCoalescedInputEvent&); |
128 | 134 |
| 135 // TODO(ekaramad): Can we remove this and make sure IME events are not called |
| 136 // when there is no page focus? |
| 137 // Represents whether or not this object should process incoming IME events. |
| 138 bool ime_accept_events_ = true; |
| 139 |
129 private: | 140 private: |
130 void CancelDrag(); | 141 void CancelDrag(); |
131 LocalFrame* FocusedLocalFrameInWidget() const; | |
132 | 142 |
133 static bool ignore_input_events_; | 143 static bool ignore_input_events_; |
134 RefPtr<UserGestureToken> pointer_lock_gesture_token_; | 144 RefPtr<UserGestureToken> pointer_lock_gesture_token_; |
135 | 145 |
136 friend class WebViewImpl; | 146 friend class WebViewImpl; |
137 }; | 147 }; |
138 | 148 |
139 DEFINE_TYPE_CASTS(WebFrameWidgetBase, WebFrameWidget, widget, true, true); | 149 DEFINE_TYPE_CASTS(WebFrameWidgetBase, WebFrameWidget, widget, true, true); |
140 | 150 |
141 } // namespace blink | 151 } // namespace blink |
142 | 152 |
143 #endif | 153 #endif |
OLD | NEW |