OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ |
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "chrome/browser/sync/profile_sync_components_factory.h" | 13 #include "chrome/browser/sync/profile_sync_components_factory.h" |
14 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 14 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 15 #include "google_apis/gaia/oauth2_token_service.h" |
15 | 16 |
16 class Profile; | 17 class Profile; |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class CommandLine; | 20 class CommandLine; |
20 } | 21 } |
21 | 22 |
22 namespace extensions { | 23 namespace extensions { |
23 class ExtensionSystem; | 24 class ExtensionSystem; |
24 } | 25 } |
25 | 26 |
26 class ProfileSyncComponentsFactoryImpl : public ProfileSyncComponentsFactory { | 27 class ProfileSyncComponentsFactoryImpl : public ProfileSyncComponentsFactory { |
27 public: | 28 public: |
28 ProfileSyncComponentsFactoryImpl(Profile* profile, | 29 // Constructs a ProfileSyncComponentsFactoryImpl. |
29 base::CommandLine* command_line); | 30 // |
| 31 // |sync_service_url| is the base URL of the sync server. |
| 32 // |
| 33 // |account_id| is the sync user's account id. |
| 34 // |
| 35 // |scope_set| is the set of scopes to use for sync. |
| 36 // |
| 37 // |token_service| must outlive the ProfileSyncComponentsFactoryImpl. |
| 38 // |
| 39 // |url_request_context_getter| must outlive the |
| 40 // ProfileSyncComponentsFactoryImpl. |
| 41 ProfileSyncComponentsFactoryImpl( |
| 42 Profile* profile, |
| 43 base::CommandLine* command_line, |
| 44 const GURL& sync_service_url, |
| 45 const std::string& account_id, |
| 46 const OAuth2TokenService::ScopeSet& scope_set, |
| 47 OAuth2TokenService* token_service, |
| 48 net::URLRequestContextGetter* url_request_context_getter); |
30 virtual ~ProfileSyncComponentsFactoryImpl(); | 49 virtual ~ProfileSyncComponentsFactoryImpl(); |
31 | 50 |
32 virtual void RegisterDataTypes(ProfileSyncService* pss) OVERRIDE; | 51 virtual void RegisterDataTypes(ProfileSyncService* pss) OVERRIDE; |
33 | 52 |
34 virtual browser_sync::DataTypeManager* CreateDataTypeManager( | 53 virtual browser_sync::DataTypeManager* CreateDataTypeManager( |
35 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& | 54 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
36 debug_info_listener, | 55 debug_info_listener, |
37 const browser_sync::DataTypeController::TypeMap* controllers, | 56 const browser_sync::DataTypeController::TypeMap* controllers, |
38 const browser_sync::DataTypeEncryptionHandler* encryption_handler, | 57 const browser_sync::DataTypeEncryptionHandler* encryption_handler, |
39 browser_sync::SyncBackendHost* backend, | 58 browser_sync::SyncBackendHost* backend, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const std::string& message); | 103 const std::string& message); |
85 | 104 |
86 Profile* profile_; | 105 Profile* profile_; |
87 base::CommandLine* command_line_; | 106 base::CommandLine* command_line_; |
88 // Set on the UI thread (since extensions::ExtensionSystemFactory is | 107 // Set on the UI thread (since extensions::ExtensionSystemFactory is |
89 // non-threadsafe); accessed on both the UI and FILE threads in | 108 // non-threadsafe); accessed on both the UI and FILE threads in |
90 // GetSyncableServiceForType. | 109 // GetSyncableServiceForType. |
91 extensions::ExtensionSystem* extension_system_; | 110 extensions::ExtensionSystem* extension_system_; |
92 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; | 111 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; |
93 | 112 |
| 113 const GURL sync_service_url_; |
| 114 const std::string account_id_; |
| 115 const OAuth2TokenService::ScopeSet scope_set_; |
| 116 OAuth2TokenService* const token_service_; |
| 117 net::URLRequestContextGetter* const url_request_context_getter_; |
| 118 |
94 base::WeakPtrFactory<ProfileSyncComponentsFactoryImpl> weak_factory_; | 119 base::WeakPtrFactory<ProfileSyncComponentsFactoryImpl> weak_factory_; |
95 | 120 |
96 DISALLOW_COPY_AND_ASSIGN(ProfileSyncComponentsFactoryImpl); | 121 DISALLOW_COPY_AND_ASSIGN(ProfileSyncComponentsFactoryImpl); |
97 }; | 122 }; |
98 | 123 |
99 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ | 124 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ |
OLD | NEW |