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