Chromium Code Reviews| 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 cr.define('offlineInternals', function() { | 5 cr.define('offlineInternals', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** @type {!Array<OfflinePage>} */ | 8 /** @type {!Array<OfflinePage>} */ |
| 9 var offlinePages = []; | 9 var offlinePages = []; |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 function refreshLog() { | 165 function refreshLog() { |
| 166 browserProxy_.getEventLogs().then(fillEventLog); | 166 browserProxy_.getEventLogs().then(fillEventLog); |
| 167 browserProxy_.getLoggingState().then(updateLogStatus); | 167 browserProxy_.getLoggingState().then(updateLogStatus); |
| 168 } | 168 } |
| 169 | 169 |
| 170 function initialize() { | 170 function initialize() { |
| 171 $('clear-all').onclick = deleteAllPages; | 171 $('clear-all').onclick = deleteAllPages; |
| 172 $('clear-selected').onclick = deleteSelectedPages; | 172 $('clear-selected').onclick = deleteSelectedPages; |
| 173 $('refresh').onclick = refreshAll; | 173 $('refresh').onclick = refreshAll; |
| 174 $('download').onclick = download; | 174 $('download').onclick = download; |
| 175 browserProxy_ = | |
|
dpapad
2016/06/29 00:22:18
Is there any good reason to not initialize this at
Dmitry Titov
2016/06/29 01:01:30
Done.
| |
| 176 offlineInternals.OfflineInternalsBrowserProxyImpl.getInstance(); | |
| 175 $('log-model-on').onclick = | 177 $('log-model-on').onclick = |
| 176 browserProxy_.setRecordPageModel.bind(browserProxy_, true); | 178 browserProxy_.setRecordPageModel.bind(browserProxy_, true); |
| 177 $('log-model-off').onclick = | 179 $('log-model-off').onclick = |
| 178 browserProxy_.setRecordPageModel.bind(browserProxy_, false); | 180 browserProxy_.setRecordPageModel.bind(browserProxy_, false); |
| 179 $('log-request-on').onclick = | 181 $('log-request-on').onclick = |
| 180 browserProxy_.setRecordRequestQueue.bind(browserProxy_, true); | 182 browserProxy_.setRecordRequestQueue.bind(browserProxy_, true); |
| 181 $('log-request-off').onclick = | 183 $('log-request-off').onclick = |
| 182 browserProxy_.setRecordRequestQueue.bind(browserProxy_, false); | 184 browserProxy_.setRecordRequestQueue.bind(browserProxy_, false); |
| 183 $('refresh-logs').onclick = refreshLog; | 185 $('refresh-logs').onclick = refreshLog; |
| 184 browserProxy_ = | |
| 185 offlineInternals.OfflineInternalsBrowserProxyImpl.getInstance(); | |
| 186 refreshAll(); | 186 refreshAll(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 // Return an object with all of the exports. | 189 // Return an object with all of the exports. |
| 190 return { | 190 return { |
| 191 initialize: initialize, | 191 initialize: initialize, |
| 192 }; | 192 }; |
| 193 }); | 193 }); |
| 194 | 194 |
| 195 document.addEventListener('DOMContentLoaded', offlineInternals.initialize); | 195 document.addEventListener('DOMContentLoaded', offlineInternals.initialize); |
| OLD | NEW |