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

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

Issue 543493002: Compile chrome://settings, part 2: reduce from 950 to 400 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@F_settings
Patch Set: 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 * IMA (Internationalized Email Address). We take only the following chars 60 * IMA (Internationalized Email Address). We take only the following chars
61 * as valid for an email alias (aka local-part): 61 * as valid for an email alias (aka local-part):
62 * - Letters: a–z, A–Z 62 * - Letters: a–z, A–Z
63 * - Digits: 0-9 63 * - Digits: 0-9
64 * - Characters: ! # $ % & ' * + - / = ? ^ _ ` { | } ~ 64 * - Characters: ! # $ % & ' * + - / = ? ^ _ ` { | } ~
65 * - Dot: . (Note that we did not cover the cases that dot should not 65 * - Dot: . (Note that we did not cover the cases that dot should not
66 * appear as first or last character and should not appear two or 66 * appear as first or last character and should not appear two or
67 * more times in a row.) 67 * more times in a row.)
68 * 68 *
69 * @param {string} str A string to parse. 69 * @param {string} str A string to parse.
70 * @return {{name: string, email: string}} User info parsed from the string. 70 * @return {?{name: string, email: string}} User info parsed from the
Dan Beam 2014/09/06 02:22:36 isn't this the default?
Vitaly Pavlenko 2014/09/06 22:54:07 No. https://gist.github.com/vpavlenko/45226ac2e387
Dan Beam 2014/09/09 02:59:09 the literal notation ({key: type}) is non-nullable
Vitaly Pavlenko 2014/09/09 17:54:51 Acknowledged.
71 * string.
71 */ 72 */
72 parse: function(str) { 73 parse: function(str) {
73 /** @const */ var format1 = new RegExp(format1String); 74 /** @const */ var format1 = new RegExp(format1String);
74 /** @const */ var format2 = new RegExp(format2String); 75 /** @const */ var format2 = new RegExp(format2String);
75 /** @const */ var format3 = new RegExp(format3String); 76 /** @const */ var format3 = new RegExp(format3String);
76 77
77 var matches = format1.exec(str); 78 var matches = format1.exec(str);
78 if (matches) { 79 if (matches) {
79 return { 80 return {
80 name: matches[1], 81 name: matches[1],
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 e.stopPropagation(); 120 e.stopPropagation();
120 } 121 }
121 } 122 }
122 }; 123 };
123 124
124 return { 125 return {
125 UserNameEdit: UserNameEdit 126 UserNameEdit: UserNameEdit
126 }; 127 };
127 }); 128 });
128 129
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698