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

Side by Side Diff: Source/core/rendering/RenderScrollbar.cpp

Issue 613503002: Move paint code for RenderScrollbar and RenderScrollbarPart into ScrollbarPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderScrollbar.h ('k') | Source/core/rendering/RenderScrollbarPart.h » ('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) 2008, 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } else if (partRenderer && !needRenderer) { 249 } else if (partRenderer && !needRenderer) {
250 m_parts.remove(partType); 250 m_parts.remove(partType);
251 partRenderer->destroy(); 251 partRenderer->destroy();
252 partRenderer = 0; 252 partRenderer = 0;
253 } 253 }
254 254
255 if (partRenderer) 255 if (partRenderer)
256 partRenderer->setStyle(partStyle.release()); 256 partRenderer->setStyle(partStyle.release());
257 } 257 }
258 258
259 void RenderScrollbar::paintPart(GraphicsContext* graphicsContext, ScrollbarPart partType, const IntRect& rect)
260 {
261 RenderScrollbarPart* partRenderer = m_parts.get(partType);
262 if (!partRenderer)
263 return;
264 partRenderer->paintIntoRect(graphicsContext, location(), rect);
265 }
266
267 IntRect RenderScrollbar::buttonRect(ScrollbarPart partType) 259 IntRect RenderScrollbar::buttonRect(ScrollbarPart partType)
268 { 260 {
269 RenderScrollbarPart* partRenderer = m_parts.get(partType); 261 RenderScrollbarPart* partRenderer = m_parts.get(partType);
270 if (!partRenderer) 262 if (!partRenderer)
271 return IntRect(); 263 return IntRect();
272 264
273 partRenderer->layout(); 265 partRenderer->layout();
274 266
275 bool isHorizontal = orientation() == HorizontalScrollbar; 267 bool isHorizontal = orientation() == HorizontalScrollbar;
276 if (partType == BackButtonStartPart) 268 if (partType == BackButtonStartPart)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 int RenderScrollbar::minimumThumbLength() 334 int RenderScrollbar::minimumThumbLength()
343 { 335 {
344 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart); 336 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart);
345 if (!partRenderer) 337 if (!partRenderer)
346 return 0; 338 return 0;
347 partRenderer->layout(); 339 partRenderer->layout();
348 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe nderer->height(); 340 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe nderer->height();
349 } 341 }
350 342
351 } 343 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderScrollbar.h ('k') | Source/core/rendering/RenderScrollbarPart.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698