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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 postInvalidateOnAnimation(); | 821 postInvalidateOnAnimation(); |
822 } | 822 } |
823 onSizeChanged(mContainerView.getWidth(), mContainerView.getHeight(), 0,
0); | 823 onSizeChanged(mContainerView.getWidth(), mContainerView.getHeight(), 0,
0); |
824 if (wasWindowVisible) setWindowVisibilityInternal(true); | 824 if (wasWindowVisible) setWindowVisibilityInternal(true); |
825 if (wasViewVisible) setViewVisibilityInternal(true); | 825 if (wasViewVisible) setViewVisibilityInternal(true); |
826 if (wasWindowFocused) onWindowFocusChanged(wasWindowFocused); | 826 if (wasWindowFocused) onWindowFocusChanged(wasWindowFocused); |
827 if (wasFocused) onFocusChanged(true, 0, null); | 827 if (wasFocused) onFocusChanged(true, 0, null); |
828 | 828 |
829 // Restore injected JavaScript interfaces. | 829 // Restore injected JavaScript interfaces. |
830 for (Map.Entry<String, Pair<Object, Class>> entry : javascriptInterfaces
.entrySet()) { | 830 for (Map.Entry<String, Pair<Object, Class>> entry : javascriptInterfaces
.entrySet()) { |
| 831 @SuppressWarnings("unchecked") |
| 832 Class<? extends Annotation> requiredAnnotation = (Class<? extends An
notation>) |
| 833 entry.getValue().second; |
831 mContentViewCore.addPossiblyUnsafeJavascriptInterface( | 834 mContentViewCore.addPossiblyUnsafeJavascriptInterface( |
832 entry.getValue().first, | 835 entry.getValue().first, |
833 entry.getKey(), | 836 entry.getKey(), |
834 entry.getValue().second); | 837 requiredAnnotation); |
835 } | 838 } |
836 } | 839 } |
837 | 840 |
838 /** | 841 /** |
839 * Deletes the native counterpart of this object. | 842 * Deletes the native counterpart of this object. |
840 */ | 843 */ |
841 public void destroy() { | 844 public void destroy() { |
842 if (mCleanupReference != null) { | 845 if (mCleanupReference != null) { |
843 assert mNativeAwContents != 0; | 846 assert mNativeAwContents != 0; |
844 // If we are attached, we have to call native detach to clean up | 847 // If we are attached, we have to call native detach to clean up |
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2484 | 2487 |
2485 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); | 2488 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); |
2486 | 2489 |
2487 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); | 2490 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); |
2488 | 2491 |
2489 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); | 2492 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); |
2490 | 2493 |
2491 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, | 2494 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, |
2492 long resources); | 2495 long resources); |
2493 } | 2496 } |
OLD | NEW |