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

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

Issue 1851803002: [NTP Popular Sites] Store country/version in prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 years, 8 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
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 submitDownload(event) { 9 function submitDownload(event) {
10 $('download-result').textContent = ''; 10 $('download-result').textContent = '';
(...skipping 14 matching lines...) Expand all
25 $('view-json').addEventListener('click', viewJson); 25 $('view-json').addEventListener('click', viewJson);
26 26
27 chrome.send('registerForEvents'); 27 chrome.send('registerForEvents');
28 } 28 }
29 29
30 function receiveDownloadResult(result) { 30 function receiveDownloadResult(result) {
31 $('download-result').textContent = result; 31 $('download-result').textContent = result;
32 } 32 }
33 33
34 function receiveSites(sites) { 34 function receiveSites(sites) {
35 jstProcess(new JsEvalContext(sites), $('sites')); 35 var context = new JsEvalContext(sites);
36 jstProcess(context, $('info'));
Bernhard Bauer 2016/04/07 12:24:28 You could just process the parent of these nodes.
Marc Treib 2016/04/07 13:38:39 Done.
37 jstProcess(context, $('sites'));
36 // Also clear the json string, since it's likely stale now. 38 // Also clear the json string, since it's likely stale now.
37 $('json-value').textContent = ''; 39 $('json-value').textContent = '';
38 } 40 }
39 41
40 function receiveJson(json) { 42 function receiveJson(json) {
41 $('json-value').textContent = json; 43 $('json-value').textContent = json;
42 } 44 }
43 45
44 // Return an object with all of the exports. 46 // Return an object with all of the exports.
45 return { 47 return {
46 initialize: initialize, 48 initialize: initialize,
47 receiveDownloadResult: receiveDownloadResult, 49 receiveDownloadResult: receiveDownloadResult,
48 receiveSites: receiveSites, 50 receiveSites: receiveSites,
49 receiveJson: receiveJson, 51 receiveJson: receiveJson,
50 }; 52 };
51 }); 53 });
52 54
53 document.addEventListener('DOMContentLoaded', 55 document.addEventListener('DOMContentLoaded',
54 chrome.popular_sites_internals.initialize); 56 chrome.popular_sites_internals.initialize);
55 57
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698