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

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

Issue 10443125: Allow re-enrollment to the same domain in case of policy data loss. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved the domain extraction to Authenticator and added custom error message. Created 8 years, 6 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
diff --git a/chrome/browser/chromeos/login/authenticator.cc b/chrome/browser/chromeos/login/authenticator.cc
index 57426b3faed34ad9ab02e41c3e23d33c0ec5cd04..2158c6584acb5a1d3d868037c94a21c84a89f8d8 100644
--- a/chrome/browser/chromeos/login/authenticator.cc
+++ b/chrome/browser/chromeos/login/authenticator.cc
@@ -52,4 +52,16 @@ std::string Authenticator::Sanitize(const std::string& email_address) {
return sanitized;
}
+// static
+std::string Authenticator::ExtractDomainName(const std::string& email_address) {
+ // First canonicalize which will also verify we have proper domain part.
+ std::string email = Canonicalize(email_address);
+ size_t separator_pos = email.find('@');
+ if (separator_pos != email.npos && separator_pos < email.length() - 1)
+ return email.substr(separator_pos + 1);
+ else
+ NOTREACHED() << "Not a proper email address: " << email;
+ return std::string();
+}
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698