diff options
-rw-r--r-- | WebCore/history/android/AndroidWebHistoryBridge.h | 12 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp | 4 | ||||
-rw-r--r-- | WebKit/android/jni/WebHistory.cpp | 29 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 4 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 2 |
5 files changed, 26 insertions, 25 deletions
diff --git a/WebCore/history/android/AndroidWebHistoryBridge.h b/WebCore/history/android/AndroidWebHistoryBridge.h index b320c4a..a827b4a 100644 --- a/WebCore/history/android/AndroidWebHistoryBridge.h +++ b/WebCore/history/android/AndroidWebHistoryBridge.h @@ -42,17 +42,17 @@ public: virtual ~AndroidWebHistoryBridge() { } virtual void updateHistoryItem(HistoryItem* item) = 0; - void setScale(int s) { m_scale = s; } - void setTextWrapScale(int s) { m_textWrapScale = s; } - int scale() const { return m_scale; } - int textWrapScale() const { return m_textWrapScale; } + void setScale(float s) { m_scale = s; } + void setTextWrapScale(float s) { m_textWrapScale = s; } + float scale() const { return m_scale; } + float textWrapScale() const { return m_textWrapScale; } void detachHistoryItem() { m_historyItem = 0; } HistoryItem* historyItem() const { return m_historyItem; } void setActive() { m_active = true; } protected: - int m_scale; - int m_textWrapScale; + float m_scale; + float m_textWrapScale; bool m_active; HistoryItem* m_historyItem; }; diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index c56348c..d165afa 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -814,8 +814,8 @@ void FrameLoaderClientAndroid::saveViewStateToItem(HistoryItem* item) { // store the current scale (only) for the top frame if (!m_frame->tree()->parent()) { WebViewCore* webViewCore = WebViewCore::getWebViewCore(m_frame->view()); - bridge->setScale((int)(webViewCore->scale() * 100)); - bridge->setTextWrapScale((int)(webViewCore->textWrapScale() * 100)); + bridge->setScale(webViewCore->scale()); + bridge->setTextWrapScale(webViewCore->textWrapScale()); } WebCore::notifyHistoryItemChanged(item); diff --git a/WebKit/android/jni/WebHistory.cpp b/WebKit/android/jni/WebHistory.cpp index d3893ff..e5b0346 100644 --- a/WebKit/android/jni/WebHistory.cpp +++ b/WebKit/android/jni/WebHistory.cpp @@ -415,12 +415,12 @@ static void write_item(WTF::Vector<char>& v, WebCore::HistoryItem* item) AndroidWebHistoryBridge* bridge = item->bridge(); LOG_ASSERT(bridge, "We should have a bridge here!"); // Screen scale - const int scale = bridge->scale(); - LOGV("Writing scale %d", scale); - v.append((char*)&scale, sizeof(int)); - const int textWrapScale = bridge->textWrapScale(); - LOGV("Writing text wrap scale %d", textWrapScale); - v.append((char*)&textWrapScale, sizeof(int)); + const float scale = bridge->scale(); + LOGV("Writing scale %f", scale); + v.append((char*)&scale, sizeof(float)); + const float textWrapScale = bridge->textWrapScale(); + LOGV("Writing text wrap scale %f", textWrapScale); + v.append((char*)&textWrapScale, sizeof(float)); // Document state const WTF::Vector<WTF::String>& docState = item->documentState(); @@ -596,15 +596,16 @@ static bool read_item_recursive(WebCore::HistoryItem* newItem, AndroidWebHistoryBridge* bridge = newItem->bridge(); LOG_ASSERT(bridge, "There should be a bridge object during inflate"); + float fValue; // Read the screen scale - memcpy(&l, data, sizeofUnsigned); - LOGV("Screen scale %d", l); - bridge->setScale(l); - data += sizeofUnsigned; - memcpy(&l, data, sizeofUnsigned); - LOGV("Text wrap scale %d", l); - bridge->setTextWrapScale(l); - data += sizeofUnsigned; + memcpy(&fValue, data, sizeof(float)); + LOGV("Screen scale %f", fValue); + bridge->setScale(fValue); + data += sizeof(float); + memcpy(&fValue, data, sizeofUnsigned); + LOGV("Text wrap scale %f", fValue); + bridge->setTextWrapScale(fValue); + data += sizeof(float); if (end - data < sizeofUnsigned) return false; diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index f7f1058..110ce94 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -361,7 +361,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_updateTextfield = GetJMethod(env, clazz, "updateTextfield", "(IZLjava/lang/String;I)V"); m_javaGlue->m_updateTextSelection = GetJMethod(env, clazz, "updateTextSelection", "(IIII)V"); m_javaGlue->m_clearTextEntry = GetJMethod(env, clazz, "clearTextEntry", "()V"); - m_javaGlue->m_restoreScale = GetJMethod(env, clazz, "restoreScale", "(II)V"); + m_javaGlue->m_restoreScale = GetJMethod(env, clazz, "restoreScale", "(FF)V"); m_javaGlue->m_needTouchEvents = GetJMethod(env, clazz, "needTouchEvents", "(Z)V"); m_javaGlue->m_requestKeyboard = GetJMethod(env, clazz, "requestKeyboard", "(Z)V"); m_javaGlue->m_requestKeyboardWithSelection = GetJMethod(env, clazz, "requestKeyboardWithSelection", "(IIII)V"); @@ -1053,7 +1053,7 @@ void WebViewCore::updateViewport() checkException(env); } -void WebViewCore::restoreScale(int scale, int textWrapScale) +void WebViewCore::restoreScale(float scale, float textWrapScale) { DEBUG_NAV_UI_LOGD("%s", __FUNCTION__); LOG_ASSERT(m_javaGlue->m_obj, "A Java widget was not associated with this view bridge!"); diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index fa474ce..ae5a65f 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -207,7 +207,7 @@ namespace android { * Notify the view to restore the screen width, which in turn restores * the scale. Also restore the scale for the text wrap. */ - void restoreScale(int scale, int textWrapScale); + void restoreScale(float scale, float textWrapScale); /** * Tell the java side to update the focused textfield |