| 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('chrome.SnippetsInternals', function() { | 5 cr.define('chrome.SnippetsInternals', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 // Stores the list of suggestions we received in receiveContentSuggestions. | 8 // Stores the list of suggestions we received in receiveContentSuggestions. |
| 9 var lastSuggestions = []; | 9 var lastSuggestions = []; |
| 10 | 10 |
| 11 function initialize() { | 11 function initialize() { |
| 12 $('submit-download').addEventListener('click', function(event) { | 12 $('submit-download').addEventListener('click', function(event) { |
| 13 chrome.send('download', [$('hosts-input').value]); | 13 chrome.send('download'); |
| 14 event.preventDefault(); | 14 event.preventDefault(); |
| 15 }); | 15 }); |
| 16 | 16 |
| 17 $('submit-dump').addEventListener('click', function(event) { | 17 $('submit-dump').addEventListener('click', function(event) { |
| 18 downloadJson(JSON.stringify(lastSuggestions)); | 18 downloadJson(JSON.stringify(lastSuggestions)); |
| 19 event.preventDefault(); | 19 event.preventDefault(); |
| 20 }); | 20 }); |
| 21 | 21 |
| 22 $('last-json-button').addEventListener('click', function(event) { | 22 $('last-json-button').addEventListener('click', function(event) { |
| 23 $('last-json-container').classList.toggle('hidden'); | 23 $('last-json-container').classList.toggle('hidden'); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 receiveContentSuggestions: receiveContentSuggestions, | 168 receiveContentSuggestions: receiveContentSuggestions, |
| 169 receiveJson: receiveJson, | 169 receiveJson: receiveJson, |
| 170 receiveClassification: receiveClassification, | 170 receiveClassification: receiveClassification, |
| 171 receiveLastRemoteSuggestionsBackgroundFetchTime: | 171 receiveLastRemoteSuggestionsBackgroundFetchTime: |
| 172 receiveLastRemoteSuggestionsBackgroundFetchTime, | 172 receiveLastRemoteSuggestionsBackgroundFetchTime, |
| 173 }; | 173 }; |
| 174 }); | 174 }); |
| 175 | 175 |
| 176 document.addEventListener('DOMContentLoaded', | 176 document.addEventListener('DOMContentLoaded', |
| 177 chrome.SnippetsInternals.initialize); | 177 chrome.SnippetsInternals.initialize); |
| OLD | NEW |