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" |
11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
12 #include "chrome/browser/defaults.h" | 12 #include "chrome/browser/defaults.h" |
13 #include "chrome/browser/extensions/extension_system_factory.h" | 13 #include "chrome/browser/extensions/extension_system_factory.h" |
14 #include "chrome/browser/history/history_service_factory.h" | 14 #include "chrome/browser/history/history_service_factory.h" |
15 #include "chrome/browser/invalidation/invalidation_service_factory.h" | 15 #include "chrome/browser/invalidation/invalidation_service_factory.h" |
16 #include "chrome/browser/managed_mode/managed_user_signin_manager_wrapper.h" | |
17 #include "chrome/browser/password_manager/password_store_factory.h" | 16 #include "chrome/browser/password_manager/password_store_factory.h" |
18 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
20 #include "chrome/browser/search_engines/template_url_service_factory.h" | 19 #include "chrome/browser/search_engines/template_url_service_factory.h" |
21 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 20 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
22 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 21 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
23 #include "chrome/browser/signin/about_signin_internals_factory.h" | 22 #include "chrome/browser/signin/about_signin_internals_factory.h" |
24 #include "chrome/browser/signin/profile_oauth2_token_service.h" | 23 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
25 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 24 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
26 #include "chrome/browser/signin/signin_manager.h" | 25 #include "chrome/browser/signin/signin_manager.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // TODO(tim): Currently, AUTO/MANUAL settings refer to the *first* time sync | 110 // TODO(tim): Currently, AUTO/MANUAL settings refer to the *first* time sync |
112 // is set up and *not* a browser restart for a manual-start platform (where | 111 // is set up and *not* a browser restart for a manual-start platform (where |
113 // sync has already been set up, and should be able to start without user | 112 // sync has already been set up, and should be able to start without user |
114 // intervention). We can get rid of the browser_default eventually, but | 113 // intervention). We can get rid of the browser_default eventually, but |
115 // need to take care that ProfileSyncService doesn't get tripped up between | 114 // need to take care that ProfileSyncService doesn't get tripped up between |
116 // those two cases. Bug 88109. | 115 // those two cases. Bug 88109. |
117 ProfileSyncService* pss = new ProfileSyncService( | 116 ProfileSyncService* pss = new ProfileSyncService( |
118 new ProfileSyncComponentsFactoryImpl(profile, | 117 new ProfileSyncComponentsFactoryImpl(profile, |
119 CommandLine::ForCurrentProcess()), | 118 CommandLine::ForCurrentProcess()), |
120 profile, | 119 profile, |
121 new ManagedUserSigninManagerWrapper(signin), | 120 signin, |
122 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 121 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
123 behavior); | 122 behavior); |
124 | 123 |
125 pss->factory()->RegisterDataTypes(pss); | 124 pss->factory()->RegisterDataTypes(pss); |
126 pss->Initialize(); | 125 pss->Initialize(); |
127 return pss; | 126 return pss; |
128 } | 127 } |
129 | 128 |
130 // static | 129 // static |
131 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { | 130 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { |
132 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; | 131 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; |
133 } | 132 } |
OLD | NEW |