| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 /** @const */ var DeletableItemList = options.DeletableItemList; | 6 /** @const */ var DeletableItemList = options.DeletableItemList; |
| 7 /** @const */ var DeletableItem = options.DeletableItem; | 7 /** @const */ var DeletableItem = options.DeletableItem; |
| 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
| 9 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 9 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 ['modified', 'label_indexed_db_last_modified']], | 36 ['modified', 'label_indexed_db_last_modified']], |
| 37 'file_system': [['origin', 'label_file_system_origin'], | 37 'file_system': [['origin', 'label_file_system_origin'], |
| 38 ['persistent', 'label_file_system_persistent_usage'], | 38 ['persistent', 'label_file_system_persistent_usage'], |
| 39 ['temporary', 'label_file_system_temporary_usage']], | 39 ['temporary', 'label_file_system_temporary_usage']], |
| 40 'channel_id': [['serverId', 'label_channel_id_server_id'], | 40 'channel_id': [['serverId', 'label_channel_id_server_id'], |
| 41 ['certType', 'label_channel_id_type'], | 41 ['certType', 'label_channel_id_type'], |
| 42 ['created', 'label_channel_id_created']], | 42 ['created', 'label_channel_id_created']], |
| 43 'service_worker': [['origin', 'label_service_worker_origin'], | 43 'service_worker': [['origin', 'label_service_worker_origin'], |
| 44 ['size', 'label_service_worker_size'], | 44 ['size', 'label_service_worker_size'], |
| 45 ['scopes', 'label_service_worker_scopes']], | 45 ['scopes', 'label_service_worker_scopes']], |
| 46 'cache_storage': [['origin', 'label_cache_storage_origin'], |
| 47 ['size', 'label_cache_storage_size'], |
| 48 ['modified', 'label_cache_storage_last_modified']], |
| 46 'flash_lso': [['domain', 'label_cookie_domain']], | 49 'flash_lso': [['domain', 'label_cookie_domain']], |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 /** | 52 /** |
| 50 * Returns the item's height, like offsetHeight but such that it works better | 53 * Returns the item's height, like offsetHeight but such that it works better |
| 51 * when the page is zoomed. See the similar calculation in @{code cr.ui.List}. | 54 * when the page is zoomed. See the similar calculation in @{code cr.ui.List}. |
| 52 * This version also accounts for the animation done in this file. | 55 * This version also accounts for the animation done in this file. |
| 53 * @param {Element} item The item to get the height of. | 56 * @param {Element} item The item to get the height of. |
| 54 * @return {number} The height of the item, calculated with zooming in mind. | 57 * @return {number} The height of the item, calculated with zooming in mind. |
| 55 */ | 58 */ |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 updateOrigin: function() { | 248 updateOrigin: function() { |
| 246 var info = { | 249 var info = { |
| 247 cookies: 0, | 250 cookies: 0, |
| 248 database: false, | 251 database: false, |
| 249 localStorage: false, | 252 localStorage: false, |
| 250 appCache: false, | 253 appCache: false, |
| 251 indexedDb: false, | 254 indexedDb: false, |
| 252 fileSystem: false, | 255 fileSystem: false, |
| 253 channelIDs: 0, | 256 channelIDs: 0, |
| 254 serviceWorker: false, | 257 serviceWorker: false, |
| 258 cacheStorage: false, |
| 255 }; | 259 }; |
| 256 if (this.origin) | 260 if (this.origin) |
| 257 this.origin.collectSummaryInfo(info); | 261 this.origin.collectSummaryInfo(info); |
| 258 | 262 |
| 259 var list = []; | 263 var list = []; |
| 260 if (info.cookies > 1) | 264 if (info.cookies > 1) |
| 261 list.push(loadTimeData.getStringF('cookie_plural', info.cookies)); | 265 list.push(loadTimeData.getStringF('cookie_plural', info.cookies)); |
| 262 else if (info.cookies > 0) | 266 else if (info.cookies > 0) |
| 263 list.push(loadTimeData.getString('cookie_singular')); | 267 list.push(loadTimeData.getString('cookie_singular')); |
| 264 if (info.database || info.indexedDb) | 268 if (info.database || info.indexedDb) |
| 265 list.push(loadTimeData.getString('cookie_database_storage')); | 269 list.push(loadTimeData.getString('cookie_database_storage')); |
| 266 if (info.localStorage) | 270 if (info.localStorage) |
| 267 list.push(loadTimeData.getString('cookie_local_storage')); | 271 list.push(loadTimeData.getString('cookie_local_storage')); |
| 268 if (info.appCache) | 272 if (info.appCache) |
| 269 list.push(loadTimeData.getString('cookie_app_cache')); | 273 list.push(loadTimeData.getString('cookie_app_cache')); |
| 270 if (info.fileSystem) | 274 if (info.fileSystem) |
| 271 list.push(loadTimeData.getString('cookie_file_system')); | 275 list.push(loadTimeData.getString('cookie_file_system')); |
| 272 if (info.channelIDs) | 276 if (info.channelIDs) |
| 273 list.push(loadTimeData.getString('cookie_channel_id')); | 277 list.push(loadTimeData.getString('cookie_channel_id')); |
| 274 if (info.serviceWorker) | 278 if (info.serviceWorker) |
| 275 list.push(loadTimeData.getString('cookie_service_worker')); | 279 list.push(loadTimeData.getString('cookie_service_worker')); |
| 280 if (info.cacheStorage) |
| 281 list.push(loadTimeData.getString('cookie_cache_storage')); |
| 276 if (info.flashLSO) | 282 if (info.flashLSO) |
| 277 list.push(loadTimeData.getString('cookie_flash_lso')); | 283 list.push(loadTimeData.getString('cookie_flash_lso')); |
| 278 | 284 |
| 279 var text = ''; | 285 var text = ''; |
| 280 for (var i = 0; i < list.length; ++i) { | 286 for (var i = 0; i < list.length; ++i) { |
| 281 if (text.length > 0) | 287 if (text.length > 0) |
| 282 text += ', ' + list[i]; | 288 text += ', ' + list[i]; |
| 283 else | 289 else |
| 284 text = list[i]; | 290 text = list[i]; |
| 285 } | 291 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 } else if (this.data.type == 'indexed_db') { | 490 } else if (this.data.type == 'indexed_db') { |
| 485 info.indexedDb = true; | 491 info.indexedDb = true; |
| 486 } else if (this.data.type == 'file_system') { | 492 } else if (this.data.type == 'file_system') { |
| 487 info.fileSystem = true; | 493 info.fileSystem = true; |
| 488 } else if (this.data.type == 'quota') { | 494 } else if (this.data.type == 'quota') { |
| 489 info.quota = this.data; | 495 info.quota = this.data; |
| 490 } else if (this.data.type == 'channel_id') { | 496 } else if (this.data.type == 'channel_id') { |
| 491 info.channelIDs++; | 497 info.channelIDs++; |
| 492 } else if (this.data.type == 'service_worker') { | 498 } else if (this.data.type == 'service_worker') { |
| 493 info.serviceWorker = true; | 499 info.serviceWorker = true; |
| 500 } else if (this.data.type == 'cache_storage') { |
| 501 info.cacheStorage = true; |
| 494 } else if (this.data.type == 'flash_lso') { | 502 } else if (this.data.type == 'flash_lso') { |
| 495 info.flashLSO = true; | 503 info.flashLSO = true; |
| 496 } | 504 } |
| 497 | 505 |
| 498 var apps = this.data.appsProtectingThis; | 506 var apps = this.data.appsProtectingThis; |
| 499 if (apps) { | 507 if (apps) { |
| 500 if (!info.appsProtectingThis) | 508 if (!info.appsProtectingThis) |
| 501 info.appsProtectingThis = {}; | 509 info.appsProtectingThis = {}; |
| 502 apps.forEach(function(appInfo) { | 510 apps.forEach(function(appInfo) { |
| 503 info.appsProtectingThis[appInfo.id] = appInfo; | 511 info.appsProtectingThis[appInfo.id] = appInfo; |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 parent.endBatchUpdates(); | 936 parent.endBatchUpdates(); |
| 929 }, | 937 }, |
| 930 }; | 938 }; |
| 931 | 939 |
| 932 return { | 940 return { |
| 933 CookiesList: CookiesList, | 941 CookiesList: CookiesList, |
| 934 CookieListItem: CookieListItem, | 942 CookieListItem: CookieListItem, |
| 935 CookieTreeNode: CookieTreeNode, | 943 CookieTreeNode: CookieTreeNode, |
| 936 }; | 944 }; |
| 937 }); | 945 }); |
| OLD | NEW |