| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // told to DestroyProfileServices, so they will be around when the | 73 // told to DestroyProfileServices, so they will be around when the |
| 74 // ProfileSyncService is destroyed. | 74 // ProfileSyncService is destroyed. |
| 75 | 75 |
| 76 // DependsOn(FaviconServiceFactory::GetInstance()); | 76 // DependsOn(FaviconServiceFactory::GetInstance()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 ProfileSyncServiceFactory::~ProfileSyncServiceFactory() { | 79 ProfileSyncServiceFactory::~ProfileSyncServiceFactory() { |
| 80 } | 80 } |
| 81 | 81 |
| 82 ProfileKeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( | 82 ProfileKeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( |
| 83 Profile* profile) const { | 83 content::BrowserContext* context) const { |
| 84 Profile* profile = static_cast<Profile*>(context); |
| 85 |
| 84 ProfileSyncService::StartBehavior behavior = | 86 ProfileSyncService::StartBehavior behavior = |
| 85 browser_defaults::kSyncAutoStarts ? ProfileSyncService::AUTO_START | 87 browser_defaults::kSyncAutoStarts ? ProfileSyncService::AUTO_START |
| 86 : ProfileSyncService::MANUAL_START; | 88 : ProfileSyncService::MANUAL_START; |
| 87 | 89 |
| 88 SigninManager* signin = SigninManagerFactory::GetForProfile(profile); | 90 SigninManager* signin = SigninManagerFactory::GetForProfile(profile); |
| 89 | 91 |
| 90 // TODO(atwilson): Change AboutSigninInternalsFactory to load on startup | 92 // TODO(atwilson): Change AboutSigninInternalsFactory to load on startup |
| 91 // once http://crbug.com/171406 has been fixed. | 93 // once http://crbug.com/171406 has been fixed. |
| 92 AboutSigninInternalsFactory::GetForProfile(profile); | 94 AboutSigninInternalsFactory::GetForProfile(profile); |
| 93 | 95 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 106 | 108 |
| 107 pss->factory()->RegisterDataTypes(pss); | 109 pss->factory()->RegisterDataTypes(pss); |
| 108 pss->Initialize(); | 110 pss->Initialize(); |
| 109 return pss; | 111 return pss; |
| 110 } | 112 } |
| 111 | 113 |
| 112 // static | 114 // static |
| 113 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { | 115 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { |
| 114 return GetInstance()->GetServiceForProfile(profile, false) != NULL; | 116 return GetInstance()->GetServiceForProfile(profile, false) != NULL; |
| 115 } | 117 } |
| OLD | NEW |