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

Unified Diff: content/browser/resources/indexed_db/indexeddb_internals.js

Issue 13949013: Implement download link in chrome://indexeddb-internals/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use FILE_PATH_LITERAL Created 7 years, 8 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 | « content/browser/resources/indexed_db/indexeddb_internals.html ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/resources/indexed_db/indexeddb_internals.js
diff --git a/content/browser/resources/indexed_db/indexeddb_internals.js b/content/browser/resources/indexed_db/indexeddb_internals.js
index 9bc3b0bd1190ba395ff9452948b1015e6a980316..378b9ad9c5a28ab4dcb1cb7d8a405f3c03cedc33 100644
--- a/content/browser/resources/indexed_db/indexeddb_internals.js
+++ b/content/browser/resources/indexed_db/indexeddb_internals.js
@@ -9,16 +9,50 @@ cr.define('indexeddb', function() {
chrome.send('getAllOrigins');
}
- function onOriginsReady(origins, path) {
+ function progressNodeFor(link) {
+ return link.parentNode.querySelector('.download-status');
+ }
+
+ function downloadOriginData(event) {
+ var link = event.target;
+ progressNodeFor(link).style.display = 'inline';
+ chrome.send('downloadOriginData', [link.idb_partition_path,
+ link.idb_origin_url]);
+ return false;
+ }
+
+ // Fired from the backend after the data has been zipped up, and the
+ // download manager has begun downloading the file.
+ function onOriginDownloadReady(partition_path, origin_url) {
+ var downloadLinks = document.querySelectorAll('a.download');
+ for (var i = 0; i < downloadLinks.length; ++i) {
+ var link = downloadLinks[i];
+ if (partition_path == link.idb_partition_path &&
+ origin_url == link.idb_origin_url) {
+ progressNodeFor(link).style.display = 'none';
+ }
+ }
+ }
+
+ // Fired from the backend with a single partition's worth of
+ // IndexedDB metadata.
+ function onOriginsReady(origins, partition_path) {
var template = jstGetTemplate('indexeddb-list-template');
var container = $('indexeddb-list');
container.appendChild(template);
- jstProcess(new JsEvalContext({ idbs: origins, path: path}), template);
+ jstProcess(new JsEvalContext({ idbs: origins,
+ partition_path: partition_path}), template);
+
+ var downloadLinks = container.querySelectorAll('a.download');
+ for (var i = 0; i < downloadLinks.length; ++i) {
+ downloadLinks[i].addEventListener('click', downloadOriginData, false);
+ }
}
return {
- initialize: initialize,
- onOriginsReady: onOriginsReady,
+ initialize: initialize,
+ onOriginDownloadReady: onOriginDownloadReady,
+ onOriginsReady: onOriginsReady,
};
});
« no previous file with comments | « content/browser/resources/indexed_db/indexeddb_internals.html ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698