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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-storage' is the settings subpage for storage settings. 7 * 'settings-storage' is the settings subpage for storage settings.
8 */ 8 */
9 cr.exportPath('settings'); 9 cr.exportPath('settings');
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 type: Boolean, 48 type: Boolean,
49 value: false, 49 value: false,
50 }, 50 },
51 51
52 /** @private */ 52 /** @private */
53 isGuest_: { 53 isGuest_: {
54 type: Boolean, 54 type: Boolean,
55 value: function() { return loadTimeData.getBoolean('isGuest'); } 55 value: function() { return loadTimeData.getBoolean('isGuest'); }
56 }, 56 },
57 57
58 /** @private */
59 hasDriveCache_: {
60 type: Boolean,
61 value: false
62 },
63
58 /** @private {settings.StorageSizeStat} */ 64 /** @private {settings.StorageSizeStat} */
59 sizeStat_: Object, 65 sizeStat_: Object,
60 }, 66 },
61 67
62 /** 68 /**
63 * Timer ID for periodic update. 69 * Timer ID for periodic update.
64 * @private {number} 70 * @private {number}
65 */ 71 */
66 updateTimerId_: -1, 72 updateTimerId_: -1,
67 73
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 chrome.send('openDownloads'); 125 chrome.send('openDownloads');
120 }, 126 },
121 127
122 /** 128 /**
123 * Handler for tapping the "Offline files" item. 129 * Handler for tapping the "Offline files" item.
124 * @param {!Event} e 130 * @param {!Event} e
125 * @private 131 * @private
126 */ 132 */
127 onDriveCacheTap_: function(e) { 133 onDriveCacheTap_: function(e) {
128 e.preventDefault(); 134 e.preventDefault();
129 this.$.storageDriveCache.open(); 135 if (this.hasDriveCache_)
136 this.$.storageDriveCache.open();
130 }, 137 },
131 138
132 /** 139 /**
133 * Handler for tapping the "Browsing data" item. 140 * Handler for tapping the "Browsing data" item.
134 * @private 141 * @private
135 */ 142 */
136 onBrowsingDataTap_: function() { 143 onBrowsingDataTap_: function() {
137 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA); 144 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA);
138 }, 145 },
139 146
(...skipping 28 matching lines...) Expand all
168 * @param {string} size Formatted string representing the size of Downloads. 175 * @param {string} size Formatted string representing the size of Downloads.
169 * @private 176 * @private
170 */ 177 */
171 handleDownloadsSizeChanged_: function(size) { 178 handleDownloadsSizeChanged_: function(size) {
172 this.$.downloadsSize.textContent = size; 179 this.$.downloadsSize.textContent = size;
173 }, 180 },
174 181
175 /** 182 /**
176 * @param {string} size Formatted string representing the size of Offline 183 * @param {string} size Formatted string representing the size of Offline
177 * files. 184 * files.
185 * @param {boolean} hasCache True if the device has at least one offline file.
178 * @private 186 * @private
179 */ 187 */
180 handleDriveCacheSizeChanged_: function(size) { 188 handleDriveCacheSizeChanged_: function(size, hasCache) {
181 this.$.driveCacheSize.textContent = size; 189 this.$.driveCacheSize.textContent = size;
190 this.hasDriveCache_ = hasCache;
182 }, 191 },
183 192
184 /** 193 /**
185 * @param {string} size Formatted string representing the size of Browsing 194 * @param {string} size Formatted string representing the size of Browsing
186 * data. 195 * data.
187 * @private 196 * @private
188 */ 197 */
189 handleBrowsingDataSizeChanged_: function(size) { 198 handleBrowsingDataSizeChanged_: function(size) {
190 this.$.browsingDataSize.textContent = size; 199 this.$.browsingDataSize.textContent = size;
191 }, 200 },
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 switch (spaceState) { 290 switch (spaceState) {
282 case settings.StorageSpaceState.LOW: 291 case settings.StorageSpaceState.LOW:
283 return 'space-low'; 292 return 'space-low';
284 case settings.StorageSpaceState.CRITICALLY_LOW: 293 case settings.StorageSpaceState.CRITICALLY_LOW:
285 return 'space-critically-low'; 294 return 'space-critically-low';
286 default: 295 default:
287 return ''; 296 return '';
288 } 297 }
289 }, 298 },
290 }); 299 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698