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

Unified Diff: chrome/browser/resources/offline_pages/offline_internals.js

Issue 2928243002: Return operation name in prefetch request callback and add internal page hookup (Closed)
Patch Set: Fix closure trybot Created 3 years, 6 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
Index: chrome/browser/resources/offline_pages/offline_internals.js
diff --git a/chrome/browser/resources/offline_pages/offline_internals.js b/chrome/browser/resources/offline_pages/offline_internals.js
index b01b0a322cf1250841f09c6472edee9fcb4855fa..f34f6eaafb16ec916e49d8a5c705b395d20d98f0 100644
--- a/chrome/browser/resources/offline_pages/offline_internals.js
+++ b/chrome/browser/resources/offline_pages/offline_internals.js
@@ -178,6 +178,14 @@ cr.define('offlineInternals', function() {
browserProxy.getRequestQueue().then(fillRequestQueue);
}
+ /**
+ * Callback for prefetch actions.
+ * @param {info} The result of performing the prefetch actions.
dpapad 2017/06/13 01:14:26 See https://github.com/google/closure-compiler/wik
jianli 2017/06/13 22:06:12 Done.
+ */
+ function setPrefetchResult(info) {
+ $('prefetch-actions-info').textContent = info;
+ }
+
/**
* Downloads all the stored page and request queue information into a file.
* TODO(chili): Create a CSV writer that can abstract out the line joining.
@@ -317,10 +325,18 @@ cr.define('offlineInternals', function() {
}
};
$('schedule-nwake').onclick = function() {
- browserProxy.scheduleNwake();
+ browserProxy.scheduleNwake().then(setPrefetchResult);
};
$('cancel-nwake').onclick = function() {
- browserProxy.cancelNwake();
+ browserProxy.cancelNwake().then(setPrefetchResult);
+ };
+ $('generate-page-bundle').onclick = function() {
+ browserProxy.generatePageBundle($('generate-urls').value).
+ then(setPrefetchResult);
+ };
+ $('get-operation').onclick = function() {
+ browserProxy.getOperation($('operation-name').value).
+ then(setPrefetchResult);
};
if (!incognito)
refreshAll();

Powered by Google App Engine
This is Rietveld 408576698