OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromeos/cryptohome/homedir_methods.h" | 5 #include "chromeos/cryptohome/homedir_methods.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chromeos/dbus/cryptohome/key.pb.h" | 9 #include "chromeos/dbus/cryptohome/key.pb.h" |
10 #include "chromeos/dbus/cryptohome/rpc.pb.h" | 10 #include "chromeos/dbus/cryptohome/rpc.pb.h" |
11 #include "chromeos/dbus/dbus_thread_manager.h" | 11 #include "chromeos/dbus/dbus_thread_manager.h" |
| 12 #include "google_apis/gaia/gaia_auth_util.h" |
12 | 13 |
13 #if defined(USE_SYSTEM_PROTOBUF) | 14 #if defined(USE_SYSTEM_PROTOBUF) |
14 #include <google/protobuf/repeated_field.h> | 15 #include <google/protobuf/repeated_field.h> |
15 #else | 16 #else |
16 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 17 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
17 #endif | 18 #endif |
18 | 19 |
19 using chromeos::DBusThreadManager; | 20 using chromeos::DBusThreadManager; |
20 using google::protobuf::RepeatedPtrField; | 21 using google::protobuf::RepeatedPtrField; |
21 | 22 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 if (it->number) | 87 if (it->number) |
87 entry->set_number(*it->number); | 88 entry->set_number(*it->number); |
88 if (it->bytes) | 89 if (it->bytes) |
89 entry->set_bytes(*it->bytes); | 90 entry->set_bytes(*it->bytes); |
90 } | 91 } |
91 } | 92 } |
92 | 93 |
93 // Fill identification protobuffer. | 94 // Fill identification protobuffer. |
94 void FillIdentificationProtobuf(const Identification& id, | 95 void FillIdentificationProtobuf(const Identification& id, |
95 cryptohome::AccountIdentifier* id_proto) { | 96 cryptohome::AccountIdentifier* id_proto) { |
96 id_proto->set_email(id.user_id); | 97 id_proto->set_email(gaia::CanonicalizeEmail(id.user_id.GetUserEmail())); |
97 } | 98 } |
98 | 99 |
99 // Fill authorization protobuffer. | 100 // Fill authorization protobuffer. |
100 void FillAuthorizationProtobuf(const Authorization& auth, | 101 void FillAuthorizationProtobuf(const Authorization& auth, |
101 cryptohome::AuthorizationRequest* auth_proto) { | 102 cryptohome::AuthorizationRequest* auth_proto) { |
102 Key* key = auth_proto->mutable_key(); | 103 Key* key = auth_proto->mutable_key(); |
103 if (!auth.label.empty()) { | 104 if (!auth.label.empty()) { |
104 key->mutable_data()->set_label(auth.label); | 105 key->mutable_data()->set_label(auth.label); |
105 } | 106 } |
106 key->set_secret(auth.key); | 107 key->set_secret(auth.key); |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } | 481 } |
481 delete g_homedir_methods; | 482 delete g_homedir_methods; |
482 g_homedir_methods = NULL; | 483 g_homedir_methods = NULL; |
483 VLOG(1) << "HomedirMethods Shutdown completed"; | 484 VLOG(1) << "HomedirMethods Shutdown completed"; |
484 } | 485 } |
485 | 486 |
486 // static | 487 // static |
487 HomedirMethods* HomedirMethods::GetInstance() { return g_homedir_methods; } | 488 HomedirMethods* HomedirMethods::GetInstance() { return g_homedir_methods; } |
488 | 489 |
489 } // namespace cryptohome | 490 } // namespace cryptohome |
OLD | NEW |