| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 cr.define('chrome.popular_sites_internals', function() { |
| 6 'use strict'; |
| 7 |
| 8 function initialize() { |
| 9 function submitDownload(event) { |
| 10 $('download-result').textContent = ''; |
| 11 chrome.send('download', [$('country-input').value, |
| 12 $('version-input').value]); |
| 13 event.preventDefault(); |
| 14 } |
| 15 |
| 16 $('submit-download').addEventListener('click', submitDownload); |
| 17 |
| 18 chrome.send('registerForEvents'); |
| 19 } |
| 20 |
| 21 function receiveDownloadResult(result) { |
| 22 $('download-result').textContent = result; |
| 23 } |
| 24 |
| 25 function receiveSites(sites) { |
| 26 jstProcess(new JsEvalContext(sites), $('sites')); |
| 27 } |
| 28 |
| 29 // Return an object with all of the exports. |
| 30 return { |
| 31 initialize: initialize, |
| 32 receiveDownloadResult: receiveDownloadResult, |
| 33 receiveSites: receiveSites, |
| 34 }; |
| 35 }); |
| 36 |
| 37 document.addEventListener('DOMContentLoaded', |
| 38 chrome.popular_sites_internals.initialize); |
| 39 |
| OLD | NEW |