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

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: Use <iron-icon icon="cr:delete"> instead of copying svg. 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 6649b8397e41b38e246e59b5070d050a1c6e71a6..4517f980cf045748b72848655802582f9e6703b7 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,
},
@@ -128,7 +134,8 @@ Polymer({
*/
onDriveCacheTap_: function(e) {
e.preventDefault();
- this.$.storageDriveCache.open();
+ if (this.hasDriveCache_)
+ this.$.storageDriveCache.open();
},
/**
@@ -177,11 +184,14 @@ 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) {
- if (this.driveEnabled_)
+ handleDriveCacheSizeChanged_: function(size, hasCache) {
+ if (this.driveEnabled_) {
this.$$('#driveCacheSize').textContent = size;
+ this.hasDriveCache_ = hasCache;
+ }
},
/**

Powered by Google App Engine
This is Rietveld 408576698