summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-12-16 10:23:52 -0500
committerLeon Scroggins <scroggo@google.com>2009-12-16 10:23:52 -0500
commit244d10fe2a0de787a558ea3a8bf02eb4c641bb50 (patch)
tree80a888723bcb2a424b194b25f22d2fe0d241d732 /WebKit/android
parent40a90188cf739cbcc2a44669c05ca526aaf0b0d8 (diff)
parent33cbb13803ce37ab3306b7ba46d2cc4a86cb9193 (diff)
downloadexternal_webkit-244d10fe2a0de787a558ea3a8bf02eb4c641bb50.zip
external_webkit-244d10fe2a0de787a558ea3a8bf02eb4c641bb50.tar.gz
external_webkit-244d10fe2a0de787a558ea3a8bf02eb4c641bb50.tar.bz2
resolved conflicts for merge of 33cbb138 to master
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp5
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.cpp52
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.h10
3 files changed, 55 insertions, 12 deletions
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index ae3d582..44c942d 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -44,6 +44,7 @@
#include "MIMETypeRegistry.h"
#include "NotImplemented.h"
#include "Page.h"
+#include "PlatformBridge.h"
#include "PlatformGraphicsContext.h"
#include "PlatformString.h"
#include "PluginDatabase.h"
@@ -300,11 +301,11 @@ void FrameLoaderClientAndroid::dispatchDidFailProvisionalLoad(const ResourceErro
AssetManager* am = globalAssetManager();
// Check to see if the error code was not generated internally
- WebFrame::RAW_RES_ID id = WebFrame::NODOMAIN;
+ WebCore::PlatformBridge::rawResId id = WebCore::PlatformBridge::NoDomain;
if ((error.errorCode() == ErrorFile ||
error.errorCode() == ErrorFileNotFound) &&
(!error.localizedDescription().isEmpty())) {
- id = WebFrame::LOADERROR;
+ id = WebCore::PlatformBridge::LoadError;
}
String filename = m_webFrame->getRawResourceFilename(id);
if (filename.isEmpty())
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp
index 79c686c..616be59 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -116,6 +116,49 @@
#include "TimeCounter.h"
#endif
+static String* gUploadFileLabel;
+static String* gResetLabel;
+static String* gSubmitLabel;
+
+String* WebCore::PlatformBridge::globalLocalizedName(
+ WebCore::PlatformBridge::rawResId resId)
+{
+ switch (resId) {
+ case WebCore::PlatformBridge::FileUploadLabel:
+ return gUploadFileLabel;
+ case WebCore::PlatformBridge::ResetLabel:
+ return gResetLabel;
+ case WebCore::PlatformBridge::SubmitLabel:
+ return gSubmitLabel;
+ default:
+ return 0;
+ }
+}
+/**
+ * Instantiate the localized name desired.
+ */
+void initGlobalLocalizedName(WebCore::PlatformBridge::rawResId resId,
+ android::WebFrame* webFrame)
+{
+ String** pointer;
+ switch (resId) {
+ case WebCore::PlatformBridge::FileUploadLabel:
+ pointer = &gUploadFileLabel;
+ break;
+ case WebCore::PlatformBridge::ResetLabel:
+ pointer = &gResetLabel;
+ break;
+ case WebCore::PlatformBridge::SubmitLabel:
+ pointer = &gSubmitLabel;
+ break;
+ default:
+ return;
+ }
+ if (!(*pointer) && webFrame) {
+ (*pointer) = new String(webFrame->getRawResourceFilename(resId).impl());
+ }
+}
+
namespace android {
// ----------------------------------------------------------------------------
@@ -777,7 +820,7 @@ WebFrame::decidePolicyForFormResubmission(WebCore::FramePolicyFunction func)
}
WebCore::String
-WebFrame::getRawResourceFilename(RAW_RES_ID id) const
+WebFrame::getRawResourceFilename(WebCore::PlatformBridge::rawResId id) const
{
JNIEnv* env = JSC::Bindings::getJNIEnv();
jstring ret = (jstring) env->CallObjectMethod(mJavaFrame->frame(env).get(),
@@ -873,7 +916,8 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss
// Set the mNativeFrame field in Frame
SET_NATIVE_FRAME(env, obj, (int)frame);
- String directory = webFrame->getRawResourceFilename(WebFrame::DRAWABLEDIR);
+ String directory = webFrame->getRawResourceFilename(
+ WebCore::PlatformBridge::DrawableDir);
if (directory.isEmpty())
LOGE("Can't find the drawable directory");
else {
@@ -882,6 +926,10 @@ static void CreateFrame(JNIEnv* env, jobject obj, jobject javaview, jobject jAss
// Initialize our skinning classes
WebCore::RenderSkinAndroid::Init(am, directory);
}
+ for (int i = WebCore::PlatformBridge::FileUploadLabel;
+ i <= WebCore::PlatformBridge::SubmitLabel; i++)
+ initGlobalLocalizedName(
+ static_cast<WebCore::PlatformBridge::rawResId>(i), webFrame);
}
static void DestroyFrame(JNIEnv* env, jobject obj)
diff --git a/WebKit/android/jni/WebCoreFrameBridge.h b/WebKit/android/jni/WebCoreFrameBridge.h
index 7d18c40..657ebf1 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.h
+++ b/WebKit/android/jni/WebCoreFrameBridge.h
@@ -29,7 +29,7 @@
#define WEBFRAME_H
#include "FrameLoaderClient.h"
-#include "PlatformString.h"
+#include "PlatformBridge.h"
#include "WebCoreRefObject.h"
#include <jni.h>
#include <wtf/RefCounted.h>
@@ -51,12 +51,6 @@ class WebViewCore;
// one instance of WebFrame per Page for calling into Java's BrowserFrame
class WebFrame : public WebCoreRefObject {
public:
- // these ids need to be in sync with the constants in BrowserFrame.java
- enum RAW_RES_ID {
- NODOMAIN = 1,
- LOADERROR,
- DRAWABLEDIR,
- };
WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page* page);
~WebFrame();
@@ -108,7 +102,7 @@ class WebFrame : public WebCoreRefObject {
void setUserAgent(WebCore::String userAgent) { mUserAgent = userAgent; }
- WebCore::String getRawResourceFilename(RAW_RES_ID) const;
+ WebCore::String getRawResourceFilename(WebCore::PlatformBridge::rawResId) const;
float density() const;