OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.content.ComponentCallbacks2; | 9 import android.content.ComponentCallbacks2; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1028 if (!wasPaused) onPause(); | 1028 if (!wasPaused) onPause(); |
1029 | 1029 |
1030 // Save injected JavaScript interfaces. | 1030 // Save injected JavaScript interfaces. |
1031 Map<String, Pair<Object, Class>> javascriptInterfaces = | 1031 Map<String, Pair<Object, Class>> javascriptInterfaces = |
1032 new HashMap<String, Pair<Object, Class>>(); | 1032 new HashMap<String, Pair<Object, Class>>(); |
1033 if (mContentViewCore != null) { | 1033 if (mContentViewCore != null) { |
1034 javascriptInterfaces.putAll(mContentViewCore.getJavascriptInterfaces ()); | 1034 javascriptInterfaces.putAll(mContentViewCore.getJavascriptInterfaces ()); |
1035 } | 1035 } |
1036 | 1036 |
1037 setNewAwContents(popupNativeAwContents); | 1037 setNewAwContents(popupNativeAwContents); |
1038 // We defer loading any URL on the popup until it has been properly inti alized (through | |
1039 // setNewAwContents). We resume the load here. | |
1040 nativeResumeLoadingCreatedPopupWebContents(popupNativeAwContents); | |
boliu
2015/10/30 16:17:13
nit: you can use mNativeAwContents here now
gsennton
2015/10/30 16:27:22
Done.
| |
1038 | 1041 |
1039 // Finally refresh all view state for mContentViewCore and mNativeAwCont ents. | 1042 // Finally refresh all view state for mContentViewCore and mNativeAwCont ents. |
1040 if (!wasPaused) onResume(); | 1043 if (!wasPaused) onResume(); |
1041 if (wasAttached) { | 1044 if (wasAttached) { |
1042 onAttachedToWindow(); | 1045 onAttachedToWindow(); |
1043 postInvalidateOnAnimation(); | 1046 postInvalidateOnAnimation(); |
1044 } | 1047 } |
1045 onSizeChanged(mContainerView.getWidth(), mContainerView.getHeight(), 0, 0); | 1048 onSizeChanged(mContainerView.getWidth(), mContainerView.getHeight(), 0, 0); |
1046 if (wasWindowVisible) setWindowVisibilityInternal(true); | 1049 if (wasWindowVisible) setWindowVisibilityInternal(true); |
1047 if (wasViewVisible) setViewVisibilityInternal(true); | 1050 if (wasViewVisible) setViewVisibilityInternal(true); |
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3228 | 3231 |
3229 private native void nativePreauthorizePermission(long nativeAwContents, Stri ng origin, | 3232 private native void nativePreauthorizePermission(long nativeAwContents, Stri ng origin, |
3230 long resources); | 3233 long resources); |
3231 | 3234 |
3232 private native void nativePostMessageToFrame(long nativeAwContents, String f rameId, | 3235 private native void nativePostMessageToFrame(long nativeAwContents, String f rameId, |
3233 String message, String targetOrigin, int[] msgPorts); | 3236 String message, String targetOrigin, int[] msgPorts); |
3234 | 3237 |
3235 private native void nativeCreateMessageChannel(long nativeAwContents, AwMess agePort[] ports); | 3238 private native void nativeCreateMessageChannel(long nativeAwContents, AwMess agePort[] ports); |
3236 | 3239 |
3237 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC ontents); | 3240 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC ontents); |
3241 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw Contents); | |
3238 } | 3242 } |
OLD | NEW |