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

Unified Diff: Source/core/rendering/RenderThemeChromiumMac.mm

Issue 235373005: Handle JS-created files in <input type="file">. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed visibility bug. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/forms/FileInputType.cpp ('k') | Source/modules/filesystem/DOMFileSystemSync.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderThemeChromiumMac.mm
diff --git a/Source/core/rendering/RenderThemeChromiumMac.mm b/Source/core/rendering/RenderThemeChromiumMac.mm
index 18da7d6ac2a113932e036b54a5b026bcd0205ac4..5fe39acf8ad709f25340e6a776be2ccbb941dd70 100644
--- a/Source/core/rendering/RenderThemeChromiumMac.mm
+++ b/Source/core/rendering/RenderThemeChromiumMac.mm
@@ -1763,7 +1763,11 @@ String RenderThemeChromiumMac::fileListNameForWidth(Locale& locale, const FileLi
if (fileList->isEmpty()) {
strToTruncate = locale.queryString(blink::WebLocalizedString::FileButtonNoFileSelectedLabel);
} else if (fileList->length() == 1) {
- strToTruncate = [[NSFileManager defaultManager] displayNameAtPath:(fileList->item(0)->path())];
+ File* file = fileList->item(0);
+ if (file->userVisibility() == File::IsUserVisible)
+ strToTruncate = [[NSFileManager defaultManager] displayNameAtPath:(fileList->item(0)->path())];
+ else
+ strToTruncate = file->name();
} else {
// FIXME: Localization of fileList->length().
return StringTruncator::rightTruncate(locale.queryString(blink::WebLocalizedString::MultipleFileUploadText, String::number(fileList->length())), width, font);
« no previous file with comments | « Source/core/html/forms/FileInputType.cpp ('k') | Source/modules/filesystem/DOMFileSystemSync.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698