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 | 131 |
141 /** | 132 /** |
142 * Header text of the screen. | 133 * Header text of the screen. |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 * Retries the enrollment process after an error occurred in a previous | 270 * Retries the enrollment process after an error occurred in a previous |
280 * attempt. This goes to the C++ side through |chrome| first to clean up the | 271 * attempt. This goes to the C++ side through |chrome| first to clean up the |
281 * profile, so that the next attempt is performed with a clean state. | 272 * profile, so that the next attempt is performed with a clean state. |
282 */ | 273 */ |
283 doRetry_: function() { | 274 doRetry_: function() { |
284 chrome.send('oauthEnrollRetry'); | 275 chrome.send('oauthEnrollRetry'); |
285 } | 276 } |
286 }; | 277 }; |
287 }); | 278 }); |
288 | 279 |
OLD | NEW |