Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / sync / profile_sync_components_factory_impl.h
blob69f56255865a7780858a59fea8e68284ea72411d
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 "components/autofill/core/browser/webdata/autofill_webdata_service.h"
15 class Profile;
17 namespace base {
18 class CommandLine;
21 namespace extensions {
22 class ExtensionSystem;
25 class ProfileSyncComponentsFactoryImpl : public ProfileSyncComponentsFactory {
26 public:
27 ProfileSyncComponentsFactoryImpl(Profile* profile,
28 base::CommandLine* command_line);
29 virtual ~ProfileSyncComponentsFactoryImpl();
31 virtual void RegisterDataTypes(ProfileSyncService* pss) OVERRIDE;
33 virtual browser_sync::DataTypeManager* CreateDataTypeManager(
34 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&
35 debug_info_listener,
36 const browser_sync::DataTypeController::TypeMap* controllers,
37 const browser_sync::DataTypeEncryptionHandler* encryption_handler,
38 browser_sync::SyncBackendHost* backend,
39 browser_sync::DataTypeManagerObserver* observer,
40 browser_sync::FailedDataTypesHandler* failed_data_types_handler)
41 OVERRIDE;
43 virtual browser_sync::SyncBackendHost* CreateSyncBackendHost(
44 const std::string& name,
45 Profile* profile,
46 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs) OVERRIDE;
48 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType(
49 syncer::ModelType type) OVERRIDE;
50 virtual scoped_ptr<syncer::AttachmentStore>
51 CreateCustomAttachmentStoreForType(syncer::ModelType type) OVERRIDE;
53 // Legacy datatypes that need to be converted to the SyncableService API.
54 virtual SyncComponents CreateBookmarkSyncComponents(
55 ProfileSyncService* profile_sync_service,
56 browser_sync::DataTypeErrorHandler* error_handler) OVERRIDE;
57 virtual SyncComponents CreateTypedUrlSyncComponents(
58 ProfileSyncService* profile_sync_service,
59 history::HistoryBackend* history_backend,
60 browser_sync::DataTypeErrorHandler* error_handler) OVERRIDE;
62 private:
63 // Register data types which are enabled on desktop platforms only.
64 void RegisterDesktopDataTypes(syncer::ModelTypeSet disabled_types,
65 ProfileSyncService* pss);
66 // Register data types which are enabled on both desktop and mobile.
67 void RegisterCommonDataTypes(syncer::ModelTypeSet disabled_types,
68 ProfileSyncService* pss);
70 Profile* profile_;
71 base::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<autofill::AutofillWebDataService> web_data_service_;
78 DISALLOW_COPY_AND_ASSIGN(ProfileSyncComponentsFactoryImpl);
81 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__