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 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 | 1340 |
1341 public Bitmap getFavicon() { | 1341 public Bitmap getFavicon() { |
1342 if (isDestroyed(WARN)) return null; | 1342 if (isDestroyed(WARN)) return null; |
1343 return mFavicon; | 1343 return mFavicon; |
1344 } | 1344 } |
1345 | 1345 |
1346 private void requestVisitedHistoryFromClient() { | 1346 private void requestVisitedHistoryFromClient() { |
1347 ValueCallback<String[]> callback = new ValueCallback<String[]>() { | 1347 ValueCallback<String[]> callback = new ValueCallback<String[]>() { |
1348 @Override | 1348 @Override |
1349 public void onReceiveValue(final String[] value) { | 1349 public void onReceiveValue(final String[] value) { |
| 1350 if (value != null) { |
| 1351 // Replace null values with empty strings, because they can'
t be represented as |
| 1352 // native strings. |
| 1353 for (int i = 0; i < value.length; i++) { |
| 1354 if (value[i] == null) value[i] = ""; |
| 1355 } |
| 1356 } |
| 1357 |
1350 ThreadUtils.runOnUiThread(new Runnable() { | 1358 ThreadUtils.runOnUiThread(new Runnable() { |
1351 @Override | 1359 @Override |
1352 public void run() { | 1360 public void run() { |
1353 if (!isDestroyed(NO_WARN)) nativeAddVisitedLinks(mNative
AwContents, value); | 1361 if (!isDestroyed(NO_WARN)) nativeAddVisitedLinks(mNative
AwContents, value); |
1354 } | 1362 } |
1355 }); | 1363 }); |
1356 } | 1364 } |
1357 }; | 1365 }; |
1358 mContentsClient.getVisitedHistory(callback); | 1366 mContentsClient.getVisitedHistory(callback); |
1359 } | 1367 } |
(...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3306 long resources); | 3314 long resources); |
3307 | 3315 |
3308 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, | 3316 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, |
3309 String message, String targetOrigin, int[] msgPorts); | 3317 String message, String targetOrigin, int[] msgPorts); |
3310 | 3318 |
3311 private native void nativeCreateMessageChannel(long nativeAwContents, AwMess
agePort[] ports); | 3319 private native void nativeCreateMessageChannel(long nativeAwContents, AwMess
agePort[] ports); |
3312 | 3320 |
3313 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); | 3321 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); |
3314 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); | 3322 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); |
3315 } | 3323 } |
OLD | NEW |