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

Side by Side Diff: chrome/browser/password_manager/login_database_win.cc

Issue 12902030: Make Encryptor a component. Used by //chrome and (soon) //components/webdata. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove duplicate include. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/webdata/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 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/encryptor_win.cc ('k') | chrome/browser/signin/signin_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698