OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'settings-users-add-user-dialog' is the dialog shown for adding new allowed | 7 * 'settings-users-add-user-dialog' is the dialog shown for adding new allowed |
8 * users to a ChromeOS device. | 8 * users to a ChromeOS device. |
9 */ | 9 */ |
10 (function() { | 10 (function() { |
(...skipping 15 matching lines...) Expand all Loading... |
26 * @const {!RegExp} | 26 * @const {!RegExp} |
27 */ | 27 */ |
28 var EMAIL_REGEX = new RegExp( | 28 var EMAIL_REGEX = new RegExp( |
29 '^\\s*([\\w\\.!#\\$%&\'\\*\\+-\\/=\\?\\^`\\{\\|\\}~]+)@' + | 29 '^\\s*([\\w\\.!#\\$%&\'\\*\\+-\\/=\\?\\^`\\{\\|\\}~]+)@' + |
30 '([A-Za-z0-9\-]{2,63}\\..+)\\s*$'); | 30 '([A-Za-z0-9\-]{2,63}\\..+)\\s*$'); |
31 | 31 |
32 Polymer({ | 32 Polymer({ |
33 is: 'settings-users-add-user-dialog', | 33 is: 'settings-users-add-user-dialog', |
34 | 34 |
35 open: function() { | 35 open: function() { |
36 this.$.dialog.open(); | 36 this.$.dialog.showModal(); |
37 }, | 37 }, |
38 | 38 |
39 /** @private */ | 39 /** @private */ |
40 onCancelTap_: function() { | 40 onCancelTap_: function() { |
41 this.$.dialog.cancel(); | 41 this.$.dialog.cancel(); |
42 }, | 42 }, |
43 | 43 |
44 /** | 44 /** |
45 * Validates that the new user entered is valid. | 45 * Validates that the new user entered is valid. |
46 * @private | 46 * @private |
(...skipping 27 matching lines...) Expand all Loading... |
74 | 74 |
75 chrome.usersPrivate.addWhitelistedUser( | 75 chrome.usersPrivate.addWhitelistedUser( |
76 userEmail, | 76 userEmail, |
77 /* callback */ function(success) {}); | 77 /* callback */ function(success) {}); |
78 this.$.addUserInput.value = ''; | 78 this.$.addUserInput.value = ''; |
79 this.$.dialog.close(); | 79 this.$.dialog.close(); |
80 }, | 80 }, |
81 }); | 81 }); |
82 | 82 |
83 })(); | 83 })(); |
OLD | NEW |