| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "chrome/browser/password_manager/encryptor.h" | |
| 7 #include "chrome/browser/password_manager/login_database.h" | 6 #include "chrome/browser/password_manager/login_database.h" |
| 7 #include "components/encryptor/encryptor.h" |
| 8 | 8 |
| 9 std::string LoginDatabase::EncryptedString(const string16& plain_text) | 9 std::string LoginDatabase::EncryptedString(const string16& plain_text) |
| 10 const { | 10 const { |
| 11 std::string cipher_text; | 11 std::string cipher_text; |
| 12 if (!Encryptor::EncryptString16(plain_text, &cipher_text)) | 12 if (!Encryptor::EncryptString16(plain_text, &cipher_text)) |
| 13 NOTREACHED() << "Failed to encrypt string"; | 13 NOTREACHED() << "Failed to encrypt string"; |
| 14 return cipher_text; | 14 return cipher_text; |
| 15 } | 15 } |
| 16 | 16 |
| 17 string16 LoginDatabase::DecryptedString(const std::string& cipher_text) | 17 string16 LoginDatabase::DecryptedString(const std::string& cipher_text) |
| 18 const { | 18 const { |
| 19 string16 plain_text; | 19 string16 plain_text; |
| 20 if (!Encryptor::DecryptString16(cipher_text, &plain_text)) | 20 if (!Encryptor::DecryptString16(cipher_text, &plain_text)) |
| 21 NOTREACHED() << "Failed to decrypt string"; | 21 NOTREACHED() << "Failed to decrypt string"; |
| 22 return plain_text; | 22 return plain_text; |
| 23 } | 23 } |
| OLD | NEW |