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 |
11 /** @type {!Array<SavePageRequest>} */ | 11 /** @type {!Array<SavePageRequest>} */ |
12 var savePageRequests = []; | 12 var savePageRequests = []; |
13 | 13 |
14 /** @type {offlineInternals.OfflineInternalsBrowserProxy} */ | 14 /** @type {offlineInternals.OfflineInternalsBrowserProxy} */ |
dpapad
2016/06/29 01:03:14
Nit: The type annotation can now be more accurate
| |
15 var browserProxy_; | 15 var browserProxy_ = |
16 offlineInternals.OfflineInternalsBrowserProxyImpl.getInstance(); | |
16 | 17 |
17 /** | 18 /** |
18 * Fill stored pages table. | 19 * Fill stored pages table. |
19 * @param {!Array<OfflinePage>} pages An array object representing | 20 * @param {!Array<OfflinePage>} pages An array object representing |
20 * stored offline pages. | 21 * stored offline pages. |
21 */ | 22 */ |
22 function fillStoredPages(pages) { | 23 function fillStoredPages(pages) { |
23 var storedPagesTable = $('stored-pages'); | 24 var storedPagesTable = $('stored-pages'); |
24 storedPagesTable.textContent = ''; | 25 storedPagesTable.textContent = ''; |
25 | 26 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 $('download').onclick = download; | 175 $('download').onclick = download; |
175 $('log-model-on').onclick = | 176 $('log-model-on').onclick = |
176 browserProxy_.setRecordPageModel.bind(browserProxy_, true); | 177 browserProxy_.setRecordPageModel.bind(browserProxy_, true); |
177 $('log-model-off').onclick = | 178 $('log-model-off').onclick = |
178 browserProxy_.setRecordPageModel.bind(browserProxy_, false); | 179 browserProxy_.setRecordPageModel.bind(browserProxy_, false); |
179 $('log-request-on').onclick = | 180 $('log-request-on').onclick = |
180 browserProxy_.setRecordRequestQueue.bind(browserProxy_, true); | 181 browserProxy_.setRecordRequestQueue.bind(browserProxy_, true); |
181 $('log-request-off').onclick = | 182 $('log-request-off').onclick = |
182 browserProxy_.setRecordRequestQueue.bind(browserProxy_, false); | 183 browserProxy_.setRecordRequestQueue.bind(browserProxy_, false); |
183 $('refresh-logs').onclick = refreshLog; | 184 $('refresh-logs').onclick = refreshLog; |
184 browserProxy_ = | |
185 offlineInternals.OfflineInternalsBrowserProxyImpl.getInstance(); | |
186 refreshAll(); | 185 refreshAll(); |
187 } | 186 } |
188 | 187 |
189 // Return an object with all of the exports. | 188 // Return an object with all of the exports. |
190 return { | 189 return { |
191 initialize: initialize, | 190 initialize: initialize, |
192 }; | 191 }; |
193 }); | 192 }); |
194 | 193 |
195 document.addEventListener('DOMContentLoaded', offlineInternals.initialize); | 194 document.addEventListener('DOMContentLoaded', offlineInternals.initialize); |
OLD | NEW |