| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
| 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 10 #include "chrome/browser/history/history_service.h" | 10 #include "chrome/browser/history/history_service.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 ProfileSyncComponentsFactoryImpl::ProfileSyncComponentsFactoryImpl( | 156 ProfileSyncComponentsFactoryImpl::ProfileSyncComponentsFactoryImpl( |
| 157 Profile* profile, | 157 Profile* profile, |
| 158 base::CommandLine* command_line, | 158 base::CommandLine* command_line, |
| 159 const GURL& sync_service_url, | 159 const GURL& sync_service_url, |
| 160 OAuth2TokenService* token_service, | 160 OAuth2TokenService* token_service, |
| 161 net::URLRequestContextGetter* url_request_context_getter) | 161 net::URLRequestContextGetter* url_request_context_getter) |
| 162 : profile_(profile), | 162 : profile_(profile), |
| 163 command_line_(command_line), | 163 command_line_(command_line), |
| 164 web_data_service_(WebDataServiceFactory::GetAutofillWebDataForProfile( | 164 web_data_service_(WebDataServiceFactory::GetAutofillWebDataForProfile( |
| 165 profile_, | 165 profile_, |
| 166 Profile::EXPLICIT_ACCESS)), | 166 ServiceAccessType::EXPLICIT_ACCESS)), |
| 167 sync_service_url_(sync_service_url), | 167 sync_service_url_(sync_service_url), |
| 168 token_service_(token_service), | 168 token_service_(token_service), |
| 169 url_request_context_getter_(url_request_context_getter), | 169 url_request_context_getter_(url_request_context_getter), |
| 170 weak_factory_(this) { | 170 weak_factory_(this) { |
| 171 DCHECK(token_service_); | 171 DCHECK(token_service_); |
| 172 DCHECK(url_request_context_getter_); | 172 DCHECK(url_request_context_getter_); |
| 173 } | 173 } |
| 174 | 174 |
| 175 ProfileSyncComponentsFactoryImpl::~ProfileSyncComponentsFactoryImpl() { | 175 ProfileSyncComponentsFactoryImpl::~ProfileSyncComponentsFactoryImpl() { |
| 176 } | 176 } |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 case syncer::APP_LIST: | 495 case syncer::APP_LIST: |
| 496 return app_list::AppListSyncableServiceFactory::GetForProfile(profile_)-> | 496 return app_list::AppListSyncableServiceFactory::GetForProfile(profile_)-> |
| 497 AsWeakPtr(); | 497 AsWeakPtr(); |
| 498 #endif | 498 #endif |
| 499 #if defined(ENABLE_THEMES) | 499 #if defined(ENABLE_THEMES) |
| 500 case syncer::THEMES: | 500 case syncer::THEMES: |
| 501 return ThemeServiceFactory::GetForProfile(profile_)-> | 501 return ThemeServiceFactory::GetForProfile(profile_)-> |
| 502 GetThemeSyncableService()->AsWeakPtr(); | 502 GetThemeSyncableService()->AsWeakPtr(); |
| 503 #endif | 503 #endif |
| 504 case syncer::HISTORY_DELETE_DIRECTIVES: { | 504 case syncer::HISTORY_DELETE_DIRECTIVES: { |
| 505 HistoryService* history = | 505 HistoryService* history = HistoryServiceFactory::GetForProfile( |
| 506 HistoryServiceFactory::GetForProfile( | 506 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| 507 profile_, Profile::EXPLICIT_ACCESS); | |
| 508 return history ? history->AsWeakPtr() : base::WeakPtr<HistoryService>(); | 507 return history ? history->AsWeakPtr() : base::WeakPtr<HistoryService>(); |
| 509 } | 508 } |
| 510 #if defined(ENABLE_SPELLCHECK) | 509 #if defined(ENABLE_SPELLCHECK) |
| 511 case syncer::DICTIONARY: | 510 case syncer::DICTIONARY: |
| 512 return SpellcheckServiceFactory::GetForContext(profile_)-> | 511 return SpellcheckServiceFactory::GetForContext(profile_)-> |
| 513 GetCustomDictionary()->AsWeakPtr(); | 512 GetCustomDictionary()->AsWeakPtr(); |
| 514 #endif | 513 #endif |
| 515 case syncer::FAVICON_IMAGES: | 514 case syncer::FAVICON_IMAGES: |
| 516 case syncer::FAVICON_TRACKING: { | 515 case syncer::FAVICON_TRACKING: { |
| 517 browser_sync::FaviconCache* favicons = | 516 browser_sync::FaviconCache* favicons = |
| (...skipping 25 matching lines...) Expand all Loading... |
| 543 return service->GetSyncableService()->AsWeakPtr(); | 542 return service->GetSyncableService()->AsWeakPtr(); |
| 544 return base::WeakPtr<syncer::SyncableService>(); | 543 return base::WeakPtr<syncer::SyncableService>(); |
| 545 } | 544 } |
| 546 case syncer::SESSIONS: { | 545 case syncer::SESSIONS: { |
| 547 return ProfileSyncServiceFactory::GetForProfile(profile_)-> | 546 return ProfileSyncServiceFactory::GetForProfile(profile_)-> |
| 548 GetSessionsSyncableService()->AsWeakPtr(); | 547 GetSessionsSyncableService()->AsWeakPtr(); |
| 549 } | 548 } |
| 550 case syncer::PASSWORDS: { | 549 case syncer::PASSWORDS: { |
| 551 #if defined(PASSWORD_MANAGER_ENABLE_SYNC) | 550 #if defined(PASSWORD_MANAGER_ENABLE_SYNC) |
| 552 scoped_refptr<password_manager::PasswordStore> password_store = | 551 scoped_refptr<password_manager::PasswordStore> password_store = |
| 553 PasswordStoreFactory::GetForProfile(profile_, | 552 PasswordStoreFactory::GetForProfile( |
| 554 Profile::EXPLICIT_ACCESS); | 553 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| 555 return password_store.get() ? password_store->GetPasswordSyncableService() | 554 return password_store.get() ? password_store->GetPasswordSyncableService() |
| 556 : base::WeakPtr<syncer::SyncableService>(); | 555 : base::WeakPtr<syncer::SyncableService>(); |
| 557 #else | 556 #else |
| 558 return base::WeakPtr<syncer::SyncableService>(); | 557 return base::WeakPtr<syncer::SyncableService>(); |
| 559 #endif | 558 #endif |
| 560 } | 559 } |
| 561 #if defined(OS_CHROMEOS) | 560 #if defined(OS_CHROMEOS) |
| 562 case syncer::WIFI_CREDENTIALS: | 561 case syncer::WIFI_CREDENTIALS: |
| 563 return wifi_sync::WifiCredentialSyncableServiceFactory:: | 562 return wifi_sync::WifiCredentialSyncableServiceFactory:: |
| 564 GetForBrowserContext(profile_)->AsWeakPtr(); | 563 GetForBrowserContext(profile_)->AsWeakPtr(); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 new TypedUrlModelAssociator(profile_sync_service, | 700 new TypedUrlModelAssociator(profile_sync_service, |
| 702 history_backend, | 701 history_backend, |
| 703 error_handler); | 702 error_handler); |
| 704 TypedUrlChangeProcessor* change_processor = | 703 TypedUrlChangeProcessor* change_processor = |
| 705 new TypedUrlChangeProcessor(profile_, | 704 new TypedUrlChangeProcessor(profile_, |
| 706 model_associator, | 705 model_associator, |
| 707 history_backend, | 706 history_backend, |
| 708 error_handler); | 707 error_handler); |
| 709 return SyncComponents(model_associator, change_processor); | 708 return SyncComponents(model_associator, change_processor); |
| 710 } | 709 } |
| OLD | NEW |