| 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; |
| 11 import android.content.res.Configuration; | 11 import android.content.res.Configuration; |
| 12 import android.graphics.Bitmap; | 12 import android.graphics.Bitmap; |
| 13 import android.graphics.Canvas; | 13 import android.graphics.Canvas; |
| 14 import android.graphics.Color; | 14 import android.graphics.Color; |
| 15 import android.graphics.Paint; | 15 import android.graphics.Paint; |
| 16 import android.graphics.Picture; | 16 import android.graphics.Picture; |
| 17 import android.graphics.Rect; | 17 import android.graphics.Rect; |
| 18 import android.net.Uri; |
| 18 import android.net.http.SslCertificate; | 19 import android.net.http.SslCertificate; |
| 19 import android.os.AsyncTask; | 20 import android.os.AsyncTask; |
| 20 import android.os.Build; | 21 import android.os.Build; |
| 21 import android.os.Bundle; | 22 import android.os.Bundle; |
| 22 import android.os.Message; | 23 import android.os.Message; |
| 23 import android.text.TextUtils; | 24 import android.text.TextUtils; |
| 24 import android.util.Log; | 25 import android.util.Log; |
| 25 import android.view.KeyEvent; | 26 import android.view.KeyEvent; |
| 26 import android.view.MotionEvent; | 27 import android.view.MotionEvent; |
| 27 import android.view.View; | 28 import android.view.View; |
| (...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 } | 1491 } |
| 1491 | 1492 |
| 1492 /** | 1493 /** |
| 1493 * @see android.webkit.WebView#invokeZoomPicker() | 1494 * @see android.webkit.WebView#invokeZoomPicker() |
| 1494 */ | 1495 */ |
| 1495 public void invokeZoomPicker() { | 1496 public void invokeZoomPicker() { |
| 1496 mContentViewCore.invokeZoomPicker(); | 1497 mContentViewCore.invokeZoomPicker(); |
| 1497 } | 1498 } |
| 1498 | 1499 |
| 1499 /** | 1500 /** |
| 1501 * @see android.webkit.WebView#preauthorizePermission(Uri, long) |
| 1502 */ |
| 1503 public void preauthorizePermission(Uri origin, long resources) { |
| 1504 if (mNativeAwContents == 0) return; |
| 1505 nativePreauthorizePermission(mNativeAwContents, origin.toString(), resou
rces); |
| 1506 } |
| 1507 |
| 1508 /** |
| 1500 * @see ContentViewCore.evaluateJavaScript(String, ContentViewCore.JavaScrip
tCallback) | 1509 * @see ContentViewCore.evaluateJavaScript(String, ContentViewCore.JavaScrip
tCallback) |
| 1501 */ | 1510 */ |
| 1502 public void evaluateJavaScript(String script, final ValueCallback<String> ca
llback) { | 1511 public void evaluateJavaScript(String script, final ValueCallback<String> ca
llback) { |
| 1503 ContentViewCore.JavaScriptCallback jsCallback = null; | 1512 ContentViewCore.JavaScriptCallback jsCallback = null; |
| 1504 if (callback != null) { | 1513 if (callback != null) { |
| 1505 jsCallback = new ContentViewCore.JavaScriptCallback() { | 1514 jsCallback = new ContentViewCore.JavaScriptCallback() { |
| 1506 @Override | 1515 @Override |
| 1507 public void handleJavaScriptResult(String jsonResult) { | 1516 public void handleJavaScriptResult(String jsonResult) { |
| 1508 callback.onReceiveValue(jsonResult); | 1517 callback.onReceiveValue(jsonResult); |
| 1509 } | 1518 } |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2127 String url, String extraHeaders); | 2136 String url, String extraHeaders); |
| 2128 | 2137 |
| 2129 private native void nativeInvokeGeolocationCallback( | 2138 private native void nativeInvokeGeolocationCallback( |
| 2130 long nativeAwContents, boolean value, String requestingFrame); | 2139 long nativeAwContents, boolean value, String requestingFrame); |
| 2131 | 2140 |
| 2132 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); | 2141 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); |
| 2133 | 2142 |
| 2134 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); | 2143 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); |
| 2135 | 2144 |
| 2136 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); | 2145 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); |
| 2146 |
| 2147 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, |
| 2148 long resources); |
| 2137 } | 2149 } |
| OLD | NEW |