Index: chrome/browser/chromeos/login/authenticator.cc |
diff --git a/chrome/browser/chromeos/login/authenticator.cc b/chrome/browser/chromeos/login/authenticator.cc |
index 07f4560de58475418dc0d6f90123b0454c1f8c8a..0d3eaf4a8bba9b3d7e44d756c7f2b30228e1c97a 100644 |
--- a/chrome/browser/chromeos/login/authenticator.cc |
+++ b/chrome/browser/chromeos/login/authenticator.cc |
@@ -14,6 +14,9 @@ |
namespace chromeos { |
class LoginStatusConsumer; |
+// static |
+const char Authenticator::kSpecialCase[] = "gmail.com"; |
+ |
Authenticator::Authenticator(LoginStatusConsumer* consumer) |
: consumer_(consumer) { |
} |
@@ -26,7 +29,10 @@ std::string Authenticator::Canonicalize(const std::string& email_address) { |
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] == kSpecialCase) // 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. |
whywhat
2010/12/30 17:37:39
TODO or actually remove the code? :)
Chris Masone
2010/12/30 18:52:50
Added a TODO instead of pulling it out, as I want
|
if (parts[0].find('+') != std::string::npos) |
parts[0].erase(parts[0].find('+')); |
std::string new_email = StringToLowerASCII(JoinString(parts, at)); |