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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 WebRange caretOrSelectionRange() override; | 107 WebRange caretOrSelectionRange() override; |
108 void setTextDirection(WebTextDirection) override; | 108 void setTextDirection(WebTextDirection) override; |
109 bool isAcceleratedCompositingActive() const override; | 109 bool isAcceleratedCompositingActive() const override; |
110 void willCloseLayerTreeView() override; | 110 void willCloseLayerTreeView() override; |
111 bool getCompositionCharacterBounds(WebVector<WebRect>& bounds) override; | 111 bool getCompositionCharacterBounds(WebVector<WebRect>& bounds) override; |
112 void setRemoteViewportIntersection(const WebRect&) override; | 112 void setRemoteViewportIntersection(const WebRect&) override; |
113 | 113 |
114 // WebFrameWidget implementation. | 114 // WebFrameWidget implementation. |
115 WebLocalFrameImpl* localRoot() const override { return m_localRoot; } | 115 WebLocalFrameImpl* localRoot() const override { return m_localRoot; } |
116 void setVisibilityState(WebPageVisibilityState) override; | 116 void setVisibilityState(WebPageVisibilityState) override; |
117 bool isTransparent() const override; | 117 void setBackgroundColorOverride(WebColor) override; |
118 void setIsTransparent(bool) override; | 118 void clearBackgroundColorOverride() override; |
| 119 void setBaseBackgroundColorOverride(WebColor) override; |
| 120 void clearBaseBackgroundColorOverride() override; |
119 void setBaseBackgroundColor(WebColor) override; | 121 void setBaseBackgroundColor(WebColor) override; |
120 WebInputMethodControllerImpl* getActiveWebInputMethodController() | 122 WebInputMethodControllerImpl* getActiveWebInputMethodController() |
121 const override; | 123 const override; |
122 | 124 |
123 Frame* focusedCoreFrame() const; | 125 Frame* focusedCoreFrame() const; |
124 | 126 |
125 // Returns the currently focused Element or null if no element has focus. | 127 // Returns the currently focused Element or null if no element has focus. |
126 Element* focusedElement() const; | 128 Element* focusedElement() const; |
127 | 129 |
128 PaintLayerCompositor* compositor() const; | 130 PaintLayerCompositor* compositor() const; |
(...skipping 15 matching lines...) Expand all Loading... |
144 void sendResizeEventAndRepaint(); | 146 void sendResizeEventAndRepaint(); |
145 | 147 |
146 void updateMainFrameLayoutSize(); | 148 void updateMainFrameLayoutSize(); |
147 | 149 |
148 // Event related methods: | 150 // Event related methods: |
149 void mouseContextMenu(const WebMouseEvent&); | 151 void mouseContextMenu(const WebMouseEvent&); |
150 | 152 |
151 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } | 153 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } |
152 GraphicsLayer* rootGraphicsLayer() const { return m_rootGraphicsLayer; }; | 154 GraphicsLayer* rootGraphicsLayer() const { return m_rootGraphicsLayer; }; |
153 | 155 |
154 Color baseBackgroundColor() const { return m_baseBackgroundColor; } | 156 Color baseBackgroundColor() const; |
155 | 157 |
156 DECLARE_TRACE(); | 158 DECLARE_TRACE(); |
157 | 159 |
158 private: | 160 private: |
159 friend class WebFrameWidget; // For WebFrameWidget::create. | 161 friend class WebFrameWidget; // For WebFrameWidget::create. |
160 | 162 |
161 explicit WebFrameWidgetImpl(WebWidgetClient*, WebLocalFrame*); | 163 explicit WebFrameWidgetImpl(WebWidgetClient*, WebLocalFrame*); |
162 | 164 |
163 // Perform a hit test for a point relative to the root frame of the page. | 165 // Perform a hit test for a point relative to the root frame of the page. |
164 HitTestResult hitTestResultForRootFramePos(const IntPoint& posInRootFrame); | 166 HitTestResult hitTestResultForRootFramePos(const IntPoint& posInRootFrame); |
165 | 167 |
166 void initializeLayerTreeView(); | 168 void initializeLayerTreeView(); |
167 | 169 |
168 void setIsAcceleratedCompositingActive(bool); | 170 void setIsAcceleratedCompositingActive(bool); |
169 void updateLayerTreeViewport(); | 171 void updateLayerTreeViewport(); |
170 void updateLayerTreeBackgroundColor(); | 172 void updateLayerTreeBackgroundColor(); |
171 void updateLayerTreeDeviceScaleFactor(); | 173 void updateLayerTreeDeviceScaleFactor(); |
| 174 void updateBaseBackgroundColor(); |
172 | 175 |
173 // PageWidgetEventHandler functions | 176 // PageWidgetEventHandler functions |
174 void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override; | 177 void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override; |
175 void handleMouseDown(LocalFrame&, const WebMouseEvent&) override; | 178 void handleMouseDown(LocalFrame&, const WebMouseEvent&) override; |
176 void handleMouseUp(LocalFrame&, const WebMouseEvent&) override; | 179 void handleMouseUp(LocalFrame&, const WebMouseEvent&) override; |
177 WebInputEventResult handleMouseWheel(LocalFrame&, | 180 WebInputEventResult handleMouseWheel(LocalFrame&, |
178 const WebMouseWheelEvent&) override; | 181 const WebMouseWheelEvent&) override; |
179 WebInputEventResult handleGestureEvent(const WebGestureEvent&) override; | 182 WebInputEventResult handleGestureEvent(const WebGestureEvent&) override; |
180 WebInputEventResult handleKeyEvent(const WebKeyboardEvent&) override; | 183 WebInputEventResult handleKeyEvent(const WebKeyboardEvent&) override; |
181 WebInputEventResult handleCharEvent(const WebKeyboardEvent&) override; | 184 WebInputEventResult handleCharEvent(const WebKeyboardEvent&) override; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 217 |
215 WebLayerTreeView* m_layerTreeView; | 218 WebLayerTreeView* m_layerTreeView; |
216 WebLayer* m_rootLayer; | 219 WebLayer* m_rootLayer; |
217 GraphicsLayer* m_rootGraphicsLayer; | 220 GraphicsLayer* m_rootGraphicsLayer; |
218 std::unique_ptr<CompositorAnimationHost> m_animationHost; | 221 std::unique_ptr<CompositorAnimationHost> m_animationHost; |
219 bool m_isAcceleratedCompositingActive; | 222 bool m_isAcceleratedCompositingActive; |
220 bool m_layerTreeViewClosed; | 223 bool m_layerTreeViewClosed; |
221 | 224 |
222 bool m_suppressNextKeypressEvent; | 225 bool m_suppressNextKeypressEvent; |
223 | 226 |
224 // Whether the WebFrameWidget is rendering transparently. | 227 bool m_backgroundColorOverrideEnabled; |
225 bool m_isTransparent; | 228 WebColor m_backgroundColorOverride; |
| 229 bool m_baseBackgroundColorOverrideEnabled; |
| 230 WebColor m_baseBackgroundColorOverride; |
226 | 231 |
227 // TODO(ekaramad): Can we remove this and make sure IME events are not called | 232 // TODO(ekaramad): Can we remove this and make sure IME events are not called |
228 // when there is no page focus? | 233 // when there is no page focus? |
229 // Represents whether or not this object should process incoming IME events. | 234 // Represents whether or not this object should process incoming IME events. |
230 bool m_imeAcceptEvents; | 235 bool m_imeAcceptEvents; |
231 | 236 |
232 static const WebInputEvent* m_currentInputEvent; | 237 static const WebInputEvent* m_currentInputEvent; |
233 | 238 |
234 WebColor m_baseBackgroundColor; | 239 WebColor m_baseBackgroundColor; |
235 | 240 |
236 SelfKeepAlive<WebFrameWidgetImpl> m_selfKeepAlive; | 241 SelfKeepAlive<WebFrameWidgetImpl> m_selfKeepAlive; |
237 }; | 242 }; |
238 | 243 |
239 DEFINE_TYPE_CASTS(WebFrameWidgetImpl, | 244 DEFINE_TYPE_CASTS(WebFrameWidgetImpl, |
240 WebFrameWidgetBase, | 245 WebFrameWidgetBase, |
241 widget, | 246 widget, |
242 widget->forSubframe(), | 247 widget->forSubframe(), |
243 widget.forSubframe()); | 248 widget.forSubframe()); |
244 | 249 |
245 } // namespace blink | 250 } // namespace blink |
246 | 251 |
247 #endif | 252 #endif |
OLD | NEW |