| OLD | NEW |
| 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 * Enumeration for device state about remaining space. | 6 * Enumeration for device state about remaining space. |
| 7 * These values must be kept in sync with | 7 * These values must be kept in sync with |
| 8 * StorageManagerHandler::StorageSpaceState in C++ code. | 8 * StorageManagerHandler::StorageSpaceState in C++ code. |
| 9 * @enum {number} | 9 * @enum {number} |
| 10 * @const | 10 * @const |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 /** @override */ | 44 /** @override */ |
| 45 initializePage: function() { | 45 initializePage: function() { |
| 46 Page.prototype.initializePage.call(this); | 46 Page.prototype.initializePage.call(this); |
| 47 | 47 |
| 48 $('storage-manager-label-downloads').onclick = function() { | 48 $('storage-manager-label-downloads').onclick = function() { |
| 49 chrome.send('openDownloads'); | 49 chrome.send('openDownloads'); |
| 50 }; | 50 }; |
| 51 $('storage-manager-label-drive-cache').onclick = function() { | 51 $('storage-manager-label-drive-cache').onclick = function() { |
| 52 PageManager.showPageByName('storageClearDriveCache'); | 52 PageManager.showPageByName('storageClearDriveCache'); |
| 53 }; | 53 }; |
| 54 $('storage-manager-label-browsing-data').onclick = function() { |
| 55 PageManager.showPageByName('clearBrowserData'); |
| 56 }; |
| 54 $('storage-manager-label-arc').onclick = function() { | 57 $('storage-manager-label-arc').onclick = function() { |
| 55 chrome.send('openArcStorage'); | 58 chrome.send('openArcStorage'); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 $('storage-confirm').onclick = function() { | 61 $('storage-confirm').onclick = function() { |
| 59 PageManager.closeOverlay(); | 62 PageManager.closeOverlay(); |
| 60 }; | 63 }; |
| 61 }, | 64 }, |
| 62 | 65 |
| 63 /** @override */ | 66 /** @override */ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 * Updates the size of Google Drive offline files. | 102 * Updates the size of Google Drive offline files. |
| 100 * @param {string} size Formatted string of the size of Google Drive offline | 103 * @param {string} size Formatted string of the size of Google Drive offline |
| 101 * files. | 104 * files. |
| 102 * @private | 105 * @private |
| 103 */ | 106 */ |
| 104 setDriveCacheSize_: function(size) { | 107 setDriveCacheSize_: function(size) { |
| 105 $('storage-manager-size-drive-cache').textContent = size; | 108 $('storage-manager-size-drive-cache').textContent = size; |
| 106 }, | 109 }, |
| 107 | 110 |
| 108 /** | 111 /** |
| 112 * Updates the size of browsing data. |
| 113 * @param {string} size Formatted string of the size of Downloads. |
| 114 * @private |
| 115 */ |
| 116 setBrowsingDataSize_: function(size) { |
| 117 $('storage-manager-size-browsing-data').textContent = size; |
| 118 }, |
| 119 |
| 120 /** |
| 109 * Updates the total size of Android apps and cache. | 121 * Updates the total size of Android apps and cache. |
| 110 * @param {string} size Formatted string of the size of Android apps and | 122 * @param {string} size Formatted string of the size of Android apps and |
| 111 * cache. | 123 * cache. |
| 112 * @private | 124 * @private |
| 113 */ | 125 */ |
| 114 setArcSize_: function(size) { | 126 setArcSize_: function(size) { |
| 115 assert(!$('storage-manager-item-arc').hidden); | 127 assert(!$('storage-manager-item-arc').hidden); |
| 116 $('storage-manager-size-arc').textContent = size; | 128 $('storage-manager-size-arc').textContent = size; |
| 117 }, | 129 }, |
| 118 | 130 |
| 119 /** | 131 /** |
| 120 * Shows the item "Android apps and cache" on the overlay UI. | 132 * Shows the item "Android apps and cache" on the overlay UI. |
| 121 * @private | 133 * @private |
| 122 */ | 134 */ |
| 123 showArcItem_: function() { | 135 showArcItem_: function() { |
| 124 $('storage-manager-item-arc').hidden = false; | 136 $('storage-manager-item-arc').hidden = false; |
| 125 }, | 137 }, |
| 126 }; | 138 }; |
| 127 | 139 |
| 128 // Forward public APIs to private implementations. | 140 // Forward public APIs to private implementations. |
| 129 cr.makePublic(StorageManager, [ | 141 cr.makePublic(StorageManager, [ |
| 130 'setArcSize', | 142 'setArcSize', |
| 143 'setBrowsingDataSize', |
| 131 'setDownloadsSize', | 144 'setDownloadsSize', |
| 132 'setDriveCacheSize', | 145 'setDriveCacheSize', |
| 133 'setSizeStat', | 146 'setSizeStat', |
| 134 'showArcItem', | 147 'showArcItem', |
| 135 ]); | 148 ]); |
| 136 | 149 |
| 137 return { | 150 return { |
| 138 StorageManager: StorageManager | 151 StorageManager: StorageManager |
| 139 }; | 152 }; |
| 140 }); | 153 }); |
| OLD | NEW |