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

Unified Diff: components/login/base_screen_handler_utils.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 build. 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
« no previous file with comments | « components/login/base_screen_handler_utils.h ('k') | components/signin/core/account_id/account_id.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/login/base_screen_handler_utils.cc
diff --git a/components/login/base_screen_handler_utils.cc b/components/login/base_screen_handler_utils.cc
index 6454cdf87b2a1d70dd8f899ff0c4ef31352852dd..fd977a33eaa943eb2b2170b280ae12f0579f9945 100644
--- a/components/login/base_screen_handler_utils.cc
+++ b/components/login/base_screen_handler_utils.cc
@@ -4,6 +4,8 @@
#include "components/login/base_screen_handler_utils.h"
+#include "components/signin/core/account_id/account_id.h"
+
namespace login {
namespace {
@@ -56,6 +58,20 @@ bool ParseValue(const base::Value* value, String16List* out_value) {
return ParseStringList(value, out_value);
}
+bool ParseValue(const base::Value* value, AccountId* out_value) {
+ std::string serialized;
+ const bool has_string = value->GetAsString(&serialized);
+ if (!has_string)
+ return false;
+
+ if (AccountId::Deserialize(serialized, out_value))
+ return true;
+
+ LOG(ERROR) << "Failed to deserialize '" << serialized << "'";
+ *out_value = AccountId::FromUserEmail(serialized);
+ return true;
+}
+
base::FundamentalValue MakeValue(bool v) {
return base::FundamentalValue(v);
}
@@ -76,4 +92,11 @@ base::StringValue MakeValue(const base::string16& v) {
return base::StringValue(v);
}
+base::StringValue MakeValue(const AccountId& v) {
+ return base::StringValue(v.Serialize());
+}
+
+ParsedValueContainer<AccountId>::ParsedValueContainer() {
+}
+
} // namespace login
« no previous file with comments | « components/login/base_screen_handler_utils.h ('k') | components/signin/core/account_id/account_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698