| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 class LocalFrame; | 51 class LocalFrame; |
| 52 class Page; | 52 class Page; |
| 53 class DeprecatedPaintLayerCompositor; | 53 class DeprecatedPaintLayerCompositor; |
| 54 class UserGestureToken; | 54 class UserGestureToken; |
| 55 class WebCompositorAnimationTimeline; | 55 class WebCompositorAnimationTimeline; |
| 56 class WebLayer; | 56 class WebLayer; |
| 57 class WebLayerTreeView; | 57 class WebLayerTreeView; |
| 58 class WebMouseEvent; | 58 class WebMouseEvent; |
| 59 class WebMouseWheelEvent; | 59 class WebMouseWheelEvent; |
| 60 | 60 |
| 61 class WebFrameWidgetImpl final : public WebFrameWidget | 61 class WebFrameWidgetImpl final : public RefCountedWillBeGarbageCollectedFinalize
d<WebFrameWidgetImpl> |
| 62 , public PageWidgetEventHandler | 62 , public WebFrameWidget |
| 63 , public RefCounted<WebFrameWidgetImpl> { | 63 , public PageWidgetEventHandler { |
| 64 public: | 64 public: |
| 65 static WebFrameWidgetImpl* create(WebWidgetClient*, WebLocalFrame*); | 65 static WebFrameWidgetImpl* create(WebWidgetClient*, WebLocalFrame*); |
| 66 static HashSet<WebFrameWidgetImpl*>& allInstances(); | 66 static HashSet<WebFrameWidgetImpl*>& allInstances(); |
| 67 | 67 |
| 68 // WebWidget functions: | 68 // WebWidget functions: |
| 69 void close() override; | 69 void close() override; |
| 70 WebSize size() override; | 70 WebSize size() override; |
| 71 void willStartLiveResize() override; | 71 void willStartLiveResize() override; |
| 72 void resize(const WebSize&) override; | 72 void resize(const WebSize&) override; |
| 73 void resizeVisualViewport(const WebSize&) override; | 73 void resizeVisualViewport(const WebSize&) override; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 Page* page() const { return view()->page(); } | 141 Page* page() const { return view()->page(); } |
| 142 | 142 |
| 143 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } | 143 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } |
| 144 | 144 |
| 145 // Returns true if the event leads to scrolling. | 145 // Returns true if the event leads to scrolling. |
| 146 static bool mapKeyCodeForScroll( | 146 static bool mapKeyCodeForScroll( |
| 147 int keyCode, | 147 int keyCode, |
| 148 ScrollDirection*, | 148 ScrollDirection*, |
| 149 ScrollGranularity*); | 149 ScrollGranularity*); |
| 150 | 150 |
| 151 DECLARE_TRACE(); |
| 152 |
| 151 private: | 153 private: |
| 152 friend class WebFrameWidget; // For WebFrameWidget::create. | 154 friend class WebFrameWidget; // For WebFrameWidget::create. |
| 155 #if ENABLE(OILPAN) |
| 156 friend class GarbageCollectedFinalized<WebFrameWidgetImpl>; |
| 157 #else |
| 153 friend class WTF::RefCounted<WebFrameWidgetImpl>; | 158 friend class WTF::RefCounted<WebFrameWidgetImpl>; |
| 159 #endif |
| 154 | 160 |
| 155 explicit WebFrameWidgetImpl(WebWidgetClient*, WebLocalFrame*); | 161 explicit WebFrameWidgetImpl(WebWidgetClient*, WebLocalFrame*); |
| 156 ~WebFrameWidgetImpl(); | 162 ~WebFrameWidgetImpl(); |
| 157 | 163 |
| 158 // Returns true if the event was actually processed. | 164 // Returns true if the event was actually processed. |
| 159 bool keyEventDefault(const WebKeyboardEvent&); | 165 bool keyEventDefault(const WebKeyboardEvent&); |
| 160 | 166 |
| 161 // Returns true if the view was scrolled. | 167 // Returns true if the view was scrolled. |
| 162 bool scrollViewWithKeyboard(int keyCode, int modifiers); | 168 bool scrollViewWithKeyboard(int keyCode, int modifiers); |
| 163 | 169 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 178 bool handleGestureEvent(const WebGestureEvent&) override; | 184 bool handleGestureEvent(const WebGestureEvent&) override; |
| 179 bool handleKeyEvent(const WebKeyboardEvent&) override; | 185 bool handleKeyEvent(const WebKeyboardEvent&) override; |
| 180 bool handleCharEvent(const WebKeyboardEvent&) override; | 186 bool handleCharEvent(const WebKeyboardEvent&) override; |
| 181 | 187 |
| 182 WebViewImpl* view() const { return m_localRoot->viewImpl(); } | 188 WebViewImpl* view() const { return m_localRoot->viewImpl(); } |
| 183 | 189 |
| 184 WebWidgetClient* m_client; | 190 WebWidgetClient* m_client; |
| 185 | 191 |
| 186 // WebFrameWidget is associated with a subtree of the frame tree, correspond
ing to a maximal | 192 // WebFrameWidget is associated with a subtree of the frame tree, correspond
ing to a maximal |
| 187 // connected tree of LocalFrames. This member points to the root of that sub
tree. | 193 // connected tree of LocalFrames. This member points to the root of that sub
tree. |
| 188 WebLocalFrameImpl* m_localRoot; | 194 RawPtrWillBeMember<WebLocalFrameImpl> m_localRoot; |
| 189 | 195 |
| 190 WebSize m_size; | 196 WebSize m_size; |
| 191 | 197 |
| 192 // If set, the (plugin) node which has mouse capture. | 198 // If set, the (plugin) node which has mouse capture. |
| 193 RefPtrWillBePersistent<Node> m_mouseCaptureNode; | 199 RefPtrWillBeMember<Node> m_mouseCaptureNode; |
| 194 RefPtr<UserGestureToken> m_mouseCaptureGestureToken; | 200 RefPtr<UserGestureToken> m_mouseCaptureGestureToken; |
| 195 | 201 |
| 196 WebLayerTreeView* m_layerTreeView; | 202 WebLayerTreeView* m_layerTreeView; |
| 197 WebLayer* m_rootLayer; | 203 WebLayer* m_rootLayer; |
| 198 GraphicsLayer* m_rootGraphicsLayer; | 204 GraphicsLayer* m_rootGraphicsLayer; |
| 199 bool m_isAcceleratedCompositingActive; | 205 bool m_isAcceleratedCompositingActive; |
| 200 bool m_layerTreeViewClosed; | 206 bool m_layerTreeViewClosed; |
| 201 | 207 |
| 202 bool m_suppressNextKeypressEvent; | 208 bool m_suppressNextKeypressEvent; |
| 203 | 209 |
| 204 bool m_ignoreInputEvents; | 210 bool m_ignoreInputEvents; |
| 205 | 211 |
| 206 static const WebInputEvent* m_currentInputEvent; | 212 static const WebInputEvent* m_currentInputEvent; |
| 213 |
| 214 #if ENABLE(OILPAN) |
| 215 SelfKeepAlive<WebFrameWidgetImpl> m_selfKeepAlive; |
| 216 #endif |
| 207 }; | 217 }; |
| 208 | 218 |
| 209 DEFINE_TYPE_CASTS(WebFrameWidgetImpl, WebFrameWidget, widget, widget->forSubfram
e(), widget.forSubframe()); | 219 DEFINE_TYPE_CASTS(WebFrameWidgetImpl, WebFrameWidget, widget, widget->forSubfram
e(), widget.forSubframe()); |
| 210 | 220 |
| 211 } // namespace blink | 221 } // namespace blink |
| 212 | 222 |
| 213 #endif | 223 #endif |
| OLD | NEW |