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 #include "chrome/browser/sync/profile_sync_service_factory.h" | 5 #include "chrome/browser/sync/profile_sync_service_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // TODO(tim): Currently, AUTO/MANUAL settings refer to the *first* time sync | 124 // TODO(tim): Currently, AUTO/MANUAL settings refer to the *first* time sync |
125 // is set up and *not* a browser restart for a manual-start platform (where | 125 // is set up and *not* a browser restart for a manual-start platform (where |
126 // sync has already been set up, and should be able to start without user | 126 // sync has already been set up, and should be able to start without user |
127 // intervention). We can get rid of the browser_default eventually, but | 127 // intervention). We can get rid of the browser_default eventually, but |
128 // need to take care that ProfileSyncService doesn't get tripped up between | 128 // need to take care that ProfileSyncService doesn't get tripped up between |
129 // those two cases. Bug 88109. | 129 // those two cases. Bug 88109. |
130 browser_sync::ProfileSyncServiceStartBehavior behavior = | 130 browser_sync::ProfileSyncServiceStartBehavior behavior = |
131 browser_defaults::kSyncAutoStarts ? browser_sync::AUTO_START | 131 browser_defaults::kSyncAutoStarts ? browser_sync::AUTO_START |
132 : browser_sync::MANUAL_START; | 132 : browser_sync::MANUAL_START; |
133 ProfileSyncService* pss = new ProfileSyncService( | 133 ProfileSyncService* pss = new ProfileSyncService( |
134 new ProfileSyncComponentsFactoryImpl(profile, | 134 scoped_ptr<ProfileSyncComponentsFactory>( |
135 CommandLine::ForCurrentProcess(), | 135 new ProfileSyncComponentsFactoryImpl( |
136 sync_service_url, | 136 profile, |
137 token_service, | 137 CommandLine::ForCurrentProcess(), |
138 url_request_context_getter), | 138 sync_service_url, |
| 139 token_service, |
| 140 url_request_context_getter)), |
139 profile, | 141 profile, |
140 signin_wrapper.Pass(), | 142 signin_wrapper.Pass(), |
141 token_service, | 143 token_service, |
142 behavior); | 144 behavior); |
143 | 145 |
144 pss->factory()->RegisterDataTypes(pss); | 146 pss->factory()->RegisterDataTypes(pss); |
145 pss->Initialize(); | 147 pss->Initialize(); |
146 return pss; | 148 return pss; |
147 } | 149 } |
148 | 150 |
149 // static | 151 // static |
150 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { | 152 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { |
151 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; | 153 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; |
152 } | 154 } |
OLD | NEW |