1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Copyright 2014 Samsung Electronics. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
6 #ifndef WEB_DATA_SERVICE_FACTORY_H
7 #define WEB_DATA_SERVICE_FACTORY_H
9 #if defined(TIZEN_AUTOFILL_SUPPORT)
11 #include "base/basictypes.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/singleton.h"
14 #include "components/webdata/common/web_database_service.h"
15 #include "web_data_service.h"
20 class AutofillWebDataService;
21 } // namespace autofill
23 class WebDataServiceWrapper{
25 explicit WebDataServiceWrapper();
27 virtual ~WebDataServiceWrapper();
29 virtual scoped_refptr<autofill::AutofillWebDataService> GetAutofillWebData();
31 virtual scoped_refptr<WebDataService> GetWebData();
33 static WebDataServiceWrapper* GetInstance();
35 scoped_refptr<WebDatabaseService> web_database_;
37 scoped_refptr<autofill::AutofillWebDataService> autofill_web_data_;
38 scoped_refptr<WebDataService> web_data_;
40 DISALLOW_COPY_AND_ASSIGN(WebDataServiceWrapper);
43 // Singleton that owns all WebDataServiceWrappers
44 class WebDataServiceFactory {
47 static WebDataServiceWrapper* GetDataService();
49 static scoped_refptr<autofill::AutofillWebDataService>
50 GetAutofillWebDataForProfile();
52 static WebDataServiceFactory* GetInstance();
55 friend struct base::DefaultSingletonTraits<WebDataServiceFactory>;
57 WebDataServiceFactory();
58 virtual ~WebDataServiceFactory();
60 DISALLOW_COPY_AND_ASSIGN(WebDataServiceFactory);
63 #endif // TIZEN_AUTOFILL_SUPPORT
65 #endif // WEB_DATA_SERVICE_FACTORY_H