Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 11428070: Some required fixes for HTMLViewer rotate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix title callback. Merge new test intol existing title test. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/SaveRestoreStateTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 2d831718261da54f7530e452f1de5ef537ddff18..4bbf357a878a127187367d75093bee3dcb73df43 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -536,12 +536,12 @@ public class AwContents {
boolean rv = mContentViewCore.onTouchEvent(event);
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
- int actionIndex = event.getActionIndex();
+ int actionIndex = event.getActionIndex();
- // Note this will trigger IPC back to browser even if nothing is hit.
- nativeRequestNewHitTestDataAt(mNativeAwContents,
- Math.round(event.getX(actionIndex)),
- Math.round(event.getY(actionIndex)));
+ // Note this will trigger IPC back to browser even if nothing is hit.
+ nativeRequestNewHitTestDataAt(mNativeAwContents,
+ Math.round(event.getX(actionIndex)),
+ Math.round(event.getY(actionIndex)));
}
return rv;
@@ -575,12 +575,18 @@ public class AwContents {
mContentViewCore.onAttachedToWindow();
nativeOnAttachedToWindow(mNativeAwContents, mContainerView.getWidth(),
mContainerView.getHeight());
+
+ // This is for the case where this is created by restoreState, which
+ // needs to call to NavigationController::LoadIfNecessary to actually
+ // load the restored page.
+ if (!mIsPaused) onResume();
}
/**
* @see android.view.View#onDetachedFromWindow()
*/
public void onDetachedFromWindow() {
+ if (mNativeAwContents == 0) return;
nativeOnDetachedFromWindow(mNativeAwContents);
mContentViewCore.onDetachedFromWindow();
}
@@ -659,7 +665,15 @@ public class AwContents {
byte[] state = inState.getByteArray(SAVE_RESTORE_STATE_KEY);
if (state == null) return false;
- return nativeRestoreFromOpaqueState(mNativeAwContents, state);
+ boolean result = nativeRestoreFromOpaqueState(mNativeAwContents, state);
+
+ // The onUpdateTitle callback normally happens when a page is loaded,
+ // but is optimized out in the restoreState case because the title is
+ // already restored. See WebContentsImpl::UpdateTitleForEntry. So we
+ // call the callback explicitly here.
+ if (result) mContentsClient.onUpdateTitle(mContentViewCore.getTitle());
+
+ return result;
}
//--------------------------------------------------------------------------------------------
« no previous file with comments | « no previous file | android_webview/javatests/src/org/chromium/android_webview/test/SaveRestoreStateTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698