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

Unified Diff: components/physical_web/webui/resources/physical_web.js

Issue 2248913007: Add a Physical Web WebUI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: components/physical_web/webui/resources/physical_web.js
diff --git a/components/physical_web/webui/resources/physical_web.js b/components/physical_web/webui/resources/physical_web.js
new file mode 100644
index 0000000000000000000000000000000000000000..459fb181b5bcea14b63b28400d3aeae984701376
--- /dev/null
+++ b/components/physical_web/webui/resources/physical_web.js
@@ -0,0 +1,31 @@
+// Copyright (c) 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.
+
+/**
+ * Takes the |nearbyUrlsData| input argument which holds metadata for web pages
+ * broadcast by nearby devices.
+ * @param {Object} nearbyUrlsData Information about web pages broadcast by
+ * nearby devices
+ */
+function renderTemplate(nearbyUrlsData) {
+ // This is the javascript code that processes the template:
+ jstProcess(new JsEvalContext(nearbyUrlsData), $('physicalWebTemplate'));
+}
+
+function requestNearbyURLs() {
+ chrome.send('requestNearbyURLs');
+}
+
+function handleClickPhysicalWebItem(node) {
+ // do something
+}
+
+function returnNearbyURLs(nearbyUrlsData) {
+ var bodyContainer = $('body-container');
+ renderTemplate(nearbyUrlsData);
+
+ bodyContainer.style.visibility = 'visible';
+}
+
+document.addEventListener('DOMContentLoaded', requestNearbyURLs);

Powered by Google App Engine
This is Rietveld 408576698