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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 import org.chromium.content.browser.ContentViewClient; | 49 import org.chromium.content.browser.ContentViewClient; |
50 import org.chromium.content.browser.ContentViewCore; | 50 import org.chromium.content.browser.ContentViewCore; |
51 import org.chromium.content.browser.ContentViewStatics; | 51 import org.chromium.content.browser.ContentViewStatics; |
52 import org.chromium.content.browser.LoadUrlParams; | 52 import org.chromium.content.browser.LoadUrlParams; |
53 import org.chromium.content.browser.NavigationHistory; | 53 import org.chromium.content.browser.NavigationHistory; |
54 import org.chromium.content.browser.PageTransitionTypes; | 54 import org.chromium.content.browser.PageTransitionTypes; |
55 import org.chromium.content.browser.WebContentsObserverAndroid; | 55 import org.chromium.content.browser.WebContentsObserverAndroid; |
56 import org.chromium.content.common.CleanupReference; | 56 import org.chromium.content.common.CleanupReference; |
57 import org.chromium.content_public.Referrer; | 57 import org.chromium.content_public.Referrer; |
58 import org.chromium.content_public.browser.GestureStateListener; | 58 import org.chromium.content_public.browser.GestureStateListener; |
| 59 import org.chromium.content_public.browser.JavaScriptCallback; |
59 import org.chromium.ui.base.ActivityWindowAndroid; | 60 import org.chromium.ui.base.ActivityWindowAndroid; |
60 import org.chromium.ui.base.WindowAndroid; | 61 import org.chromium.ui.base.WindowAndroid; |
61 import org.chromium.ui.gfx.DeviceDisplayInfo; | 62 import org.chromium.ui.gfx.DeviceDisplayInfo; |
62 | 63 |
63 import java.io.File; | 64 import java.io.File; |
64 import java.lang.annotation.Annotation; | 65 import java.lang.annotation.Annotation; |
65 import java.net.MalformedURLException; | 66 import java.net.MalformedURLException; |
66 import java.net.URL; | 67 import java.net.URL; |
67 import java.util.HashMap; | 68 import java.util.HashMap; |
68 import java.util.Locale; | 69 import java.util.Locale; |
(...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 | 1670 |
1670 /** | 1671 /** |
1671 * @see android.webkit.WebView#preauthorizePermission(Uri, long) | 1672 * @see android.webkit.WebView#preauthorizePermission(Uri, long) |
1672 */ | 1673 */ |
1673 public void preauthorizePermission(Uri origin, long resources) { | 1674 public void preauthorizePermission(Uri origin, long resources) { |
1674 if (mNativeAwContents == 0) return; | 1675 if (mNativeAwContents == 0) return; |
1675 nativePreauthorizePermission(mNativeAwContents, origin.toString(), resou
rces); | 1676 nativePreauthorizePermission(mNativeAwContents, origin.toString(), resou
rces); |
1676 } | 1677 } |
1677 | 1678 |
1678 /** | 1679 /** |
1679 * @see ContentViewCore.evaluateJavaScript(String, ContentViewCore.JavaScrip
tCallback) | 1680 * @see ContentViewCore.evaluateJavaScript(String, JavaScriptCallback) |
1680 */ | 1681 */ |
1681 public void evaluateJavaScript(String script, final ValueCallback<String> ca
llback) { | 1682 public void evaluateJavaScript(String script, final ValueCallback<String> ca
llback) { |
1682 ContentViewCore.JavaScriptCallback jsCallback = null; | 1683 JavaScriptCallback jsCallback = null; |
1683 if (callback != null) { | 1684 if (callback != null) { |
1684 jsCallback = new ContentViewCore.JavaScriptCallback() { | 1685 jsCallback = new JavaScriptCallback() { |
1685 @Override | 1686 @Override |
1686 public void handleJavaScriptResult(String jsonResult) { | 1687 public void handleJavaScriptResult(String jsonResult) { |
1687 callback.onReceiveValue(jsonResult); | 1688 callback.onReceiveValue(jsonResult); |
1688 } | 1689 } |
1689 }; | 1690 }; |
1690 } | 1691 } |
1691 | 1692 |
1692 mContentViewCore.evaluateJavaScript(script, jsCallback); | 1693 mContentViewCore.evaluateJavaScript(script, jsCallback); |
1693 } | 1694 } |
1694 | 1695 |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2495 | 2496 |
2496 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); | 2497 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); |
2497 | 2498 |
2498 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); | 2499 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); |
2499 | 2500 |
2500 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); | 2501 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); |
2501 | 2502 |
2502 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, | 2503 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, |
2503 long resources); | 2504 long resources); |
2504 } | 2505 } |
OLD | NEW |