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

Side by Side Diff: third_party/WebKit/Source/core/frame/WebFrameWidgetBase.h

Issue 2910233002: Do not fallback to FocusedOrMainFrame() in FocusedLocalFrameInWidget() (Closed)
Patch Set: Fixed a crashing test 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 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
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
dcheng 2017/06/01 04:20:49 NIt: colon instead of , before 'that'
EhsanK 2017/06/01 13:47:45 Done.
109 // is, a focused frame with the same local root as the one corresponding
110 // to this widget. It will return nullptr if no frame is focused or, the
dcheng 2017/06/01 04:20:49 Nit: no comma after or
EhsanK 2017/06/01 13:47:45 Done.
111 // focused frame has a different local root.
112 LocalFrame* FocusedLocalFrameInWidget() const;
dcheng 2017/06/01 04:20:49 Let's remove the "InWidget" part since this is a m
EhsanK 2017/06/01 13:47:45 Acknowledged.
113 LocalFrame* FocusedLocalFrameAvailableForIme() const;
dcheng 2017/06/01 04:20:49 Also, let's add some comments that document the be
EhsanK 2017/06/01 13:47:45 Agreed. However, I took a second look at usage of
114
108 // A copy of the web drop data object we received from the browser. 115 // A copy of the web drop data object we received from the browser.
109 Persistent<DataObject> current_drag_data_; 116 Persistent<DataObject> current_drag_data_;
110 117
111 bool doing_drag_and_drop_ = false; 118 bool doing_drag_and_drop_ = false;
112 119
113 // The available drag operations (copy, move link...) allowed by the source. 120 // The available drag operations (copy, move link...) allowed by the source.
114 WebDragOperation operations_allowed_ = kWebDragOperationNone; 121 WebDragOperation operations_allowed_ = kWebDragOperationNone;
115 122
116 // The current drag operation as negotiated by the source and destination. 123 // 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 124 // 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). 125 // current drop target in this WebView (the drop target can accept the drop).
119 WebDragOperation drag_operation_ = kWebDragOperationNone; 126 WebDragOperation drag_operation_ = kWebDragOperationNone;
120 127
121 // Helper function to process events while pointer locked. 128 // Helper function to process events while pointer locked.
122 void PointerLockMouseEvent(const WebCoalescedInputEvent&); 129 void PointerLockMouseEvent(const WebCoalescedInputEvent&);
123 130
131 // TODO(ekaramad): Can we remove this and make sure IME events are not called
132 // when there is no page focus?
133 // Represents whether or not this object should process incoming IME events.
134 bool ime_accept_events_ = true;
135
124 private: 136 private:
125 void CancelDrag(); 137 void CancelDrag();
126 LocalFrame* FocusedLocalFrameInWidget() const;
127 138
128 static bool ignore_input_events_; 139 static bool ignore_input_events_;
129 RefPtr<UserGestureToken> pointer_lock_gesture_token_; 140 RefPtr<UserGestureToken> pointer_lock_gesture_token_;
130 141
131 friend class WebViewImpl; 142 friend class WebViewImpl;
132 }; 143 };
133 144
134 DEFINE_TYPE_CASTS(WebFrameWidgetBase, WebFrameWidget, widget, true, true); 145 DEFINE_TYPE_CASTS(WebFrameWidgetBase, WebFrameWidget, widget, true, true);
135 146
136 } // namespace blink 147 } // namespace blink
137 148
138 #endif 149 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698