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.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 public void run() { | 399 public void run() { |
400 destroy(); | 400 destroy(); |
401 } | 401 } |
402 }); | 402 }); |
403 return; | 403 return; |
404 } | 404 } |
405 | 405 |
406 // Make sure that we do not trigger any callbacks after destruction | 406 // Make sure that we do not trigger any callbacks after destruction |
407 mContentsClientAdapter.setWebChromeClient(null); | 407 mContentsClientAdapter.setWebChromeClient(null); |
408 mContentsClientAdapter.setWebViewClient(null); | 408 mContentsClientAdapter.setWebViewClient(null); |
409 mContentsClientAdapter.setPictureListener(null); | 409 mContentsClientAdapter.setPictureListener(null, true); |
410 mContentsClientAdapter.setFindListener(null); | 410 mContentsClientAdapter.setFindListener(null); |
411 mContentsClientAdapter.setDownloadListener(null); | 411 mContentsClientAdapter.setDownloadListener(null); |
412 | 412 |
413 mAwContents.destroy(); | 413 mAwContents.destroy(); |
414 } | 414 } |
415 | 415 |
416 @Override | 416 @Override |
417 public void setNetworkAvailable(final boolean networkUp) { | 417 public void setNetworkAvailable(final boolean networkUp) { |
418 // Note that this purely toggles the JS navigator.online property. | 418 // Note that this purely toggles the JS navigator.online property. |
419 // It does not in affect chromium or network stack state in any way. | 419 // It does not in affect chromium or network stack state in any way. |
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 public void setPictureListener(final WebView.PictureListener listener) { | 1287 public void setPictureListener(final WebView.PictureListener listener) { |
1288 if (checkNeedsPost()) { | 1288 if (checkNeedsPost()) { |
1289 mFactory.addTask(new Runnable() { | 1289 mFactory.addTask(new Runnable() { |
1290 @Override | 1290 @Override |
1291 public void run() { | 1291 public void run() { |
1292 setPictureListener(listener); | 1292 setPictureListener(listener); |
1293 } | 1293 } |
1294 }); | 1294 }); |
1295 return; | 1295 return; |
1296 } | 1296 } |
1297 mContentsClientAdapter.setPictureListener(listener); | 1297 boolean invalidateOnly = mAppTargetSdkVersion >= Build.VERSION_CODES.JEL
LY_BEAN_MR2; |
1298 mAwContents.enableOnNewPicture( | 1298 mContentsClientAdapter.setPictureListener(listener, invalidateOnly); |
1299 listener != null, mAppTargetSdkVersion >= Build.VERSION_CODES.JE
LLY_BEAN_MR2); | 1299 mAwContents.enableOnNewPicture(listener != null, invalidateOnly); |
1300 } | 1300 } |
1301 | 1301 |
1302 @Override | 1302 @Override |
1303 public void addJavascriptInterface(final Object obj, final String interfaceN
ame) { | 1303 public void addJavascriptInterface(final Object obj, final String interfaceN
ame) { |
1304 if (checkNeedsPost()) { | 1304 if (checkNeedsPost()) { |
1305 mFactory.addTask(new Runnable() { | 1305 mFactory.addTask(new Runnable() { |
1306 @Override | 1306 @Override |
1307 public void run() { | 1307 public void run() { |
1308 addJavascriptInterface(obj, interfaceName); | 1308 addJavascriptInterface(obj, interfaceName); |
1309 } | 1309 } |
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2262 mAwContents.extractSmartClipData(x, y, width, height); | 2262 mAwContents.extractSmartClipData(x, y, width, height); |
2263 } | 2263 } |
2264 | 2264 |
2265 // Implements SmartClipProvider | 2265 // Implements SmartClipProvider |
2266 @Override | 2266 @Override |
2267 public void setSmartClipResultHandler(final Handler resultHandler) { | 2267 public void setSmartClipResultHandler(final Handler resultHandler) { |
2268 checkThread(); | 2268 checkThread(); |
2269 mAwContents.setSmartClipResultHandler(resultHandler); | 2269 mAwContents.setSmartClipResultHandler(resultHandler); |
2270 } | 2270 } |
2271 } | 2271 } |
OLD | NEW |