Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 assert(e); | |
|
Dan Beam
2014/09/12 03:25:19
i'd just remove this. i have no idea why this wou
Vitaly Pavlenko
2014/09/12 19:16:22
Done.
| |
| 111 if (e.keyIdentifier == 'Enter') { | 112 if (e.keyIdentifier == 'Enter') { |
| 112 var user = this.parse(this.value); | 113 var user = this.parse(this.value); |
| 113 if (user) { | 114 if (user) { |
| 114 var event = new Event('add'); | 115 var event = new Event('add'); |
| 115 event.user = user; | 116 event.user = user; |
| 116 this.dispatchEvent(event); | 117 this.dispatchEvent(event); |
| 117 } | 118 } |
| 118 this.select(); | 119 this.select(); |
| 119 // Avoid double-handling so the dialog doesn't close. | 120 // Avoid double-handling so the dialog doesn't close. |
| 120 e.stopPropagation(); | 121 e.stopPropagation(); |
| 121 } | 122 } |
| 122 } | 123 } |
| 123 }; | 124 }; |
| 124 | 125 |
| 125 return { | 126 return { |
| 126 UserNameEdit: UserNameEdit | 127 UserNameEdit: UserNameEdit |
| 127 }; | 128 }; |
| 128 }); | 129 }); |
| 129 | 130 |
| OLD | NEW |