Index: components/autofill/core/browser/webdata/autofill_table_encryptor_factory.cc |
diff --git a/components/autofill/core/browser/webdata/autofill_table_encryptor_factory.cc b/components/autofill/core/browser/webdata/autofill_table_encryptor_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..293e896dad2c86467ea6168f74b4b247d20b8760 |
--- /dev/null |
+++ b/components/autofill/core/browser/webdata/autofill_table_encryptor_factory.cc |
@@ -0,0 +1,32 @@ |
+// Copyright (c) 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/autofill/core/browser/webdata/autofill_table_encryptor_factory.h" |
+#include "components/autofill/core/browser/webdata/system_encryptor.h" |
+ |
+namespace autofill { |
+ |
+AutofillTableEncryptorFactory::AutofillTableEncryptorFactory() {} |
+ |
+AutofillTableEncryptorFactory* AutofillTableEncryptorFactory::GetInstance() { |
+ return base::Singleton<AutofillTableEncryptorFactory>::get(); |
+} |
+ |
+std::unique_ptr<AutofillTableEncryptor> |
+AutofillTableEncryptorFactory::Create() { |
+ if (delegate_) { |
Roger McFarlane (Chromium)
2017/02/17 21:04:08
nit: no need for braces on single line if with no
|
+ return std::move(delegate_->Create()); |
Roger McFarlane (Chromium)
2017/02/17 21:04:08
nit: no need for std::move on return values
devarajn
2017/02/17 22:28:54
Done.
|
+ } |
+ |
+ std::unique_ptr<AutofillTableEncryptor> encryptor(new SystemEncryptor()); |
+ return std::move(encryptor); |
Roger McFarlane (Chromium)
2017/02/17 21:04:08
#inlcude "base/memory/ptr_util.h"
return base::Mak
devarajn
2017/02/17 22:28:54
Done.
|
+} |
+ |
+void AutofillTableEncryptorFactory::SetDelegate( |
+ std::unique_ptr<autofill::AutofillTableEncryptorFactory::Delegate> |
Roger McFarlane (Chromium)
2017/02/17 21:04:08
nit: no need for autofill::
nit: no need for Autof
devarajn
2017/02/17 22:28:54
Done.
|
+ delegate) { |
+ delegate_ = std::move(delegate); |
+} |
+ |
+} // namespace autofill |