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

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

Issue 6089004: [Chrome OS] Respect periods in google apps account names (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ws fix Created 10 years 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
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));

Powered by Google App Engine
This is Rietveld 408576698