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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutFileUploadControl.cpp

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 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) 2006, 2007, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 FileList* files = input->files(); 62 FileList* files = input->files();
63 ASSERT(files); 63 ASSERT(files);
64 if (files && files->isEmpty()) 64 if (files && files->isEmpty())
65 setShouldDoFullPaintInvalidation(); 65 setShouldDoFullPaintInvalidation();
66 } 66 }
67 67
68 int LayoutFileUploadControl::maxFilenameWidth() const { 68 int LayoutFileUploadControl::maxFilenameWidth() const {
69 int uploadButtonWidth = (uploadButton() && uploadButton()->layoutBox()) 69 int uploadButtonWidth = (uploadButton() && uploadButton()->layoutBox())
70 ? uploadButton()->layoutBox()->pixelSnappedWidth() 70 ? uploadButton()->layoutBox()->pixelSnappedWidth()
71 : 0; 71 : 0;
72 return std::max(0, contentBoxRect().pixelSnappedWidth() - uploadButtonWidth - 72 return std::max(0,
73 afterButtonSpacing); 73 contentBoxRect().pixelSnappedWidth() - uploadButtonWidth -
74 afterButtonSpacing);
74 } 75 }
75 76
76 void LayoutFileUploadControl::paintObject( 77 void LayoutFileUploadControl::paintObject(
77 const PaintInfo& paintInfo, 78 const PaintInfo& paintInfo,
78 const LayoutPoint& paintOffset) const { 79 const LayoutPoint& paintOffset) const {
79 FileUploadControlPainter(*this).paintObject(paintInfo, paintOffset); 80 FileUploadControlPainter(*this).paintObject(paintInfo, paintOffset);
80 } 81 }
81 82
82 void LayoutFileUploadControl::computeIntrinsicLogicalWidths( 83 void LayoutFileUploadControl::computeIntrinsicLogicalWidths(
83 LayoutUnit& minLogicalWidth, 84 LayoutUnit& minLogicalWidth,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 174 }
174 175
175 String LayoutFileUploadControl::fileTextValue() const { 176 String LayoutFileUploadControl::fileTextValue() const {
176 HTMLInputElement* input = toHTMLInputElement(node()); 177 HTMLInputElement* input = toHTMLInputElement(node());
177 ASSERT(input->files()); 178 ASSERT(input->files());
178 return LayoutTheme::theme().fileListNameForWidth( 179 return LayoutTheme::theme().fileListNameForWidth(
179 input->locale(), input->files(), style()->font(), maxFilenameWidth()); 180 input->locale(), input->files(), style()->font(), maxFilenameWidth());
180 } 181 }
181 182
182 } // namespace blink 183 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFieldset.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698