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

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

Issue 2557103004: Add chrome://site-tiles-internals/ (Closed)
Patch Set: Address review comments 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..566aaf81d63d709fa6e0a733694eade2dd99315b
--- /dev/null
+++ b/components/ntp_tiles/webui/resources/site_tiles_internals.js
@@ -0,0 +1,43 @@
+// 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();
+ 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.site_tiles_internals.initialize);
+

Powered by Google App Engine
This is Rietveld 408576698