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

Side by Side Diff: chrome/browser/resources/options/chromeos/accounts_user_name_edit.js

Issue 570503002: Compile chrome://settings, part 6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@H_options_errors_4
Patch Set: fix asserts, rebase Created 6 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.define('options.accounts', function() { 5 cr.define('options.accounts', function() {
6 /** 6 /**
7 * Email alias only, assuming it's a gmail address. 7 * Email alias only, assuming it's a gmail address.
8 * e.g. 'john' 8 * e.g. 'john'
9 * {name: 'john', email: 'john@gmail.com'} 9 * {name: 'john', email: 'john@gmail.com'}
10 * @const 10 * @const
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 email: matches[2] 98 email: matches[2]
99 }; 99 };
100 } 100 }
101 101
102 return null; 102 return null;
103 }, 103 },
104 104
105 /** 105 /**
106 * Handler for key down event. 106 * Handler for key down event.
107 * @private 107 * @private
108 * @param {!Event} e The keydown event object. 108 * @param {Event} e The keydown event object.
109 */ 109 */
110 handleKeyDown_: function(e) { 110 handleKeyDown_: function(e) {
111 if (e.keyIdentifier == 'Enter') { 111 if (e.keyIdentifier == 'Enter') {
112 var user = this.parse(this.value); 112 var user = this.parse(this.value);
113 if (user) { 113 if (user) {
114 var event = new Event('add'); 114 var event = new Event('add');
115 event.user = user; 115 event.user = user;
116 this.dispatchEvent(event); 116 this.dispatchEvent(event);
117 } 117 }
118 this.select(); 118 this.select();
119 // Avoid double-handling so the dialog doesn't close. 119 // Avoid double-handling so the dialog doesn't close.
120 e.stopPropagation(); 120 e.stopPropagation();
121 } 121 }
122 } 122 }
123 }; 123 };
124 124
125 return { 125 return {
126 UserNameEdit: UserNameEdit 126 UserNameEdit: UserNameEdit
127 }; 127 };
128 }); 128 });
129 129
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698