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

Side by Side Diff: Source/core/layout/LayoutTextControlSingleLine.cpp

Issue 1102353008: Split ThemePainter out of LayoutTheme (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: themePainter() -> theme().painter() Created 5 years, 7 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/layout/LayoutMediaControls.cpp ('k') | Source/core/layout/LayoutTheme.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) 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 17 matching lines...) Expand all
28 #include "core/InputTypeNames.h" 28 #include "core/InputTypeNames.h"
29 #include "core/dom/shadow/ShadowRoot.h" 29 #include "core/dom/shadow/ShadowRoot.h"
30 #include "core/editing/FrameSelection.h" 30 #include "core/editing/FrameSelection.h"
31 #include "core/frame/LocalFrame.h" 31 #include "core/frame/LocalFrame.h"
32 #include "core/html/shadow/ShadowElementNames.h" 32 #include "core/html/shadow/ShadowElementNames.h"
33 #include "core/layout/HitTestResult.h" 33 #include "core/layout/HitTestResult.h"
34 #include "core/layout/LayoutAnalyzer.h" 34 #include "core/layout/LayoutAnalyzer.h"
35 #include "core/layout/LayoutTheme.h" 35 #include "core/layout/LayoutTheme.h"
36 #include "core/paint/DeprecatedPaintLayer.h" 36 #include "core/paint/DeprecatedPaintLayer.h"
37 #include "core/paint/PaintInfo.h" 37 #include "core/paint/PaintInfo.h"
38 #include "core/paint/ThemePainter.h"
38 #include "platform/PlatformKeyboardEvent.h" 39 #include "platform/PlatformKeyboardEvent.h"
39 #include "platform/fonts/SimpleFontData.h" 40 #include "platform/fonts/SimpleFontData.h"
40 41
41 namespace blink { 42 namespace blink {
42 43
43 using namespace HTMLNames; 44 using namespace HTMLNames;
44 45
45 LayoutTextControlSingleLine::LayoutTextControlSingleLine(HTMLInputElement* eleme nt) 46 LayoutTextControlSingleLine::LayoutTextControlSingleLine(HTMLInputElement* eleme nt)
46 : LayoutTextControl(element) 47 : LayoutTextControl(element)
47 , m_shouldDrawCapsLockIndicator(false) 48 , m_shouldDrawCapsLockIndicator(false)
(...skipping 28 matching lines...) Expand all
76 LayoutRect contentsRect = contentBoxRect(); 77 LayoutRect contentsRect = contentBoxRect();
77 78
78 // Center in the block progression direction. 79 // Center in the block progression direction.
79 if (isHorizontalWritingMode()) 80 if (isHorizontalWritingMode())
80 contentsRect.setY((size().height() - contentsRect.height()) / 2); 81 contentsRect.setY((size().height() - contentsRect.height()) / 2);
81 else 82 else
82 contentsRect.setX((size().width() - contentsRect.width()) / 2); 83 contentsRect.setX((size().width() - contentsRect.width()) / 2);
83 84
84 // Convert the rect into the coords used for painting the content 85 // Convert the rect into the coords used for painting the content
85 contentsRect.moveBy(paintOffset + location()); 86 contentsRect.moveBy(paintOffset + location());
86 LayoutTheme::theme().paintCapsLockIndicator(this, paintInfo, pixelSnappe dIntRect(contentsRect)); 87 LayoutTheme::theme().painter().paintCapsLockIndicator(this, paintInfo, p ixelSnappedIntRect(contentsRect));
87 } 88 }
88 } 89 }
89 90
90 LayoutUnit LayoutTextControlSingleLine::computeLogicalHeightLimit() const 91 LayoutUnit LayoutTextControlSingleLine::computeLogicalHeightLimit() const
91 { 92 {
92 return containerElement() ? contentLogicalHeight() : logicalHeight(); 93 return containerElement() ? contentLogicalHeight() : logicalHeight();
93 } 94 }
94 95
95 void LayoutTextControlSingleLine::layout() 96 void LayoutTextControlSingleLine::layout()
96 { 97 {
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 if (innerEditorElement()) 439 if (innerEditorElement())
439 innerEditorElement()->setScrollTop(newTop); 440 innerEditorElement()->setScrollTop(newTop);
440 } 441 }
441 442
442 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const 443 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const
443 { 444 {
444 return toHTMLInputElement(node()); 445 return toHTMLInputElement(node());
445 } 446 }
446 447
447 } 448 }
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutMediaControls.cpp ('k') | Source/core/layout/LayoutTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698