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

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

Issue 2570673004: Remove host restrictions from snippets (Closed)
Patch Set: Remove host restrictions from snippets 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 initialize: initialize, 155 initialize: initialize,
156 receiveProperty: receiveProperty, 156 receiveProperty: receiveProperty,
157 receiveContentSuggestions: receiveContentSuggestions, 157 receiveContentSuggestions: receiveContentSuggestions,
158 receiveJson: receiveJson, 158 receiveJson: receiveJson,
159 receiveClassification: receiveClassification, 159 receiveClassification: receiveClassification,
160 }; 160 };
161 }); 161 });
162 162
163 document.addEventListener('DOMContentLoaded', 163 document.addEventListener('DOMContentLoaded',
164 chrome.SnippetsInternals.initialize); 164 chrome.SnippetsInternals.initialize);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698