| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { | 5 login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| 6 /** @const */ var STEP_SIGNIN = 'signin'; | 6 /** @const */ var STEP_SIGNIN = 'signin'; |
| 7 /** @const */ var STEP_WORKING = 'working'; | 7 /** @const */ var STEP_WORKING = 'working'; |
| 8 /** @const */ var STEP_ATTRIBUTE_PROMPT = 'attribute-prompt'; | 8 /** @const */ var STEP_ATTRIBUTE_PROMPT = 'attribute-prompt'; |
| 9 /** @const */ var STEP_ERROR = 'error'; | 9 /** @const */ var STEP_ERROR = 'error'; |
| 10 /** @const */ var STEP_SUCCESS = 'success'; | 10 /** @const */ var STEP_SUCCESS = 'success'; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 this.doRetry_.bind(this)); | 111 this.doRetry_.bind(this)); |
| 112 function doneCallback() { | 112 function doneCallback() { |
| 113 chrome.send('oauthEnrollClose', ['done']); | 113 chrome.send('oauthEnrollClose', ['done']); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 $('oauth-enroll-attribute-prompt-error-card').addEventListener( | 116 $('oauth-enroll-attribute-prompt-error-card').addEventListener( |
| 117 'buttonclick', doneCallback); | 117 'buttonclick', doneCallback); |
| 118 $('oauth-enroll-success-card').addEventListener( | 118 $('oauth-enroll-success-card').addEventListener( |
| 119 'buttonclick', doneCallback); | 119 'buttonclick', doneCallback); |
| 120 | 120 |
| 121 $('oauth-enroll-cancel-button').addEventListener('mousedown', | |
| 122 function(e) { | |
| 123 e.preventDefault(); | |
| 124 }); | |
| 125 | |
| 126 $('oauth-enroll-cancel-button').addEventListener('click', | 121 $('oauth-enroll-cancel-button').addEventListener('click', |
| 127 this.cancel.bind(this)); | 122 this.cancel.bind(this)); |
| 128 | 123 |
| 129 $('oauth-enroll-back-button').addEventListener('mousedown', function(e) { | |
| 130 e.preventDefault(); | |
| 131 }); | |
| 132 | |
| 133 $('oauth-enroll-back-button').addEventListener('click', | 124 $('oauth-enroll-back-button').addEventListener('click', |
| 134 (function(e) { | 125 (function(e) { |
| 135 $('oauth-enroll-back-button').hidden = true; | 126 $('oauth-enroll-back-button').hidden = true; |
| 136 $('oauth-enroll-auth-view').back(); | 127 $('oauth-enroll-auth-view').back(); |
| 137 e.preventDefault(); | 128 e.preventDefault(); |
| 138 }).bind(this)); | 129 }).bind(this)); |
| 139 | 130 |
| 140 $('oauth-enroll-attribute-prompt-card').addEventListener('submit', | 131 $('oauth-enroll-attribute-prompt-card').addEventListener('submit', |
| 141 this.onAttributesSubmitted.bind(this)); | 132 this.onAttributesSubmitted.bind(this)); |
| 142 | 133 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 * Uploads the device attributes to server. This goes to C++ side through | 282 * Uploads the device attributes to server. This goes to C++ side through |
| 292 * |chrome| and launches the device attribute update negotiation. | 283 * |chrome| and launches the device attribute update negotiation. |
| 293 */ | 284 */ |
| 294 onAttributesSubmitted: function() { | 285 onAttributesSubmitted: function() { |
| 295 chrome.send('oauthEnrollAttributes', | 286 chrome.send('oauthEnrollAttributes', |
| 296 [$('oauth-enroll-asset-id').value, | 287 [$('oauth-enroll-asset-id').value, |
| 297 $('oauth-enroll-location').value]); | 288 $('oauth-enroll-location').value]); |
| 298 } | 289 } |
| 299 }; | 290 }; |
| 300 }); | 291 }); |
| OLD | NEW |