OSDN Git Service

am a574f648: am e829439d: Merge "Initialize correctly the maximum texture size in...
authorNicolas Roard <nicolas@android.com>
Tue, 1 Feb 2011 21:27:52 +0000 (13:27 -0800)
committerAndroid Git Automerger <android-git-automerger@android.com>
Tue, 1 Feb 2011 21:27:52 +0000 (13:27 -0800)
* commit 'a574f648c8332772bec307f83dc8c4e821b26100':
  Initialize correctly the maximum texture size in case it was not.

WebKit/android/jni/WebCoreFrameBridge.h
WebKit/android/jni/WebViewCore.cpp
WebKit/android/jni/WebViewCore.h

index ae62835..c705227 100644 (file)
@@ -128,15 +128,12 @@ class WebFrame : public WebCoreRefObject {
     void setCertificate(const std::string& issuedTo, const std::string& issuedBy, long long validNotBeforeMillis, long long validNotAfterMillis);
 
     /**
-     * When the user initiates an action (via trackball, key-press, or touch),
-     * we set mUserInitiatedAction to true.  If a load happens due to this click,
-     * then we ask the application if it wants to override
-     * the load. Otherwise, we attempt to load the resource internally.
+     * When the user initiates a click, we set mUserInitiatedAction to true.
+     * If a load happens due to this click, then we ask the application if it wants
+     * to override the load. Otherwise, we attempt to load the resource internally.
      */
     void setUserInitiatedAction(bool userInitiatedAction) { mUserInitiatedAction = userInitiatedAction; }
 
-    bool userInitiatedAction() { return mUserInitiatedAction; }
-    
     WebCore::Page* page() const { return mPage; }
 
     // Currently used only by the chrome net stack.  A similar field is used by
index 91c2ddb..cda157e 100644 (file)
@@ -343,6 +343,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
 #endif
     m_isPaused = false;
     m_screenOnCounter = 0;
+    m_onlyScrollIfImeIsShowing = false;
 
     LOG_ASSERT(m_mainFrame, "Uh oh, somehow a frameview was made without an initial frame!");
 
@@ -350,7 +351,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
     m_javaGlue = new JavaGlue;
     m_javaGlue->m_obj = env->NewWeakGlobalRef(javaWebViewCore);
     m_javaGlue->m_spawnScrollTo = GetJMethod(env, clazz, "contentSpawnScrollTo", "(II)V");
-    m_javaGlue->m_scrollTo = GetJMethod(env, clazz, "contentScrollTo", "(II)V");
+    m_javaGlue->m_scrollTo = GetJMethod(env, clazz, "contentScrollTo", "(IIZ)V");
     m_javaGlue->m_scrollBy = GetJMethod(env, clazz, "contentScrollBy", "(IIZ)V");
     m_javaGlue->m_contentDraw = GetJMethod(env, clazz, "contentDraw", "()V");
     m_javaGlue->m_layersDraw = GetJMethod(env, clazz, "layersDraw", "()V");
@@ -948,9 +949,11 @@ void WebViewCore::scrollTo(int x, int y, bool animate)
 //    LOGD("WebViewCore::scrollTo(%d %d)\n", x, y);
 
     JNIEnv* env = JSC::Bindings::getJNIEnv();
-    env->CallVoidMethod(m_javaGlue->object(env).get(),
-            animate ? m_javaGlue->m_spawnScrollTo : m_javaGlue->m_scrollTo,
-            x, y);
+    if (animate)
+        env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_spawnScrollTo, x, y);
+    else
+        env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_scrollTo,
+                x, y, m_onlyScrollIfImeIsShowing);
     checkException(env);
 }
 
@@ -1323,8 +1326,11 @@ void WebViewCore::setSizeScreenWidthAndScale(int width, int height,
     // If this was in response to touching a textfield and showing the IME,
     // the IME may now cover textfield.  Bring it back into view.
     // If the scale changed, however, this was the result of a zoom.
-    if (oldScale == m_scale)
+    if (oldScale == m_scale && osh > screenHeight) {
+        m_onlyScrollIfImeIsShowing = true;
         revealSelection();
+        m_onlyScrollIfImeIsShowing = false;
+    }
     // update the currently visible screen as perceived by the plugin
     sendPluginVisibleScreen();
 }
index 1457089..5820dc5 100644 (file)
@@ -610,6 +610,9 @@ namespace android {
         int m_blurringNodePointer;
         int m_lastFocusedSelStart;
         int m_lastFocusedSelEnd;
+        // Pass along with a scroll message to tell the UI thread to only
+        // scroll the page if the IME is showing.
+        bool m_onlyScrollIfImeIsShowing;
         PictureSet m_content; // the set of pictures to draw
         SkRegion m_addInval; // the accumulated inval region (not yet drawn)
         SkRegion m_rebuildInval; // the accumulated region for rebuilt pictures