| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 Polymer({ | 5 Polymer({ |
| 6 is: 'cleanup-manager', | 6 is: 'cleanup-manager', |
| 7 | 7 |
| 8 properties: { | 8 properties: { |
| 9 hasScanResults: { | 9 hasScanResults: { |
| 10 type: Boolean, | 10 type: Boolean, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 /** @override */ | 44 /** @override */ |
| 45 created: function() { | 45 created: function() { |
| 46 this.browserProxy_ = cleanup.CleanupBrowserProxyImpl.getInstance(); | 46 this.browserProxy_ = cleanup.CleanupBrowserProxyImpl.getInstance(); |
| 47 }, | 47 }, |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * Sends a request for Chrome to start the Cleanup Tool's scanning process. | 50 * Sends a request for Chrome to start the Cleanup Tool's scanning process. |
| 51 * @private | 51 * @private |
| 52 */ | 52 */ |
| 53 onScanTap_: function() { | 53 onScanTap_: function() { |
| 54 // TODO implement me. | 54 this.isRunningScanner = true; |
| 55 this.browserProxy_.startScan().then(this.onScanComplete_.bind(this)); |
| 55 }, | 56 }, |
| 56 | 57 |
| 57 /** | 58 /** |
| 59 * @param {LastScanResult} lastScanResults |
| 60 */ |
| 61 onScanComplete_: function(lastScanResults) { |
| 62 this.isRunningScanner = false; |
| 63 this.updateLastScanState_(lastScanResults); |
| 64 }, |
| 65 |
| 66 /** |
| 58 * Sends a request for Chrome to open the Cleanup Tool's cleanup prompt. | 67 * Sends a request for Chrome to open the Cleanup Tool's cleanup prompt. |
| 59 * @private | 68 * @private |
| 60 */ | 69 */ |
| 61 onCleanupTap_: function() { | 70 onCleanupTap_: function() { |
| 62 // TODO implement me. | 71 // TODO implement me. |
| 63 }, | 72 }, |
| 64 | 73 |
| 65 /** | 74 /** |
| 66 * @param {boolean} hasScanResults | 75 * @param {boolean} hasScanResults |
| 67 * @param {boolean} isInfected | 76 * @param {boolean} isInfected |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 /** | 117 /** |
| 109 @param {LastScanResult} lastScanResults | 118 @param {LastScanResult} lastScanResults |
| 110 */ | 119 */ |
| 111 updateLastScanState_: function(lastScanResults) { | 120 updateLastScanState_: function(lastScanResults) { |
| 112 this.hasScanResults = lastScanResults.hasScanResults; | 121 this.hasScanResults = lastScanResults.hasScanResults; |
| 113 this.isInfected = lastScanResults.hasScanResults; | 122 this.isInfected = lastScanResults.hasScanResults; |
| 114 this.detectionStatusText = lastScanResults.detectionStatusText; | 123 this.detectionStatusText = lastScanResults.detectionStatusText; |
| 115 this.detectionTimeText = lastScanResults.detectionTimeText; | 124 this.detectionTimeText = lastScanResults.detectionTimeText; |
| 116 } | 125 } |
| 117 }); | 126 }); |
| OLD | NEW |