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

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

Issue 463123003: Cleanup namespace usage in Source/core/rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 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
« no previous file with comments | « Source/core/rendering/RenderEmbeddedObject.cpp ('k') | Source/core/rendering/RenderLayer.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 /* 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 { 148 {
149 // Figure out how big the filename space needs to be for a given number of c haracters 149 // Figure out how big the filename space needs to be for a given number of c haracters
150 // (using "0" as the nominal character). 150 // (using "0" as the nominal character).
151 const UChar character = '0'; 151 const UChar character = '0';
152 const String characterAsString = String(&character, 1); 152 const String characterAsString = String(&character, 1);
153 const Font& font = style()->font(); 153 const Font& font = style()->font();
154 // FIXME: Remove the need for this const_cast by making constructTextRun tak e a const RenderObject*. 154 // FIXME: Remove the need for this const_cast by making constructTextRun tak e a const RenderObject*.
155 RenderFileUploadControl* renderer = const_cast<RenderFileUploadControl*>(thi s); 155 RenderFileUploadControl* renderer = const_cast<RenderFileUploadControl*>(thi s);
156 float minDefaultLabelWidth = defaultWidthNumChars * font.width(constructText Run(renderer, font, characterAsString, style(), TextRun::AllowTrailingExpansion) ); 156 float minDefaultLabelWidth = defaultWidthNumChars * font.width(constructText Run(renderer, font, characterAsString, style(), TextRun::AllowTrailingExpansion) );
157 157
158 const String label = toHTMLInputElement(node())->locale().queryString(blink: :WebLocalizedString::FileButtonNoFileSelectedLabel); 158 const String label = toHTMLInputElement(node())->locale().queryString(WebLoc alizedString::FileButtonNoFileSelectedLabel);
159 float defaultLabelWidth = font.width(constructTextRun(renderer, font, label, style(), TextRun::AllowTrailingExpansion)); 159 float defaultLabelWidth = font.width(constructTextRun(renderer, font, label, style(), TextRun::AllowTrailingExpansion));
160 if (HTMLInputElement* button = uploadButton()) 160 if (HTMLInputElement* button = uploadButton())
161 if (RenderObject* buttonRenderer = button->renderer()) 161 if (RenderObject* buttonRenderer = button->renderer())
162 defaultLabelWidth += buttonRenderer->maxPreferredLogicalWidth() + af terButtonSpacing; 162 defaultLabelWidth += buttonRenderer->maxPreferredLogicalWidth() + af terButtonSpacing;
163 maxLogicalWidth = static_cast<int>(ceilf(std::max(minDefaultLabelWidth, defa ultLabelWidth))); 163 maxLogicalWidth = static_cast<int>(ceilf(std::max(minDefaultLabelWidth, defa ultLabelWidth)));
164 164
165 if (!style()->width().isPercent()) 165 if (!style()->width().isPercent())
166 minLogicalWidth = maxLogicalWidth; 166 minLogicalWidth = maxLogicalWidth;
167 } 167 }
168 168
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 218 }
219 219
220 String RenderFileUploadControl::fileTextValue() const 220 String RenderFileUploadControl::fileTextValue() const
221 { 221 {
222 HTMLInputElement* input = toHTMLInputElement(node()); 222 HTMLInputElement* input = toHTMLInputElement(node());
223 ASSERT(input->files()); 223 ASSERT(input->files());
224 return RenderTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth()); 224 return RenderTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth());
225 } 225 }
226 226
227 } // namespace blink 227 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderEmbeddedObject.cpp ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698