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

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

Issue 2457033003: Add chrome://popular-sites-internals/ to iOS. (Closed)
Patch Set: Break out ...Client. Created 4 years, 1 month 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 | « chrome/browser/resources/popular_sites_internals.html ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 cr.define('chrome.popular_sites_internals', function() {
6 'use strict';
7
8 function initialize() {
9 function submitUpdate(event) {
10 $('download-result').textContent = '';
11 chrome.send('update', [$('override-url').value,
12 $('override-country').value,
13 $('override-version').value]);
14 event.preventDefault();
15 }
16
17 $('submit-update').addEventListener('click', submitUpdate);
18
19 function viewJson(event) {
20 $('json-value').textContent = '';
21 chrome.send('viewJson');
22 event.preventDefault();
23 }
24
25 $('view-json').addEventListener('click', viewJson);
26
27 chrome.send('registerForEvents');
28 }
29
30 function receiveOverrides(url, country, version) {
31 $('override-url').value = url;
32 $('override-country').value = country;
33 $('override-version').value = version;
34 }
35
36 function receiveDownloadResult(result) {
37 $('download-result').textContent = result;
38 }
39
40 function receiveSites(sites) {
41 jstProcess(new JsEvalContext(sites), $('info'));
42 // Also clear the json string, since it's likely stale now.
43 $('json-value').textContent = '';
44 }
45
46 function receiveJson(json) {
47 $('json-value').textContent = json;
48 }
49
50 // Return an object with all of the exports.
51 return {
52 initialize: initialize,
53 receiveOverrides: receiveOverrides,
54 receiveDownloadResult: receiveDownloadResult,
55 receiveSites: receiveSites,
56 receiveJson: receiveJson,
57 };
58 });
59
60 document.addEventListener('DOMContentLoaded',
61 chrome.popular_sites_internals.initialize);
62
OLDNEW
« no previous file with comments | « chrome/browser/resources/popular_sites_internals.html ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698