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

Side by Side Diff: chrome/browser/resources/settings/device_page/storage.js

Issue 2683123002: MD Settings: Storage: Use hidden attribute instead of dom-if binding to hide a row. (Closed)
Patch Set: Remove unncecessary change. 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 this.handleDownloadsSizeChanged_.bind(this)); 75 this.handleDownloadsSizeChanged_.bind(this));
76 cr.addWebUIListener( 76 cr.addWebUIListener(
77 'storage-drive-cache-size-changed', 77 'storage-drive-cache-size-changed',
78 this.handleDriveCacheSizeChanged_.bind(this)); 78 this.handleDriveCacheSizeChanged_.bind(this));
79 cr.addWebUIListener( 79 cr.addWebUIListener(
80 'storage-browsing-data-size-changed', 80 'storage-browsing-data-size-changed',
81 this.handleBrowsingDataSizeChanged_.bind(this)); 81 this.handleBrowsingDataSizeChanged_.bind(this));
82 cr.addWebUIListener( 82 cr.addWebUIListener(
83 'storage-android-size-changed', 83 'storage-android-size-changed',
84 this.handleAndroidSizeChanged_.bind(this)); 84 this.handleAndroidSizeChanged_.bind(this));
85 cr.addWebUIListener( 85 if (!this.isGuest_) {
86 'storage-other-users-size-changed', 86 cr.addWebUIListener(
87 this.handleOtherUsersSizeChanged_.bind(this)); 87 'storage-other-users-size-changed',
88 this.handleOtherUsersSizeChanged_.bind(this));
89 }
88 cr.addWebUIListener( 90 cr.addWebUIListener(
89 'storage-drive-enabled-changed', 91 'storage-drive-enabled-changed',
90 this.handleDriveEnabledChanged_.bind(this)); 92 this.handleDriveEnabledChanged_.bind(this));
91 cr.addWebUIListener( 93 cr.addWebUIListener(
92 'storage-android-enabled-changed', 94 'storage-android-enabled-changed',
93 this.handleAndroidEnabledChanged_.bind(this)); 95 this.handleAndroidEnabledChanged_.bind(this));
94 }, 96 },
95 97
96 /** 98 /**
97 * Overridden from settings.RouteObserverBehavior. 99 * Overridden from settings.RouteObserverBehavior.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 handleDownloadsSizeChanged_: function(size) { 173 handleDownloadsSizeChanged_: function(size) {
172 this.$.downloadsSize.textContent = size; 174 this.$.downloadsSize.textContent = size;
173 }, 175 },
174 176
175 /** 177 /**
176 * @param {string} size Formatted string representing the size of Offline 178 * @param {string} size Formatted string representing the size of Offline
177 * files. 179 * files.
178 * @private 180 * @private
179 */ 181 */
180 handleDriveCacheSizeChanged_: function(size) { 182 handleDriveCacheSizeChanged_: function(size) {
181 this.$.driveCacheSize.textContent = size; 183 if (this.driveEnabled_)
184 this.$$('#driveCacheSize').textContent = size;
182 }, 185 },
183 186
184 /** 187 /**
185 * @param {string} size Formatted string representing the size of Browsing 188 * @param {string} size Formatted string representing the size of Browsing
186 * data. 189 * data.
187 * @private 190 * @private
188 */ 191 */
189 handleBrowsingDataSizeChanged_: function(size) { 192 handleBrowsingDataSizeChanged_: function(size) {
190 this.$.browsingDataSize.textContent = size; 193 this.$.browsingDataSize.textContent = size;
191 }, 194 },
192 195
193 /** 196 /**
194 * @param {string} size Formatted string representing the size of Android 197 * @param {string} size Formatted string representing the size of Android
195 * storage. 198 * storage.
196 * @private 199 * @private
197 */ 200 */
198 handleAndroidSizeChanged_: function(size) { 201 handleAndroidSizeChanged_: function(size) {
199 this.$.androidSize.textContent = size; 202 if (this.androidEnabled_)
203 this.$$('#androidSize').textContent = size;
200 }, 204 },
201 205
202 /** 206 /**
203 * @param {string} size Formatted string representing the size of Other users. 207 * @param {string} size Formatted string representing the size of Other users.
204 * @private 208 * @private
205 */ 209 */
206 handleOtherUsersSizeChanged_: function(size) { 210 handleOtherUsersSizeChanged_: function(size) {
207 this.$.otherUsersSize.textContent = size; 211 if (!this.isGuest_)
212 this.$$('#otherUsersSize').textContent = size;
208 }, 213 },
209 214
210 /** 215 /**
211 * @param {boolean} enabled True if Google Drive is enabled. 216 * @param {boolean} enabled True if Google Drive is enabled.
212 * @private 217 * @private
213 */ 218 */
214 handleDriveEnabledChanged_: function(enabled) { 219 handleDriveEnabledChanged_: function(enabled) {
215 this.driveEnabled_ = enabled; 220 this.driveEnabled_ = enabled;
216 }, 221 },
217 222
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 switch (spaceState) { 286 switch (spaceState) {
282 case settings.StorageSpaceState.LOW: 287 case settings.StorageSpaceState.LOW:
283 return 'space-low'; 288 return 'space-low';
284 case settings.StorageSpaceState.CRITICALLY_LOW: 289 case settings.StorageSpaceState.CRITICALLY_LOW:
285 return 'space-critically-low'; 290 return 'space-critically-low';
286 default: 291 default:
287 return ''; 292 return '';
288 } 293 }
289 }, 294 },
290 }); 295 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698