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

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

Issue 21430003: Implement interfaces in PaintInfo and make it a class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@getterPaintInfo01
Patch Set: Second try Created 7 years, 4 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) 2006, 2007, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 RenderStyle* RenderTextControlSingleLine::textBaseStyle() const 59 RenderStyle* RenderTextControlSingleLine::textBaseStyle() const
60 { 60 {
61 HTMLElement* innerBlock = innerBlockElement(); 61 HTMLElement* innerBlock = innerBlockElement();
62 return innerBlock ? innerBlock->renderer()->style() : style(); 62 return innerBlock ? innerBlock->renderer()->style() : style();
63 } 63 }
64 64
65 void RenderTextControlSingleLine::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 65 void RenderTextControlSingleLine::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
66 { 66 {
67 RenderTextControl::paint(paintInfo, paintOffset); 67 RenderTextControl::paint(paintInfo, paintOffset);
68 68
69 if (paintInfo.phase == PaintPhaseBlockBackground && m_shouldDrawCapsLockIndi cator) { 69 if (paintInfo.getPhase() == PaintPhaseBlockBackground && m_shouldDrawCapsLoc kIndicator) {
70 LayoutRect contentsRect = contentBoxRect(); 70 LayoutRect contentsRect = contentBoxRect();
71 71
72 // Center in the block progression direction. 72 // Center in the block progression direction.
73 if (isHorizontalWritingMode()) 73 if (isHorizontalWritingMode())
74 contentsRect.setY((height() - contentsRect.height()) / 2); 74 contentsRect.setY((height() - contentsRect.height()) / 2);
75 else 75 else
76 contentsRect.setX((width() - contentsRect.width()) / 2); 76 contentsRect.setX((width() - contentsRect.width()) / 2);
77 77
78 // Convert the rect into the coords used for painting the content 78 // Convert the rect into the coords used for painting the content
79 contentsRect.moveBy(paintOffset + location()); 79 contentsRect.moveBy(paintOffset + location());
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 return true; 459 return true;
460 return RenderBlock::logicalScroll(direction, granularity, multiplier, stopNo de); 460 return RenderBlock::logicalScroll(direction, granularity, multiplier, stopNo de);
461 } 461 }
462 462
463 HTMLInputElement* RenderTextControlSingleLine::inputElement() const 463 HTMLInputElement* RenderTextControlSingleLine::inputElement() const
464 { 464 {
465 return toHTMLInputElement(node()); 465 return toHTMLInputElement(node());
466 } 466 }
467 467
468 } 468 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698