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

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: split cc changes Created 4 years, 10 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 /* 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 setBackgroundColorOverride(WebColor) override;
124 WebColor backgroundColorOverride() const override { return m_backgroundColor Override; }
125 void scheduleAnimation() override;
126
118 WebWidgetClient* client() const { return m_client; } 127 WebWidgetClient* client() const { return m_client; }
119 128
120 Frame* focusedCoreFrame() const; 129 Frame* focusedCoreFrame() const;
121 130
122 // Returns the currently focused Element or null if no element has focus. 131 // Returns the currently focused Element or null if no element has focus.
123 Element* focusedElement() const; 132 Element* focusedElement() const;
124 133
125 void scheduleAnimation() override;
126
127 PaintLayerCompositor* compositor() const; 134 PaintLayerCompositor* compositor() const;
128 void setRootGraphicsLayer(GraphicsLayer*); 135 void setRootGraphicsLayer(GraphicsLayer*);
129 void attachCompositorAnimationTimeline(WebCompositorAnimationTimeline*); 136 void attachCompositorAnimationTimeline(WebCompositorAnimationTimeline*);
130 void detachCompositorAnimationTimeline(WebCompositorAnimationTimeline*); 137 void detachCompositorAnimationTimeline(WebCompositorAnimationTimeline*);
131 138
132 void setVisibilityState(WebPageVisibilityState, bool) override;
133
134 // Exposed for the purpose of overriding device metrics. 139 // Exposed for the purpose of overriding device metrics.
135 void sendResizeEventAndRepaint(); 140 void sendResizeEventAndRepaint();
136 141
137 void updateMainFrameLayoutSize(); 142 void updateMainFrameLayoutSize();
138 143
139 void setIgnoreInputEvents(bool newValue); 144 void setIgnoreInputEvents(bool newValue);
140 145
141 // Returns the page object associated with this widget. This may be null whe n 146 // 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. 147 // the page is shutting down, but will be valid at all other times.
143 Page* page() const { return view()->page(); } 148 Page* page() const { return view()->page(); }
144 149
145 // Event related methods: 150 // Event related methods:
146 void mouseContextMenu(const WebMouseEvent&); 151 void mouseContextMenu(const WebMouseEvent&);
147 152
148 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; } 153 WebLayerTreeView* layerTreeView() const { return m_layerTreeView; }
149 154
150 // Returns true if the event leads to scrolling. 155 // Returns true if the event leads to scrolling.
151 static bool mapKeyCodeForScroll( 156 static bool mapKeyCodeForScroll(
152 int keyCode, 157 int keyCode,
153 ScrollDirection*, 158 ScrollDirection*,
154 ScrollGranularity*); 159 ScrollGranularity*);
155 160
161 Color baseBackgroundColor() const { return m_baseBackgroundColor; }
162
156 DECLARE_TRACE(); 163 DECLARE_TRACE();
157 164
158 private: 165 private:
159 friend class WebFrameWidget; // For WebFrameWidget::create. 166 friend class WebFrameWidget; // For WebFrameWidget::create.
160 #if ENABLE(OILPAN) 167 #if ENABLE(OILPAN)
161 friend class GarbageCollectedFinalized<WebFrameWidgetImpl>; 168 friend class GarbageCollectedFinalized<WebFrameWidgetImpl>;
162 #else 169 #else
163 friend class WTF::RefCounted<WebFrameWidgetImpl>; 170 friend class WTF::RefCounted<WebFrameWidgetImpl>;
164 #endif 171 #endif
165 172
166 explicit WebFrameWidgetImpl(WebWidgetClient*, WebLocalFrame*); 173 explicit WebFrameWidgetImpl(WebWidgetClient*, WebLocalFrame*);
167 ~WebFrameWidgetImpl(); 174 ~WebFrameWidgetImpl();
168 175
169 // Perform a hit test for a point relative to the root frame of the page. 176 // Perform a hit test for a point relative to the root frame of the page.
170 HitTestResult hitTestResultForRootFramePos(const IntPoint& posInRootFrame); 177 HitTestResult hitTestResultForRootFramePos(const IntPoint& posInRootFrame);
171 178
172 // Returns true if the event was actually processed. 179 // Returns true if the event was actually processed.
173 WebInputEventResult keyEventDefault(const WebKeyboardEvent&); 180 WebInputEventResult keyEventDefault(const WebKeyboardEvent&);
174 181
175 // Returns true if the view was scrolled. 182 // Returns true if the view was scrolled.
176 WebInputEventResult scrollViewWithKeyboard(int keyCode, int modifiers); 183 WebInputEventResult scrollViewWithKeyboard(int keyCode, int modifiers);
177 184
178 void initializeLayerTreeView(); 185 void initializeLayerTreeView();
179 186
180 void setIsAcceleratedCompositingActive(bool); 187 void setIsAcceleratedCompositingActive(bool);
181 void updateLayerTreeViewport(); 188 void updateLayerTreeViewport();
182 void updateLayerTreeBackgroundColor(); 189 void updateLayerTreeBackgroundColor();
183 void updateLayerTreeDeviceScaleFactor(); 190 void updateLayerTreeDeviceScaleFactor();
184 191
185 bool isTransparent() const;
186
187 // PageWidgetEventHandler functions 192 // PageWidgetEventHandler functions
188 void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override; 193 void handleMouseLeave(LocalFrame&, const WebMouseEvent&) override;
189 void handleMouseDown(LocalFrame&, const WebMouseEvent&) override; 194 void handleMouseDown(LocalFrame&, const WebMouseEvent&) override;
190 void handleMouseUp(LocalFrame&, const WebMouseEvent&) override; 195 void handleMouseUp(LocalFrame&, const WebMouseEvent&) override;
191 WebInputEventResult handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) override; 196 WebInputEventResult handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) override;
192 WebInputEventResult handleGestureEvent(const WebGestureEvent&) override; 197 WebInputEventResult handleGestureEvent(const WebGestureEvent&) override;
193 WebInputEventResult handleKeyEvent(const WebKeyboardEvent&) override; 198 WebInputEventResult handleKeyEvent(const WebKeyboardEvent&) override;
194 WebInputEventResult handleCharEvent(const WebKeyboardEvent&) override; 199 WebInputEventResult handleCharEvent(const WebKeyboardEvent&) override;
195 200
196 WebViewImpl* view() const { return m_localRoot->viewImpl(); } 201 WebViewImpl* view() const { return m_localRoot->viewImpl(); }
(...skipping 13 matching lines...) Expand all
210 WebLayerTreeView* m_layerTreeView; 215 WebLayerTreeView* m_layerTreeView;
211 WebLayer* m_rootLayer; 216 WebLayer* m_rootLayer;
212 GraphicsLayer* m_rootGraphicsLayer; 217 GraphicsLayer* m_rootGraphicsLayer;
213 bool m_isAcceleratedCompositingActive; 218 bool m_isAcceleratedCompositingActive;
214 bool m_layerTreeViewClosed; 219 bool m_layerTreeViewClosed;
215 220
216 bool m_suppressNextKeypressEvent; 221 bool m_suppressNextKeypressEvent;
217 222
218 bool m_ignoreInputEvents; 223 bool m_ignoreInputEvents;
219 224
225 // Whether the WebFrameWidget is rendering transparently.
226 bool m_isTransparent;
227
220 static const WebInputEvent* m_currentInputEvent; 228 static const WebInputEvent* m_currentInputEvent;
221 229
230 WebColor m_baseBackgroundColor;
231 WebColor m_backgroundColorOverride;
232
222 #if ENABLE(OILPAN) 233 #if ENABLE(OILPAN)
223 SelfKeepAlive<WebFrameWidgetImpl> m_selfKeepAlive; 234 SelfKeepAlive<WebFrameWidgetImpl> m_selfKeepAlive;
224 #endif 235 #endif
225 }; 236 };
226 237
227 DEFINE_TYPE_CASTS(WebFrameWidgetImpl, WebFrameWidget, widget, widget->forSubfram e(), widget.forSubframe()); 238 DEFINE_TYPE_CASTS(WebFrameWidgetImpl, WebFrameWidget, widget, widget->forSubfram e(), widget.forSubframe());
228 239
229 } // namespace blink 240 } // namespace blink
230 241
231 #endif 242 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698