summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebCore/platform/android/FileChooserAndroid.cpp6
-rw-r--r--WebCore/platform/android/LocalizedStringsAndroid.cpp4
-rw-r--r--WebCore/platform/android/PlatformBridge.h3
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.cpp9
4 files changed, 16 insertions, 6 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);
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp
index d1efe07..de172cd 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -116,6 +116,7 @@ using namespace JSC::Bindings;
static String* gUploadFileLabel;
static String* gResetLabel;
static String* gSubmitLabel;
+static String* gNoFileChosenLabel;
String* WebCore::PlatformBridge::globalLocalizedName(
WebCore::PlatformBridge::rawResId resId)
@@ -127,6 +128,9 @@ String* WebCore::PlatformBridge::globalLocalizedName(
return gResetLabel;
case WebCore::PlatformBridge::SubmitLabel:
return gSubmitLabel;
+ case WebCore::PlatformBridge::FileUploadNoFileChosenLabel:
+ return gNoFileChosenLabel;
+
default:
return 0;
}
@@ -148,6 +152,9 @@ void initGlobalLocalizedName(WebCore::PlatformBridge::rawResId resId,
case WebCore::PlatformBridge::SubmitLabel:
pointer = &gSubmitLabel;
break;
+ case WebCore::PlatformBridge::FileUploadNoFileChosenLabel:
+ pointer = &gNoFileChosenLabel;
+ break;
default:
return;
}
@@ -927,7 +934,7 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss
WebCore::RenderSkinAndroid::Init(am, directory);
}
for (int i = WebCore::PlatformBridge::FileUploadLabel;
- i <= WebCore::PlatformBridge::SubmitLabel; i++)
+ i <= WebCore::PlatformBridge::FileUploadNoFileChosenLabel; i++)
initGlobalLocalizedName(
static_cast<WebCore::PlatformBridge::rawResId>(i), webFrame);
}