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

Unified Diff: chrome/browser/resources/popular_sites_internals.js

Issue 1340493002: Add initial version of chrome://popular-sites-internals page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@finch_country_version
Patch Set: review3 Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/popular_sites_internals.js
diff --git a/chrome/browser/resources/popular_sites_internals.js b/chrome/browser/resources/popular_sites_internals.js
new file mode 100644
index 0000000000000000000000000000000000000000..24c4bed10edfe7cf097b2bcc0b3f42a29660b306
--- /dev/null
+++ b/chrome/browser/resources/popular_sites_internals.js
@@ -0,0 +1,39 @@
+// 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.popular_sites_internals', function() {
+ 'use strict';
+
+ function initialize() {
+ function submitDownload(event) {
+ $('download-result').textContent = '';
+ chrome.send('download', [$('country-input').value,
+ $('version-input').value]);
+ event.preventDefault();
+ }
+
+ $('submit-download').addEventListener('click', submitDownload);
+
+ chrome.send('registerForEvents');
+ }
+
+ function receiveDownloadResult(result) {
+ $('download-result').textContent = result;
+ }
+
+ function receiveSites(sites) {
+ jstProcess(new JsEvalContext(sites), $('sites'));
+ }
+
+ // Return an object with all of the exports.
+ return {
+ initialize: initialize,
+ receiveDownloadResult: receiveDownloadResult,
+ receiveSites: receiveSites,
+ };
+});
+
+document.addEventListener('DOMContentLoaded',
+ chrome.popular_sites_internals.initialize);
+
« no previous file with comments | « chrome/browser/resources/popular_sites_internals.html ('k') | chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698