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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/CCTRequestStatus.java

Issue 2888273003: [Offline Pages] Add an observer for requests in the CCT namespace. (Closed)
Patch Set: comments. Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/CCTRequestStatus.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/CCTRequestStatus.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/CCTRequestStatus.java
new file mode 100644
index 0000000000000000000000000000000000000000..766cf40b70bb26e0ad81de535865ade26b0bf50d
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/CCTRequestStatus.java
@@ -0,0 +1,44 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.offlinepages;
+
+import org.chromium.base.annotations.CalledByNative;
+
+/**
+ * Class used to propagate the final status of CCT offline pages requests.
+ */
+public class CCTRequestStatus {
+ private CCTRequestStatus(int savePageResult, String savedPageId) {
+ mSavePageResult = savePageResult;
+ mSavedPageId = savedPageId;
+ }
+
+ private int mSavePageResult;
+ private String mSavedPageId;
+
+ /**
+ * @return An org.chromium.components.offlinepages.BackgroundSavePageResult for this request.
+ */
+ public int getSavePageResult() {
+ return mSavePageResult;
+ }
+
+ /**
+ * @return The ID string extracted from the ClientId of the page.
+ */
+ public String getSavedPageId() {
+ return mSavedPageId;
+ }
+
+ /**
+ * Creates a request status object.
+ * @param result an offlinepages.BackgroundSavePageResult
+ * @param savedPageId the ID of the page that was completed.
+ */
+ @CalledByNative
+ public static CCTRequestStatus create(int result, String savedPageId) {
+ return new CCTRequestStatus(result, savedPageId);
+ }
+}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java ('k') | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698