Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java

Issue 2446113008: Revert of Showing previews UI for Offline Previews (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 org.chromium.base.Callback; 7 import org.chromium.base.Callback;
8 import org.chromium.base.ObserverList; 8 import org.chromium.base.ObserverList;
9 import org.chromium.base.ThreadUtils; 9 import org.chromium.base.ThreadUtils;
10 import org.chromium.base.VisibleForTesting; 10 import org.chromium.base.VisibleForTesting;
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 396
397 /** 397 /**
398 * Retrieves the extra request header to reload the offline page. 398 * Retrieves the extra request header to reload the offline page.
399 * @param webContents Contents of the page to reload. 399 * @param webContents Contents of the page to reload.
400 * @return The extra request header string. 400 * @return The extra request header string.
401 */ 401 */
402 public String getOfflinePageHeaderForReload(WebContents webContents) { 402 public String getOfflinePageHeaderForReload(WebContents webContents) {
403 return nativeGetOfflinePageHeaderForReload(mNativeOfflinePageBridge, web Contents); 403 return nativeGetOfflinePageHeaderForReload(mNativeOfflinePageBridge, web Contents);
404 } 404 }
405 405
406 /**
407 * @return True if an offline preview is being shown.
408 * @param webContents Contents of the page to check.
409 */
410 public boolean isShowingOfflinePreview(WebContents webContents) {
411 return nativeIsShowingOfflinePreview(mNativeOfflinePageBridge, webConten ts);
412 }
413
414 private static class CheckPagesExistOfflineCallbackInternal { 406 private static class CheckPagesExistOfflineCallbackInternal {
415 private Callback<Set<String>> mCallback; 407 private Callback<Set<String>> mCallback;
416 408
417 CheckPagesExistOfflineCallbackInternal(Callback<Set<String>> callback) { 409 CheckPagesExistOfflineCallbackInternal(Callback<Set<String>> callback) {
418 mCallback = callback; 410 mCallback = callback;
419 } 411 }
420 412
421 @CalledByNative("CheckPagesExistOfflineCallbackInternal") 413 @CalledByNative("CheckPagesExistOfflineCallbackInternal")
422 public void onResult(String[] results) { 414 public void onResult(String[] results) {
423 Set<String> resultSet = new HashSet<>(); 415 Set<String> resultSet = new HashSet<>();
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 String[] ids, Callback<Integer> callback); 522 String[] ids, Callback<Integer> callback);
531 private native void nativeSelectPageForOnlineUrl( 523 private native void nativeSelectPageForOnlineUrl(
532 long nativeOfflinePageBridge, String onlineUrl, int tabId, 524 long nativeOfflinePageBridge, String onlineUrl, int tabId,
533 Callback<OfflinePageItem> callback); 525 Callback<OfflinePageItem> callback);
534 private native void nativeSavePage(long nativeOfflinePageBridge, SavePageCal lback callback, 526 private native void nativeSavePage(long nativeOfflinePageBridge, SavePageCal lback callback,
535 WebContents webContents, String clientNamespace, String clientId); 527 WebContents webContents, String clientNamespace, String clientId);
536 private native void nativeSavePageLater(long nativeOfflinePageBridge, String url, 528 private native void nativeSavePageLater(long nativeOfflinePageBridge, String url,
537 String clientNamespace, String clientId, boolean userRequested); 529 String clientNamespace, String clientId, boolean userRequested);
538 private native String nativeGetOfflinePageHeaderForReload( 530 private native String nativeGetOfflinePageHeaderForReload(
539 long nativeOfflinePageBridge, WebContents webContents); 531 long nativeOfflinePageBridge, WebContents webContents);
540 private native boolean nativeIsShowingOfflinePreview(
541 long nativeOfflinePageBridge, WebContents webContents);
542 } 532 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698