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

Unified Diff: chrome/browser/resources/settings/device_page/storage.js

Issue 2663163002: MD settings: Storage: Add DELETE button for deleting Drive offline files. (Closed)
Patch Set: Make rows two-line and use icon for deleting drive cache. Created 3 years, 10 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/settings/device_page/storage.js
diff --git a/chrome/browser/resources/settings/device_page/storage.js b/chrome/browser/resources/settings/device_page/storage.js
index 84453c690d6e69289bf54520ffc7111272812032..55aaac8d1a10c42fb6d11e06aeefec2887622326 100644
--- a/chrome/browser/resources/settings/device_page/storage.js
+++ b/chrome/browser/resources/settings/device_page/storage.js
@@ -55,6 +55,12 @@ Polymer({
value: function() { return loadTimeData.getBoolean('isGuest'); }
},
+ /** @private */
+ hasDriveCache_: {
+ type: Boolean,
+ value: false
+ },
+
/** @private {settings.StorageSizeStat} */
sizeStat_: Object,
},
@@ -126,7 +132,8 @@ Polymer({
*/
onDriveCacheTap_: function(e) {
e.preventDefault();
- this.$.storageDriveCache.open();
+ if (this.hasDriveCache_)
+ this.$.storageDriveCache.open();
},
/**
@@ -175,10 +182,12 @@ Polymer({
/**
* @param {string} size Formatted string representing the size of Offline
* files.
+ * @param {boolean} hasCache True if the device has at least one offline file.
* @private
*/
- handleDriveCacheSizeChanged_: function(size) {
+ handleDriveCacheSizeChanged_: function(size, hasCache) {
this.$.driveCacheSize.textContent = size;
+ this.hasDriveCache_ = hasCache;
},
/**

Powered by Google App Engine
This is Rietveld 408576698