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

Unified Diff: chromeos/cryptohome/homedir_methods.cc

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing files. Created 4 years, 10 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: chromeos/cryptohome/homedir_methods.cc
diff --git a/chromeos/cryptohome/homedir_methods.cc b/chromeos/cryptohome/homedir_methods.cc
index 8413c72f239dbdc35a33339c00e342cbd733b279..3e3defb486da8be8f36c6b859b731b55a9c42523 100644
--- a/chromeos/cryptohome/homedir_methods.cc
+++ b/chromeos/cryptohome/homedir_methods.cc
@@ -98,7 +98,7 @@ void FillKeyProtobuf(const KeyDefinition& key_def, Key* key) {
// Fill identification protobuffer.
void FillIdentificationProtobuf(const Identification& id,
cryptohome::AccountIdentifier* id_proto) {
- id_proto->set_email(id.user_id);
+ id_proto->set_account_id(id.id());
}
// Fill authorization protobuffer.
@@ -306,12 +306,24 @@ class HomedirMethodsImpl : public HomedirMethods {
pb_update_key.set_authorization_signature(signature);
DBusThreadManager::Get()->GetCryptohomeClient()->UpdateKeyEx(
- id_proto,
- auth_proto,
- pb_update_key,
+ id_proto, auth_proto, pb_update_key,
base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback,
- weak_ptr_factory_.GetWeakPtr(),
- callback));
+ weak_ptr_factory_.GetWeakPtr(), callback));
+ }
+
+ void RenameCryptohome(const Identification& id_from,
+ const Identification& id_to,
+ const Callback& callback) override {
+ cryptohome::AccountIdentifier id_from_proto;
+ cryptohome::AccountIdentifier id_to_proto;
+
+ FillIdentificationProtobuf(id_from, &id_from_proto);
+ FillIdentificationProtobuf(id_to, &id_to_proto);
+
+ DBusThreadManager::Get()->GetCryptohomeClient()->RenameCryptohome(
+ id_from_proto, id_to_proto,
+ base::Bind(&HomedirMethodsImpl::OnBaseReplyCallback,
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
private:

Powered by Google App Engine
This is Rietveld 408576698