OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser.offlinepages; | 5 package org.chromium.chrome.browser.offlinepages; |
6 | 6 |
7 import android.os.AsyncTask; | 7 import android.os.AsyncTask; |
8 | 8 |
9 import org.chromium.base.ObserverList; | 9 import org.chromium.base.ObserverList; |
10 import org.chromium.base.ThreadUtils; | 10 import org.chromium.base.ThreadUtils; |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
330 /** | 330 /** |
331 * Starts a check of offline page metadata, e.g. are all offline copies pres ent. | 331 * Starts a check of offline page metadata, e.g. are all offline copies pres ent. |
332 */ | 332 */ |
333 public void checkOfflinePageMetadata() { | 333 public void checkOfflinePageMetadata() { |
334 nativeCheckMetadataConsistency(mNativeOfflinePageBridge); | 334 nativeCheckMetadataConsistency(mNativeOfflinePageBridge); |
335 } | 335 } |
336 | 336 |
337 /** | 337 /** |
338 * Gets the offline URL of an offline page of that is saved for the online U RL. | 338 * Gets the offline URL of an offline page of that is saved for the online U RL. |
339 * @param onlineUrl Online URL, which might have offline copy. | 339 * @param onlineUrl Online URL, which might have offline copy. |
340 * @return URL pointing to the offline copy or <code>null</code> if none exi sts. | 340 * @return URL pointing to the offline copy or the empty string if none exis ts. |
fgorski
2016/01/08 17:37:51
Thanks for catching that. I think this should actu
Marc Treib
2016/01/11 10:32:23
Done.
| |
341 */ | 341 */ |
342 @VisibleForTesting | 342 @VisibleForTesting |
343 public String getOfflineUrlForOnlineUrl(String onlineUrl) { | 343 public String getOfflineUrlForOnlineUrl(String onlineUrl) { |
344 assert mIsNativeOfflinePageModelLoaded; | 344 assert mIsNativeOfflinePageModelLoaded; |
345 return nativeGetOfflineUrlForOnlineUrl(mNativeOfflinePageBridge, onlineU rl); | 345 return nativeGetOfflineUrlForOnlineUrl(mNativeOfflinePageBridge, onlineU rl); |
346 } | 346 } |
347 | 347 |
348 /** | 348 /** |
349 * Returns <code>true</code> if offline URL points to a local copy of an off line page. | 349 * Returns <code>true</code> if offline URL points to a local copy of an off line page. |
350 * @param offlineUrl A URL potentially pointing to an offline copy of an off line page. | 350 * @param offlineUrl A URL potentially pointing to an offline copy of an off line page. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
431 DeletePageCallback callback, long bookmarkId); | 431 DeletePageCallback callback, long bookmarkId); |
432 private native void nativeDeletePages( | 432 private native void nativeDeletePages( |
433 long nativeOfflinePageBridge, DeletePageCallback callback, long[] bo okmarkIds); | 433 long nativeOfflinePageBridge, DeletePageCallback callback, long[] bo okmarkIds); |
434 private native void nativeGetPagesToCleanUp( | 434 private native void nativeGetPagesToCleanUp( |
435 long nativeOfflinePageBridge, List<OfflinePageItem> offlinePages); | 435 long nativeOfflinePageBridge, List<OfflinePageItem> offlinePages); |
436 private native void nativeCheckMetadataConsistency(long nativeOfflinePageBri dge); | 436 private native void nativeCheckMetadataConsistency(long nativeOfflinePageBri dge); |
437 private native String nativeGetOfflineUrlForOnlineUrl( | 437 private native String nativeGetOfflineUrlForOnlineUrl( |
438 long nativeOfflinePageBridge, String onlineUrl); | 438 long nativeOfflinePageBridge, String onlineUrl); |
439 private native boolean nativeIsOfflinePageUrl(long nativeOfflinePageBridge, String offlineUrl); | 439 private native boolean nativeIsOfflinePageUrl(long nativeOfflinePageBridge, String offlineUrl); |
440 } | 440 } |
OLD | NEW |