1 // Copyright 2014 Samsung Electronics. 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.
5 #ifndef PERSONAL_DATA_MANAGER_FACTORY_H
6 #define PERSONAL_DATA_MANAGER_FACTORY_H
8 #if defined(TIZEN_AUTOFILL_SUPPORT)
9 #include "base/id_map.h"
10 #include "base/strings/string16.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/singleton.h"
14 #include "components/autofill/core/browser/personal_data_manager_observer.h"
17 template <typename T> struct DefaultSingletonTraits;
26 typedef void (*Ewk_Context_Form_Autofill_Profile_Changed_Callback)(void *data);
28 class PersonalDataManager;
29 class AutofillProfile;
32 class PersonalDataManagerFactory : public PersonalDataManagerObserver {
34 static PersonalDataManagerFactory* GetInstance();
36 void PersonalDataManagerAdd(content::BrowserContext* ctx);
37 void PersonalDataManagerRemove(content::BrowserContext* ctx);
38 PersonalDataManager* PersonalDataManagerForContext(
39 content::BrowserContext* ctx);
41 void SetCallback(Ewk_Context_Form_Autofill_Profile_Changed_Callback callback,
44 // content::BrowserContextObserver:
45 void OnPersonalDataChanged() override;
48 friend struct base::DefaultSingletonTraits<PersonalDataManagerFactory>;
50 PersonalDataManagerFactory();
51 ~PersonalDataManagerFactory();
53 IDMap<PersonalDataManager, IDMapOwnPointer> personal_data_manager_id_map_;
55 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerFactory);
56 Ewk_Context_Form_Autofill_Profile_Changed_Callback callback_;
57 void* callback_user_data_;
60 } // namespace autofill
61 #endif // TIZEN_AUTOFILL_SUPPORT
62 #endif // PERSONAL_DATA_MANAGER_FACTORY_H