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

Side by Side Diff: components/ntp_tiles/webui/resources/popular_sites_internals.js

Issue 2841643005: [Popular Sites] Add Variations parameter to override URL path (Closed)
Patch Set: Update ntp-tiles-internals. Created 3 years, 7 months 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
« no previous file with comments | « components/ntp_tiles/webui/resources/popular_sites_internals.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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.popular_sites_internals', function() { 5 cr.define('chrome.popular_sites_internals', function() {
6 'use strict'; 6 'use strict';
7 7
8 function initialize() { 8 function initialize() {
9 function submitUpdate(event) { 9 function submitUpdate(event) {
10 $('download-result').textContent = ''; 10 $('download-result').textContent = '';
11 chrome.send('update', [$('override-url').value, 11 chrome.send('update', [$('override-url').value,
12 $('override-directory').value,
12 $('override-country').value, 13 $('override-country').value,
13 $('override-version').value]); 14 $('override-version').value]);
14 event.preventDefault(); 15 event.preventDefault();
15 } 16 }
16 17
17 $('submit-update').addEventListener('click', submitUpdate); 18 $('submit-update').addEventListener('click', submitUpdate);
18 19
19 function viewJson(event) { 20 function viewJson(event) {
20 $('json-value').textContent = ''; 21 $('json-value').textContent = '';
21 chrome.send('viewJson'); 22 chrome.send('viewJson');
22 event.preventDefault(); 23 event.preventDefault();
23 } 24 }
24 25
25 $('view-json').addEventListener('click', viewJson); 26 $('view-json').addEventListener('click', viewJson);
26 27
27 chrome.send('registerForEvents'); 28 chrome.send('registerForEvents');
28 } 29 }
29 30
30 function receiveOverrides(url, country, version) { 31 function receiveOverrides(url, directory, country, version) {
31 $('override-url').value = url; 32 $('override-url').value = url;
33 $('override-directory').value = directory;
32 $('override-country').value = country; 34 $('override-country').value = country;
33 $('override-version').value = version; 35 $('override-version').value = version;
34 } 36 }
35 37
36 function receiveDownloadResult(result) { 38 function receiveDownloadResult(result) {
37 $('download-result').textContent = result; 39 $('download-result').textContent = result;
38 } 40 }
39 41
40 function receiveSites(sites) { 42 function receiveSites(sites) {
41 jstProcess(new JsEvalContext(sites), $('info')); 43 jstProcess(new JsEvalContext(sites), $('info'));
(...skipping 10 matching lines...) Expand all
52 initialize: initialize, 54 initialize: initialize,
53 receiveOverrides: receiveOverrides, 55 receiveOverrides: receiveOverrides,
54 receiveDownloadResult: receiveDownloadResult, 56 receiveDownloadResult: receiveDownloadResult,
55 receiveSites: receiveSites, 57 receiveSites: receiveSites,
56 receiveJson: receiveJson, 58 receiveJson: receiveJson,
57 }; 59 };
58 }); 60 });
59 61
60 document.addEventListener('DOMContentLoaded', 62 document.addEventListener('DOMContentLoaded',
61 chrome.popular_sites_internals.initialize); 63 chrome.popular_sites_internals.initialize);
62
OLDNEW
« no previous file with comments | « components/ntp_tiles/webui/resources/popular_sites_internals.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698