OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.offlinepages; |
| 6 |
| 7 import org.chromium.base.annotations.CalledByNative; |
| 8 |
| 9 /** |
| 10 * Class used to propagate the final status of CCT offline pages requests. |
| 11 */ |
| 12 public class CCTRequestStatus { |
| 13 private CCTRequestStatus(int savePageResult, String savedPageId) { |
| 14 mSavePageResult = savePageResult; |
| 15 mSavedPageId = savedPageId; |
| 16 } |
| 17 |
| 18 private int mSavePageResult; |
| 19 private String mSavedPageId; |
| 20 |
| 21 /** |
| 22 * @return An org.chromium.components.offlinepages.BackgroundSavePageResult
for this request. |
| 23 */ |
| 24 public int getSavePageResult() { |
| 25 return mSavePageResult; |
| 26 } |
| 27 |
| 28 /** |
| 29 * @return The ID string extracted from the ClientId of the page. |
| 30 */ |
| 31 public String getSavedPageId() { |
| 32 return mSavedPageId; |
| 33 } |
| 34 |
| 35 /** |
| 36 * Creates a request status object. |
| 37 * @param result an offlinepages.BackgroundSavePageResult |
| 38 * @param savedPageId the ID of the page that was completed. |
| 39 */ |
| 40 @CalledByNative |
| 41 public static CCTRequestStatus create(int result, String savedPageId) { |
| 42 return new CCTRequestStatus(result, savedPageId); |
| 43 } |
| 44 } |
OLD | NEW |