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

Side by Side Diff: third_party/WebKit/Source/core/paint/FramePainter.cpp

Issue 2741223002: Use correct ScrollbarTheme to paintScrollCorner (Closed)
Patch Set: determine theme in FramePainter::paintScrollCorner Created 3 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 | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "core/paint/FramePainter.h" 5 #include "core/paint/FramePainter.h"
6 6
7 #include "core/editing/markers/DocumentMarkerController.h" 7 #include "core/editing/markers/DocumentMarkerController.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/inspector/InspectorInstrumentation.h" 9 #include "core/inspector/InspectorInstrumentation.h"
10 #include "core/inspector/InspectorTraceEvents.h" 10 #include "core/inspector/InspectorTraceEvents.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 context, *frameView().layoutView(), DisplayItem::kScrollbarCorner, 221 context, *frameView().layoutView(), DisplayItem::kScrollbarCorner,
222 FloatRect(cornerRect)); 222 FloatRect(cornerRect));
223 context.fillRect(cornerRect, frameView().baseBackgroundColor()); 223 context.fillRect(cornerRect, frameView().baseBackgroundColor());
224 } 224 }
225 ScrollbarPainter::paintIntoRect(*frameView().scrollCorner(), context, 225 ScrollbarPainter::paintIntoRect(*frameView().scrollCorner(), context,
226 cornerRect.location(), 226 cornerRect.location(),
227 LayoutRect(cornerRect)); 227 LayoutRect(cornerRect));
228 return; 228 return;
229 } 229 }
230 230
231 ScrollbarTheme::theme().paintScrollCorner(context, *frameView().layoutView(), 231 ScrollbarTheme* theme = nullptr;
232 cornerRect); 232
233 if (frameView().horizontalScrollbar()) {
234 theme = &frameView().horizontalScrollbar()->theme();
235 } else if (frameView().verticalScrollbar()) {
236 theme = &frameView().verticalScrollbar()->theme();
237 } else {
238 NOTREACHED();
239 theme = &ScrollbarTheme::theme();
bokan 2017/03/13 21:33:52 style guide says don't handle failing DCHECKs: htt
240 }
241
242 theme->paintScrollCorner(context, *frameView().layoutView(), cornerRect);
233 } 243 }
234 244
235 void FramePainter::paintScrollbar(GraphicsContext& context, 245 void FramePainter::paintScrollbar(GraphicsContext& context,
236 Scrollbar& bar, 246 Scrollbar& bar,
237 const IntRect& rect) { 247 const IntRect& rect) {
238 bool needsBackground = 248 bool needsBackground =
239 bar.isCustomScrollbar() && frameView().frame().isMainFrame(); 249 bar.isCustomScrollbar() && frameView().frame().isMainFrame();
240 if (needsBackground) { 250 if (needsBackground) {
241 IntRect toFill = bar.frameRect(); 251 IntRect toFill = bar.frameRect();
242 toFill.intersect(rect); 252 toFill.intersect(rect);
243 context.fillRect(toFill, frameView().baseBackgroundColor()); 253 context.fillRect(toFill, frameView().baseBackgroundColor());
244 } 254 }
245 255
246 bar.paint(context, CullRect(rect)); 256 bar.paint(context, CullRect(rect));
247 } 257 }
248 258
249 const FrameView& FramePainter::frameView() { 259 const FrameView& FramePainter::frameView() {
250 DCHECK(m_frameView); 260 DCHECK(m_frameView);
251 return *m_frameView; 261 return *m_frameView;
252 } 262 }
253 263
254 } // namespace blink 264 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698