Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/resources/settings/people_page/users_add_user_dialog.js

Issue 2180823004: Migrate <cr-dialog> from PaperDialogBehavior to native <dialog>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698