Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: chrome/browser/resources/snippets_internals.js

Issue 2570673004: Remove host restrictions from snippets (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
OLDNEW
« no previous file with comments | « chrome/browser/resources/snippets_internals.html ('k') | chrome/browser/ui/webui/snippets_internals_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698