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

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

Issue 2557103004: Add chrome://site-tiles-internals/ (Closed)
Patch Set: rebase 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
« no previous file with comments | « components/ntp_tiles/webui/resources/ntp_tiles_internals.html ('k') | components/resources/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_tiles/webui/resources/ntp_tiles_internals.js
diff --git a/components/ntp_tiles/webui/resources/ntp_tiles_internals.js b/components/ntp_tiles/webui/resources/ntp_tiles_internals.js
new file mode 100644
index 0000000000000000000000000000000000000000..bcb05d5e68c1236829842dd00cb5e8d0b36bcdf7
--- /dev/null
+++ b/components/ntp_tiles/webui/resources/ntp_tiles_internals.js
@@ -0,0 +1,43 @@
+// Copyright 2016 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.ntp_tiles_internals', function() {
+ 'use strict';
+
+ var initialize = function() {
+ receiveSites({});
+
+ $('submit-update').addEventListener('click', function(event) {
+ event.preventDefault();
+ chrome.send('update', [{
+ "popular": {
+ "overrideURL": $('override-url').value,
+ "overrideCountry": $('override-country').value,
+ "overrideVersion": $('override-version').value,
+ },
+ }])
+ });
+
+ chrome.send('registerForEvents');
+ }
+
+ var receiveSourceInfo = function(state) {
+ jstProcess(new JsEvalContext(state), $('sources'));
+ }
+
+ var receiveSites = function(sites) {
+ jstProcess(new JsEvalContext(sites), $('sites'));
+ }
+
+ // Return an object with all of the exports.
+ return {
+ initialize: initialize,
+ receiveSourceInfo: receiveSourceInfo,
+ receiveSites: receiveSites,
+ };
+});
+
+document.addEventListener('DOMContentLoaded',
+ chrome.ntp_tiles_internals.initialize);
+
« no previous file with comments | « components/ntp_tiles/webui/resources/ntp_tiles_internals.html ('k') | components/resources/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698