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

Unified Diff: components/ntp_tiles/webui/resources/site_tiles_internals.js

Issue 2557103004: Add chrome://site-tiles-internals/ (Closed)
Patch Set: Fix gn check 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_tiles/webui/resources/site_tiles_internals.js
diff --git a/components/ntp_tiles/webui/resources/site_tiles_internals.js b/components/ntp_tiles/webui/resources/site_tiles_internals.js
new file mode 100644
index 0000000000000000000000000000000000000000..9d02d5df29b8b1c41b236601c83b30bd0aa9fa72
--- /dev/null
+++ b/components/ntp_tiles/webui/resources/site_tiles_internals.js
@@ -0,0 +1,72 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('chrome.site_tiles_internals', function() {
+ 'use strict';
+
+ var initialize = function() {
+ receiveSites({});
+
+ $('submit-update').addEventListener('click', function(event) {
+ event.preventDefault();
+ /*
+ $('download-result').textContent = '';
+ */
+ chrome.send('update', [{
+ "popular": {
+ "overrideURL": $('override-url').value,
+ "overrideCountry": $('override-country').value,
+ "overrideVersion": $('override-version').value,
+ },
+ }])
+ });
+
+ /*
+ $('view-json').addEventListener('click', function(event) {
+ $('json-value').textContent = '';
+ chrome.send('viewJson');
+ event.preventDefault();
+ });
+ */
Marc Treib 2016/12/08 15:41:50 Either implement or remove all the commented-out p
sfiera 2016/12/08 16:44:35 Removed.
+
+ chrome.send('registerForEvents');
+ }
+
+ var receiveSourceInfo = function(state) {
+ jstProcess(new JsEvalContext(state), $('sources'));
+ }
+
+ var receiveSites = function(sites) {
+ jstProcess(new JsEvalContext(sites), $('sites'));
+ /*
+ // Also clear the json string, since it's likely stale now.
+ $('json-value').textContent = '';
+ */
+ }
+
+ /*
+ var receiveDownloadResult = function(result) {
+ $('download-result').textContent = result;
+ }
+
+ var receiveJson = function(json) {
+ $('json-value').textContent = json;
+ }
+ */
+
+ // Return an object with all of the exports.
+ return {
+ initialize: initialize,
+ receiveSourceInfo: receiveSourceInfo,
+ receiveSites: receiveSites,
+ /*
+ receiveDownloadResult: receiveDownloadResult,
+ receiveJson: receiveJson,
+ */
+ };
+});
+
+document.addEventListener('DOMContentLoaded',
+ chrome.site_tiles_internals.initialize);
+

Powered by Google App Engine
This is Rietveld 408576698