Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 com.android.webview.chromium; | 5 package com.android.webview.chromium; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
| 9 import android.graphics.BitmapFactory; | 9 import android.graphics.BitmapFactory; |
| 10 import android.graphics.Canvas; | 10 import android.graphics.Canvas; |
| 11 import android.graphics.Color; | 11 import android.graphics.Color; |
| 12 import android.graphics.Picture; | 12 import android.graphics.Picture; |
| 13 import android.net.Uri; | 13 import android.net.Uri; |
| 14 import android.net.http.SslError; | 14 import android.net.http.SslError; |
| 15 import android.os.Build; | 15 import android.os.Build; |
| 16 import android.os.Handler; | 16 import android.os.Handler; |
| 17 import android.os.Message; | 17 import android.os.Message; |
| 18 import android.util.Log; | 18 import android.util.Log; |
| 19 import android.view.ActionMode; | |
| 20 import android.view.KeyEvent; | 19 import android.view.KeyEvent; |
| 21 import android.view.View; | 20 import android.view.View; |
| 22 import android.webkit.ClientCertRequest; | 21 import android.webkit.ClientCertRequest; |
| 23 import android.webkit.ConsoleMessage; | 22 import android.webkit.ConsoleMessage; |
| 24 import android.webkit.DownloadListener; | 23 import android.webkit.DownloadListener; |
| 25 import android.webkit.GeolocationPermissions; | 24 import android.webkit.GeolocationPermissions; |
| 26 import android.webkit.JsDialogHelper; | 25 import android.webkit.JsDialogHelper; |
| 27 import android.webkit.JsPromptResult; | 26 import android.webkit.JsPromptResult; |
| 28 import android.webkit.JsResult; | 27 import android.webkit.JsResult; |
| 29 import android.webkit.PermissionRequest; | 28 import android.webkit.PermissionRequest; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 44 import org.chromium.android_webview.AwWebResourceResponse; | 43 import org.chromium.android_webview.AwWebResourceResponse; |
| 45 import org.chromium.android_webview.JsPromptResultReceiver; | 44 import org.chromium.android_webview.JsPromptResultReceiver; |
| 46 import org.chromium.android_webview.JsResultReceiver; | 45 import org.chromium.android_webview.JsResultReceiver; |
| 47 import org.chromium.android_webview.permission.AwPermissionRequest; | 46 import org.chromium.android_webview.permission.AwPermissionRequest; |
| 48 import org.chromium.android_webview.permission.Resource; | 47 import org.chromium.android_webview.permission.Resource; |
| 49 import org.chromium.base.ThreadUtils; | 48 import org.chromium.base.ThreadUtils; |
| 50 import org.chromium.base.TraceEvent; | 49 import org.chromium.base.TraceEvent; |
| 51 import org.chromium.content.browser.ContentView; | 50 import org.chromium.content.browser.ContentView; |
| 52 import org.chromium.content.browser.ContentViewClient; | 51 import org.chromium.content.browser.ContentViewClient; |
| 53 import org.chromium.content.browser.ContentViewCore; | 52 import org.chromium.content.browser.ContentViewCore; |
| 54 import org.chromium.content.browser.WebActionMode; | |
| 55 import org.chromium.content.browser.WebActionModeCallback; | |
| 56 import org.chromium.content.browser.WebActionModeCallback.ActionHandler; | |
| 57 | 53 |
| 58 import java.lang.ref.WeakReference; | 54 import java.lang.ref.WeakReference; |
| 59 import java.security.Principal; | 55 import java.security.Principal; |
| 60 import java.security.PrivateKey; | 56 import java.security.PrivateKey; |
| 61 import java.security.cert.X509Certificate; | 57 import java.security.cert.X509Certificate; |
| 62 import java.util.ArrayList; | 58 import java.util.ArrayList; |
| 63 import java.util.HashMap; | 59 import java.util.HashMap; |
| 64 import java.util.Map; | 60 import java.util.Map; |
| 65 import java.util.WeakHashMap; | 61 import java.util.WeakHashMap; |
| 66 | 62 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 try { | 372 try { |
| 377 TraceEvent.begin("WebViewContentsClientAdapter.onNewPicture"); | 373 TraceEvent.begin("WebViewContentsClientAdapter.onNewPicture"); |
| 378 if (mPictureListener == null) return; | 374 if (mPictureListener == null) return; |
| 379 if (TRACE) Log.d(TAG, "onNewPicture"); | 375 if (TRACE) Log.d(TAG, "onNewPicture"); |
| 380 mPictureListener.onNewPicture(mWebView, picture); | 376 mPictureListener.onNewPicture(mWebView, picture); |
| 381 } finally { | 377 } finally { |
| 382 TraceEvent.end("WebViewContentsClientAdapter.onNewPicture"); | 378 TraceEvent.end("WebViewContentsClientAdapter.onNewPicture"); |
| 383 } | 379 } |
| 384 } | 380 } |
| 385 | 381 |
| 386 /** | |
| 387 * @See AwContentsClient#startActionMode(View,ActionHandler,boolean) | |
| 388 */ | |
| 389 @Override | |
| 390 public WebActionMode startActionMode( | |
| 391 View view, ActionHandler actionHandler, boolean floating) { | |
| 392 try { | |
| 393 TraceEvent.begin("WebViewContentsClientAdapter.startActionMode"); | |
| 394 if (TRACE) Log.d(TAG, "startActionMode"); | |
| 395 if (floating) return null; | |
| 396 ActionMode.Callback callback = new WebActionModeCallback(mContext, a ctionHandler); | |
| 397 ActionMode actionMode = view.startActionMode(callback); | |
| 398 return actionMode != null ? new WebActionMode(actionMode) : null; | |
| 399 } finally { | |
| 400 TraceEvent.end("WebViewContentsClientAdapter.startActionMode"); | |
| 401 } | |
| 402 } | |
| 403 | |
| 404 /** | |
| 405 * @See AwContentsClient#supportsFloatingActionMode() | |
| 406 */ | |
| 407 @Override | |
| 408 public boolean supportsFloatingActionMode() { | |
| 409 return false; | |
| 410 } | |
|
sgurun-gerrit only
2015/08/20 23:15:40
These changes should be merged to internal glue la
| |
| 411 | |
| 412 @Override | 382 @Override |
| 413 public void onLoadResource(String url) { | 383 public void onLoadResource(String url) { |
| 414 try { | 384 try { |
| 415 TraceEvent.begin("WebViewContentsClientAdapter.onLoadResource"); | 385 TraceEvent.begin("WebViewContentsClientAdapter.onLoadResource"); |
| 416 if (TRACE) Log.d(TAG, "onLoadResource=" + url); | 386 if (TRACE) Log.d(TAG, "onLoadResource=" + url); |
| 417 mWebViewClient.onLoadResource(mWebView, url); | 387 mWebViewClient.onLoadResource(mWebView, url); |
| 418 } finally { | 388 } finally { |
| 419 TraceEvent.end("WebViewContentsClientAdapter.onLoadResource"); | 389 TraceEvent.end("WebViewContentsClientAdapter.onLoadResource"); |
| 420 } | 390 } |
| 421 } | 391 } |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1280 mAwPermissionRequest.deny(); | 1250 mAwPermissionRequest.deny(); |
| 1281 } | 1251 } |
| 1282 } | 1252 } |
| 1283 | 1253 |
| 1284 @Override | 1254 @Override |
| 1285 public void deny() { | 1255 public void deny() { |
| 1286 mAwPermissionRequest.deny(); | 1256 mAwPermissionRequest.deny(); |
| 1287 } | 1257 } |
| 1288 } | 1258 } |
| 1289 } | 1259 } |
| OLD | NEW |