| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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('click', | 121 $('oauth-enroll-cancel-button').addEventListener('click', |
| 122 this.cancel.bind(this)); | 122 this.cancel.bind(this)); |
| 123 $('oauth-enroll-refresh-button').addEventListener('click', |
| 124 this.cancel.bind(this)); |
| 123 | 125 |
| 124 $('oauth-enroll-back-button').addEventListener('click', | 126 $('oauth-enroll-back-button').addEventListener('click', |
| 125 (function(e) { | 127 (function(e) { |
| 126 $('oauth-enroll-back-button').hidden = true; | 128 $('oauth-enroll-back-button').hidden = true; |
| 127 $('oauth-enroll-auth-view').back(); | 129 $('oauth-enroll-auth-view').back(); |
| 128 e.preventDefault(); | 130 e.preventDefault(); |
| 129 }).bind(this)); | 131 }).bind(this)); |
| 130 | 132 |
| 131 $('oauth-enroll-attribute-prompt-card').addEventListener('submit', | 133 $('oauth-enroll-attribute-prompt-card').addEventListener('submit', |
| 132 this.onAttributesSubmitted.bind(this)); | 134 this.onAttributesSubmitted.bind(this)); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 * Uploads the device attributes to server. This goes to C++ side through | 284 * Uploads the device attributes to server. This goes to C++ side through |
| 283 * |chrome| and launches the device attribute update negotiation. | 285 * |chrome| and launches the device attribute update negotiation. |
| 284 */ | 286 */ |
| 285 onAttributesSubmitted: function() { | 287 onAttributesSubmitted: function() { |
| 286 chrome.send('oauthEnrollAttributes', | 288 chrome.send('oauthEnrollAttributes', |
| 287 [$('oauth-enroll-asset-id').value, | 289 [$('oauth-enroll-asset-id').value, |
| 288 $('oauth-enroll-location').value]); | 290 $('oauth-enroll-location').value]); |
| 289 } | 291 } |
| 290 }; | 292 }; |
| 291 }); | 293 }); |
| OLD | NEW |