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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.h

Issue 1565893004: Sets a transparent background for out-of-process subframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile Created 4 years, 9 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
« no previous file with comments | « content/renderer/render_widget.cc ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 WebColor backgroundColor() const override; 108 WebColor backgroundColor() const override;
109 bool selectionBounds(WebRect& anchor, WebRect& focus) const override; 109 bool selectionBounds(WebRect& anchor, WebRect& focus) const override;
110 bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const override; 110 bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const override;
111 bool isSelectionAnchorFirst() const override; 111 bool isSelectionAnchorFirst() const override;
112 bool caretOrSelectionRange(size_t* location, size_t* length) override; 112 bool caretOrSelectionRange(size_t* location, size_t* length) override;
113 void setTextDirection(WebTextDirection) override; 113 void setTextDirection(WebTextDirection) override;
114 bool isAcceleratedCompositingActive() const override; 114 bool isAcceleratedCompositingActive() const override;
115 void willCloseLayerTreeView() override; 115 void willCloseLayerTreeView() override;
116 void didChangeWindowResizerRect() override; 116 void didChangeWindowResizerRect() override;
117 117
118 // WebFrameWidget implementation.
119 void setVisibilityState(WebPageVisibilityState, bool) override;
120 bool isTransparent() const override;
121 void setIsTransparent(bool) override;
122 void setBaseBackgroundColor(WebColor) override;
123 void scheduleAnimation() override;
124
118 WebWidgetClient* client() const { return m_client; } 125 WebWidgetClient* client() const { return m_client; }
119 126
120 Frame* focusedCoreFrame() const; 127 Frame* focusedCoreFrame() const;
121 128
122 // Returns the currently focused Element or null if no element has focus. 129 // Returns the currently focused Element or null if no element has focus.
123 Element* focusedElement() const; 130 Element* focusedElement() const;
124 131
125 void scheduleAnimation() override;
126
127 PaintLayerCompositor* compositor() const; 132 PaintLayerCompositor* compositor() const;
128 void setRootGraphicsLayer(GraphicsLayer*); 133 void setRootGraphicsLayer(GraphicsLayer*);
129 void attachCompositorAnimationTimeline(CompositorAnimationTimeline*); 134 void attachCompositorAnimationTimeline(CompositorAnimationTimeline*);
130 void detachCompositorAnimationTimeline(CompositorAnimationTimeline*); 135 void detachCompositorAnimationTimeline(CompositorAnimationTimeline*);
131 136
132 void setVisibilityState(WebPageVisibilityState, bool) override;
133
134 // Exposed for the purpose of overriding device metrics. 137 // Exposed for the purpose of overriding device metrics.
135 void sendResizeEventAndRepaint(); 138 void sendResizeEventAndRepaint();
136 139
137 void updateMainFrameLayoutSize(); 140 void updateMainFrameLayoutSize();
138 141
139 void setIgnoreInputEvents(bool newValue); 142 void setIgnoreInputEvents(bool newValue);
140 143
141 // Returns the page object associated with this widget. This may be null whe n 144 // Returns the page object associated with this widget. This may be null whe n
142 // the page is shutting down, but will be valid at all other times. 145 // the page is shutting down, but will be valid at all other times.
143 Page* page() const { return view()->page(); } 146 Page* page() const { return view()->page(); }
144 147
145 // Event related methods: 148 // Event related methods:
146 void mouseContextMenu(const WebMouseEvent&); 149 void mouseContextMenu(const WebMouseEvent&);
147 150
148 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } 151 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; }
149 152
150 // Returns true if the event leads to scrolling. 153 // Returns true if the event leads to scrolling.
151 static bool mapKeyCodeForScroll( 154 static bool mapKeyCodeForScroll(
152 int keyCode, 155 int keyCode,
153 ScrollDirection*, 156 ScrollDirection*,
154 ScrollGranularity*); 157 ScrollGranularity*);
155 158
159 Color baseBackgroundColor() const { return m_baseBackgroundColor; }
160
156 DECLARE_TRACE(); 161 DECLARE_TRACE();
157 162
158 private: 163 private:
159 friend class WebFrameWidget; // For WebFrameWidget::create. 164 friend class WebFrameWidget; // For WebFrameWidget::create.
160 #if ENABLE(OILPAN) 165 #if ENABLE(OILPAN)
161 friend class GarbageCollectedFinalized<WebFrameWidgetImpl>; 166 friend class GarbageCollectedFinalized<WebFrameWidgetImpl>;
162 #else 167 #else
163 friend class WTF::RefCounted<WebFrameWidgetImpl>; 168 friend class WTF::RefCounted<WebFrameWidgetImpl>;
164 #endif 169 #endif
165 170
166 explicit WebFrameWidgetImpl(WebWidgetClient*, WebLocalFrame*); 171 explicit WebFrameWidgetImpl(WebWidgetClient*, WebLocalFrame*);
167 ~WebFrameWidgetImpl(); 172 ~WebFrameWidgetImpl();
168 173
169 // Perform a hit test for a point relative to the root frame of the page. 174 // Perform a hit test for a point relative to the root frame of the page.
170 HitTestResult hitTestResultForRootFramePos(const IntPoint& posInRootFrame); 175 HitTestResult hitTestResultForRootFramePos(const IntPoint& posInRootFrame);
171 176
172 // Returns true if the event was actually processed. 177 // Returns true if the event was actually processed.
173 WebInputEventResult keyEventDefault(const WebKeyboardEvent&); 178 WebInputEventResult keyEventDefault(const WebKeyboardEvent&);
174 179
175 // Returns true if the view was scrolled. 180 // Returns true if the view was scrolled.
176 WebInputEventResult scrollViewWithKeyboard(int keyCode, int modifiers); 181 WebInputEventResult scrollViewWithKeyboard(int keyCode, int modifiers);
177 182
178 void initializeLayerTreeView(); 183 void initializeLayerTreeView();
179 184
180 void setIsAcceleratedCompositingActive(bool); 185 void setIsAcceleratedCompositingActive(bool);
181 void updateLayerTreeViewport(); 186 void updateLayerTreeViewport();
182 void updateLayerTreeBackgroundColor(); 187 void updateLayerTreeBackgroundColor();
183 void updateLayerTreeDeviceScaleFactor(); 188 void updateLayerTreeDeviceScaleFactor();
184 189
185 bool isTransparent() const;
186
187 // PageWidgetEventHandler functions 190 // PageWidgetEventHandler functions
188 void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override; 191 void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override;
189 void handleMouseDown(LocalFrame&, const WebMouseEvent&) override; 192 void handleMouseDown(LocalFrame&, const WebMouseEvent&) override;
190 void handleMouseUp(LocalFrame&, const WebMouseEvent&) override; 193 void handleMouseUp(LocalFrame&, const WebMouseEvent&) override;
191 WebInputEventResult handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) override; 194 WebInputEventResult handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) override;
192 WebInputEventResult handleGestureEvent(const WebGestureEvent&) override; 195 WebInputEventResult handleGestureEvent(const WebGestureEvent&) override;
193 WebInputEventResult handleKeyEvent(const WebKeyboardEvent&) override; 196 WebInputEventResult handleKeyEvent(const WebKeyboardEvent&) override;
194 WebInputEventResult handleCharEvent(const WebKeyboardEvent&) override; 197 WebInputEventResult handleCharEvent(const WebKeyboardEvent&) override;
195 198
196 WebViewImpl* view() const { return m_localRoot->viewImpl(); } 199 WebViewImpl* view() const { return m_localRoot->viewImpl(); }
(...skipping 13 matching lines...) Expand all
210 WebLayerTreeView* m_layerTreeView; 213 WebLayerTreeView* m_layerTreeView;
211 WebLayer* m_rootLayer; 214 WebLayer* m_rootLayer;
212 GraphicsLayer* m_rootGraphicsLayer; 215 GraphicsLayer* m_rootGraphicsLayer;
213 bool m_isAcceleratedCompositingActive; 216 bool m_isAcceleratedCompositingActive;
214 bool m_layerTreeViewClosed; 217 bool m_layerTreeViewClosed;
215 218
216 bool m_suppressNextKeypressEvent; 219 bool m_suppressNextKeypressEvent;
217 220
218 bool m_ignoreInputEvents; 221 bool m_ignoreInputEvents;
219 222
223 // Whether the WebFrameWidget is rendering transparently.
224 bool m_isTransparent;
225
220 static const WebInputEvent* m_currentInputEvent; 226 static const WebInputEvent* m_currentInputEvent;
221 227
228 WebColor m_baseBackgroundColor;
229
222 #if ENABLE(OILPAN) 230 #if ENABLE(OILPAN)
223 SelfKeepAlive<WebFrameWidgetImpl> m_selfKeepAlive; 231 SelfKeepAlive<WebFrameWidgetImpl> m_selfKeepAlive;
224 #endif 232 #endif
225 }; 233 };
226 234
227 DEFINE_TYPE_CASTS(WebFrameWidgetImpl, WebFrameWidget, widget, widget->forSubfram e(), widget.forSubframe()); 235 DEFINE_TYPE_CASTS(WebFrameWidgetImpl, WebFrameWidget, widget, widget->forSubfram e(), widget.forSubframe());
228 236
229 } // namespace blink 237 } // namespace blink
230 238
231 #endif 239 #endif
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698