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

Unified Diff: chrome/browser/chromeos/login/authenticator.cc

Issue 6091010: Merge 70318 - [Chrome OS] Respect periods in google apps account names... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/597/src/
Patch Set: Created 9 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/authenticator.cc
===================================================================
--- chrome/browser/chromeos/login/authenticator.cc (revision 70397)
+++ chrome/browser/chromeos/login/authenticator.cc (working copy)
@@ -14,6 +14,9 @@
namespace chromeos {
class LoginStatusConsumer;
+// static
+const char Authenticator::kSpecialCaseDomain[] = "gmail.com";
+
Authenticator::Authenticator(LoginStatusConsumer* consumer)
: consumer_(consumer) {
}
@@ -26,7 +29,11 @@
char at = '@';
base::SplitString(email_address, at, &parts);
DCHECK_EQ(parts.size(), 2U) << "email_address should have only one @";
- RemoveChars(parts[0], ".", &parts[0]);
+ if (parts[1] == kSpecialCaseDomain) // only strip '.' for gmail accounts.
+ RemoveChars(parts[0], ".", &parts[0]);
+ // Technically the '+' handling here could be removed, as the google
+ // account servers do not tolerate them, so we don't need to either.
+ // TODO(cmasone): remove this, unless this code becomes obsolete altogether.
if (parts[0].find('+') != std::string::npos)
parts[0].erase(parts[0].find('+'));
std::string new_email = StringToLowerASCII(JoinString(parts, at));
« no previous file with comments | « chrome/browser/chromeos/login/authenticator.h ('k') | chrome/browser/chromeos/login/authenticator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698