2 <!-- Test page for Chrome OS register form that is hosted at OEM partner site
3 and is loaded in chrome://register host page -->
5 <title>Registration test form
</title>
16 background: -webkit-gradient(linear, left top, left bottom, from(#FAFBFB), to(#CCD1D4));
20 document
.addEventListener('DOMContentLoaded', load
);
21 var hostUrl
= 'chrome://register';
23 window
.addEventListener('message', processMessage
);
26 return document
.getElementById(o
);
31 type
: 'get_user_info',
32 domain
: location
.href
,
35 window
.parent
.postMessage(msg
, hostUrl
);
36 $('url').textContent
= location
.href
;
39 function processMessage(e
) {
40 // TODO(nkostylev): e.origin is passed as null and not checked.
41 // Probably because it's served from chrome:// scheme.
42 if (e
.data
.domain
!= hostUrl
) {
47 if (e
.data
.type
== 'set_user_info') {
48 var info
= e
.data
.payload
;
49 $('info').textContent
= 'OS: ' + info
.os_name
+ ', ' +
50 info
.os_version
+ ' SKU:' + info
.system_sku
+ ', system hwqual: ' +
51 info
.system_hwqual
+ ', SN: ' + info
.system_serial
+ ', lang: ' +
52 info
.os_language
+ ', connection: ' + info
.os_connection
+ ', user: ' +
56 $('messageInfo').textContent
= 'e.origin: ' + e
.origin
+
57 ', e.data.domain: ' + e
.data
.domain
;
60 function registration(result
) {
62 type
: 'complete_registration',
63 domain
: location
.href
,
65 registration_status
: result
68 var parent
= window
.parent
;
69 parent
.postMessage(msg
, hostUrl
);
75 <h3>Register your computer with Google
</h3>
76 <i>This registration form is hosted at
</i><div id=
"url"></div><br>
77 <i>User info received from host page:
</i><br>
78 <div id=
"info"></div><br>
79 <i>Message info:
</i><br>
80 <div id=
"messageInfo"></div><br>
81 <input type=
"button" value=
"Skip" onclick=
"registration(false);">
82 <input type=
"button" value=
"Register" onclick=
"registration(true);">