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