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

Unified Diff: chrome/test/data/register_form.html

Issue 3058006: Add API on host registration page. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: fixes Created 10 years, 5 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
« no previous file with comments | « chrome/browser/resources/host_registration_page.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/register_form.html
diff --git a/chrome/test/data/register_form.html b/chrome/test/data/register_form.html
new file mode 100644
index 0000000000000000000000000000000000000000..5793a940b93f4be65ce0957aaed30618838c39e3
--- /dev/null
+++ b/chrome/test/data/register_form.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<!-- Test page for Chrome OS register form that is hosted at OEM partner site
+ and is loaded in chrome://register host page -->
+<html><head>
+<title>Registration test form</title>
+<style>
+
+#main {
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ padding: 10px;
+ overflow: hidden;
+ background: -webkit-gradient(linear, left top, left bottom, from(#FAFBFB), to(#CCD1D4));
+}
+</style>
+<script>
+document.addEventListener('DOMContentLoaded', load);
+var hostUrl = 'chrome://register';
+
+window.addEventListener('message', processMessage);
+
+function $(o) {
+ return document.getElementById(o);
+}
+
+function load() {
+ var msg = {
+ type: 'get_user_info',
+ domain: location.href,
+ payload: {}
+ };
+ window.parent.postMessage(msg, hostUrl);
+ $('url').textContent = location.href;
+}
+
+function processMessage(e) {
+ // TODO(nkostylev): e.origin is passed as null and not checked.
+ // Probably because it's served from chrome:// scheme.
+ if (e.data.domain != hostUrl)
+ return;
+
+ if (e.data.type == 'set_user_info') {
+ // TODO(nkostylev): Extract all available system/user info.
+ // http://crosbug.com/4813
+ var info = e.data.payload;
+ $('info').textContent = 'OS: ' + info.os_name + ', ' +
+ info.os_version + ' SKU:' + info.system_sku;
+ }
+
+ $('messageInfo').textContent = 'e.origin: ' + e.origin +
+ ', e.data.domain: ' + e.data.domain;
+}
+
+function registration(result) {
+ var msg = {
+ type: 'complete_registration',
+ domain: location.href,
+ payload: {
+ registration_status: result
+ }
+ };
+ var parent = window.parent;
+ parent.postMessage(msg, hostUrl);
+}
+</script>
+</head>
+<body>
+<div id="main">
+ <h3>Register your computer with Google</h3>
+ <i>This registration form is hosted at </i><div id="url"></div><br>
+ <i>User info received from host page:</i><br>
+ <div id="info"></div><br>
+ <i>Message info:</i><br>
+ <div id="messageInfo"></div><br>
+ <input type="button" value="Skip" onclick="registration(false);">
+ <input type="button" value="Register" onclick="registration(true);">
+</div>
+</body></html>
« no previous file with comments | « chrome/browser/resources/host_registration_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698