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

Unified Diff: chrome/browser/ui/webui/options/chromeos/user_image_source.cc

Issue 1440583002: This CL replaces e-mail with AccountId on user selection screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 5 years, 1 month 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/ui/webui/options/chromeos/user_image_source.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/user_image_source.cc b/chrome/browser/ui/webui/options/chromeos/user_image_source.cc
index 46572be08236c9d265a510e8e475c0b36b77b505..a2918c04d9bfb336d990d6f9974d051951f58f4f 100644
--- a/chrome/browser/ui/webui/options/chromeos/user_image_source.cc
+++ b/chrome/browser/ui/webui/options/chromeos/user_image_source.cc
@@ -26,9 +26,18 @@ namespace {
void ParseRequest(const GURL& url,
std::string* email) {
DCHECK(url.is_valid());
- *email = net::UnescapeURLComponent(url.path().substr(1),
- (net::UnescapeRule::URL_SPECIAL_CHARS |
- net::UnescapeRule::SPACES));
+ const std::string user_id = net::UnescapeURLComponent(
stevenjb 2015/11/11 20:39:23 s/user_id/serialized_account_id/
Alexander Alekseev 2015/11/12 06:53:04 Done.
+ url.path().substr(1),
+ (net::UnescapeRule::URL_SPECIAL_CHARS | net::UnescapeRule::SPACES));
+ AccountId account_id(EmptyAccountId());
+ const bool status = AccountId::Deserialize(user_id, &account_id);
+ // TODO(alemate): DCHECK(status) - should happen after options page is
+ // migrated.
+ if (!status) {
+ LOG(WARNING) << "Failed to deserialize '" << user_id << "'";
dzhioev (left Google) 2015/11/12 00:46:24 I believe we shouldn't produce this warning, as lo
Alexander Alekseev 2015/11/12 06:53:04 I don't think we should support other ID formats f
+ account_id = AccountId::FromUserEmail(user_id);
+ }
+ *email = account_id.GetUserEmail();
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698