diff options
author | Ben Murdoch <benm@google.com> | 2010-05-18 16:16:01 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-05-21 10:18:19 +0100 |
commit | b28fa785df693bd46895ae9900810daf38c24bfa (patch) | |
tree | 4d91d4376f43db186a0b0c9f6b5b7b3198583e51 /WebCore | |
parent | bdd6b8c62ee90e4130018ec1c58f350fe4021999 (diff) | |
download | external_webkit-b28fa785df693bd46895ae9900810daf38c24bfa.zip external_webkit-b28fa785df693bd46895ae9900810daf38c24bfa.tar.gz external_webkit-b28fa785df693bd46895ae9900810daf38c24bfa.tar.bz2 |
Provide a string for the case where a file upload control has not had a file attached to it.
Requires a frameworks/base change.
Change-Id: Ia50d4b8cceb943166198888dad364b09a2dc06a1
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/platform/android/FileChooserAndroid.cpp | 6 | ||||
-rw-r--r-- | WebCore/platform/android/LocalizedStringsAndroid.cpp | 4 | ||||
-rw-r--r-- | WebCore/platform/android/PlatformBridge.h | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/WebCore/platform/android/FileChooserAndroid.cpp b/WebCore/platform/android/FileChooserAndroid.cpp index 9e50e67..f2ad3b9 100644 --- a/WebCore/platform/android/FileChooserAndroid.cpp +++ b/WebCore/platform/android/FileChooserAndroid.cpp @@ -27,6 +27,7 @@ #include "FileChooser.h" #include "FileSystem.h" #include "Font.h" +#include "LocalizedStrings.h" #include "StringTruncator.h" namespace WebCore { @@ -34,9 +35,10 @@ namespace WebCore { String FileChooser::basenameForWidth(const Font& font, int width) const { if (!m_filenames.size()) - return String(); + return fileButtonNoFileSelectedLabel(); + String output = pathGetFileName(m_filenames[0]); - return StringTruncator::rightTruncate(output, static_cast<float>(width), font, false); + return StringTruncator::centerTruncate(output, static_cast<float>(width), font, false); } } // namespace WebCore diff --git a/WebCore/platform/android/LocalizedStringsAndroid.cpp b/WebCore/platform/android/LocalizedStringsAndroid.cpp index e0db88d..5ca7fa2 100644 --- a/WebCore/platform/android/LocalizedStringsAndroid.cpp +++ b/WebCore/platform/android/LocalizedStringsAndroid.cpp @@ -48,8 +48,8 @@ String fileButtonChooseFileLabel() String fileButtonNoFileSelectedLabel() { - notImplemented(); - return String(); + return *(PlatformBridge::globalLocalizedName( + PlatformBridge::FileUploadNoFileChosenLabel)); } String contextMenuItemTagInspectElement() diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h index cdd22f3..33f8697 100644 --- a/WebCore/platform/android/PlatformBridge.h +++ b/WebCore/platform/android/PlatformBridge.h @@ -119,7 +119,8 @@ public: DrawableDir, FileUploadLabel, ResetLabel, - SubmitLabel + SubmitLabel, + FileUploadNoFileChosenLabel }; static String* globalLocalizedName(rawResId resId); |