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

Side by Side Diff: components/autofill/core/browser/webdata/autofill_table_encryptor_factory.h

Issue 2698103002: Allow embedder to use custom cryptography in Autofill table. (Closed)
Patch Set: Changed the ifdef name space Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_ENCRYPTOR_FACTOR Y_H_
5 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_ENCRYPTOR_FACTOR Y_H_
6
7 #include <memory>
8
9 #include "base/sequence_checker.h"
10
11 namespace base {
12 template <typename T>
13 struct DefaultSingletonTraits;
14 } // namespace base
15
16 namespace autofill {
17
18 class AutofillTableEncryptor;
19
20 // Factory for creating Autofill table encryptor.
21 // If |delegate_| is set, then |delegate_| is used to create encryptor,
22 // else default encrytor (SystemEncryptor) is returned.
23 class AutofillTableEncryptorFactory {
24 public:
25 // Embedders are recommended to use this delegate to inject
26 // their encryptor into Autofill table.
27 class Delegate {
28 public:
29 virtual ~Delegate() = default;
30
31 virtual std::unique_ptr<AutofillTableEncryptor> Create() = 0;
32 };
33
34 static AutofillTableEncryptorFactory* GetInstance();
35
36 std::unique_ptr<AutofillTableEncryptor> Create();
37
38 void SetDelegate(std::unique_ptr<Delegate> delegate);
39
40 private:
41 AutofillTableEncryptorFactory();
42 ~AutofillTableEncryptorFactory();
43
44 std::unique_ptr<Delegate> delegate_;
45 base::SequenceChecker sequence_checker_;
46
47 friend struct base::DefaultSingletonTraits<AutofillTableEncryptorFactory>;
48 DISALLOW_COPY_AND_ASSIGN(AutofillTableEncryptorFactory);
49 };
50
51 } // namespace autofill
52
53 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_ENCRYPTOR_FAC TORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698