Revert 168224 - Update V8 to version 3.15.4.
[chromium-blink-merge.git] / chrome / browser / sync / profile_sync_components_factory_impl.h
blob52ec39079a817fb131035000efd7284a9271bcfe
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "chrome/browser/sync/profile_sync_components_factory.h"
13 #include "chrome/browser/webdata/web_data_service.h"
15 class CommandLine;
16 class Profile;
18 namespace extensions {
19 class ExtensionSystem;
22 class ProfileSyncComponentsFactoryImpl : public ProfileSyncComponentsFactory {
23 public:
24 ProfileSyncComponentsFactoryImpl(Profile* profile,
25 CommandLine* command_line);
26 virtual ~ProfileSyncComponentsFactoryImpl();
28 virtual void RegisterDataTypes(ProfileSyncService* pss) OVERRIDE;
30 virtual browser_sync::DataTypeManager* CreateDataTypeManager(
31 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&
32 debug_info_listener,
33 browser_sync::SyncBackendHost* backend,
34 const browser_sync::DataTypeController::TypeMap* controllers,
35 browser_sync::DataTypeManagerObserver* observer) OVERRIDE;
37 virtual browser_sync::GenericChangeProcessor* CreateGenericChangeProcessor(
38 ProfileSyncService* profile_sync_service,
39 browser_sync::DataTypeErrorHandler* error_handler,
40 const base::WeakPtr<syncer::SyncableService>& local_service) OVERRIDE;
42 virtual browser_sync::SharedChangeProcessor*
43 CreateSharedChangeProcessor() OVERRIDE;
45 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType(
46 syncer::ModelType type) OVERRIDE;
48 // Legacy datatypes that need to be converted to the SyncableService API.
49 virtual SyncComponents CreateBookmarkSyncComponents(
50 ProfileSyncService* profile_sync_service,
51 browser_sync::DataTypeErrorHandler* error_handler) OVERRIDE;
52 virtual SyncComponents CreatePasswordSyncComponents(
53 ProfileSyncService* profile_sync_service,
54 PasswordStore* password_store,
55 browser_sync::DataTypeErrorHandler* error_handler) OVERRIDE;
56 virtual SyncComponents CreateTypedUrlSyncComponents(
57 ProfileSyncService* profile_sync_service,
58 history::HistoryBackend* history_backend,
59 browser_sync::DataTypeErrorHandler* error_handler) OVERRIDE;
60 virtual SyncComponents CreateSessionSyncComponents(
61 ProfileSyncService* profile_sync_service,
62 browser_sync::DataTypeErrorHandler* error_handler) OVERRIDE;
64 private:
65 // Register data types which are enabled on desktop platforms only.
66 void RegisterDesktopDataTypes(ProfileSyncService* pss);
67 // Register data types which are enabled on both desktop and mobile.
68 void RegisterCommonDataTypes(ProfileSyncService* pss);
70 Profile* profile_;
71 CommandLine* command_line_;
72 // Set on the UI thread (since extensions::ExtensionSystemFactory is
73 // non-threadsafe); accessed on both the UI and FILE threads in
74 // GetSyncableServiceForType.
75 extensions::ExtensionSystem* extension_system_;
76 scoped_refptr<WebDataService> web_data_service_;
78 DISALLOW_COPY_AND_ASSIGN(ProfileSyncComponentsFactoryImpl);
81 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__