| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 pss->RegisterDataTypeController( | 244 pss->RegisterDataTypeController( |
| 245 new UIDataTypeController( | 245 new UIDataTypeController( |
| 246 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 246 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 247 base::Bind(&ChromeReportUnrecoverableError), | 247 base::Bind(&ChromeReportUnrecoverableError), |
| 248 syncer::ARTICLES, | 248 syncer::ARTICLES, |
| 249 this, | 249 this, |
| 250 pss)); | 250 pss)); |
| 251 } | 251 } |
| 252 | 252 |
| 253 #if defined(ENABLE_MANAGED_USERS) | 253 #if defined(ENABLE_MANAGED_USERS) |
| 254 if (profile_->IsManaged()) { | 254 if (profile_->IsSupervised()) { |
| 255 pss->RegisterDataTypeController( | 255 pss->RegisterDataTypeController( |
| 256 new UIDataTypeController( | 256 new UIDataTypeController( |
| 257 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 257 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 258 base::Bind(&ChromeReportUnrecoverableError), | 258 base::Bind(&ChromeReportUnrecoverableError), |
| 259 syncer::MANAGED_USER_SETTINGS, | 259 syncer::SUPERVISED_USER_SETTINGS, |
| 260 this, | 260 this, |
| 261 pss)); | 261 pss)); |
| 262 } else { | 262 } else { |
| 263 pss->RegisterDataTypeController( | 263 pss->RegisterDataTypeController( |
| 264 new UIDataTypeController( | 264 new UIDataTypeController( |
| 265 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 265 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 266 base::Bind(&ChromeReportUnrecoverableError), | 266 base::Bind(&ChromeReportUnrecoverableError), |
| 267 syncer::MANAGED_USERS, | 267 syncer::SUPERVISED_USERS, |
| 268 this, | 268 this, |
| 269 pss)); | 269 pss)); |
| 270 } | 270 } |
| 271 pss->RegisterDataTypeController( | 271 pss->RegisterDataTypeController( |
| 272 new UIDataTypeController( | 272 new UIDataTypeController( |
| 273 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 273 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 274 base::Bind(&ChromeReportUnrecoverableError), | 274 base::Bind(&ChromeReportUnrecoverableError), |
| 275 syncer::MANAGED_USER_SHARED_SETTINGS, | 275 syncer::SUPERVISED_USER_SHARED_SETTINGS, |
| 276 this, | 276 this, |
| 277 pss)); | 277 pss)); |
| 278 #endif | 278 #endif |
| 279 } | 279 } |
| 280 | 280 |
| 281 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( | 281 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( |
| 282 syncer::ModelTypeSet disabled_types, | 282 syncer::ModelTypeSet disabled_types, |
| 283 ProfileSyncService* pss) { | 283 ProfileSyncService* pss) { |
| 284 // App sync is enabled by default. Register unless explicitly | 284 // App sync is enabled by default. Register unless explicitly |
| 285 // disabled. | 285 // disabled. |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 #endif | 505 #endif |
| 506 case syncer::FAVICON_IMAGES: | 506 case syncer::FAVICON_IMAGES: |
| 507 case syncer::FAVICON_TRACKING: { | 507 case syncer::FAVICON_TRACKING: { |
| 508 browser_sync::FaviconCache* favicons = | 508 browser_sync::FaviconCache* favicons = |
| 509 ProfileSyncServiceFactory::GetForProfile(profile_)-> | 509 ProfileSyncServiceFactory::GetForProfile(profile_)-> |
| 510 GetFaviconCache(); | 510 GetFaviconCache(); |
| 511 return favicons ? favicons->AsWeakPtr() | 511 return favicons ? favicons->AsWeakPtr() |
| 512 : base::WeakPtr<syncer::SyncableService>(); | 512 : base::WeakPtr<syncer::SyncableService>(); |
| 513 } | 513 } |
| 514 #if defined(ENABLE_MANAGED_USERS) | 514 #if defined(ENABLE_MANAGED_USERS) |
| 515 case syncer::MANAGED_USER_SETTINGS: | 515 case syncer::SUPERVISED_USER_SETTINGS: |
| 516 return ManagedUserSettingsServiceFactory::GetForProfile(profile_)-> | 516 return ManagedUserSettingsServiceFactory::GetForProfile(profile_)-> |
| 517 AsWeakPtr(); | 517 AsWeakPtr(); |
| 518 case syncer::MANAGED_USERS: | 518 case syncer::SUPERVISED_USERS: |
| 519 return ManagedUserSyncServiceFactory::GetForProfile(profile_)-> | 519 return ManagedUserSyncServiceFactory::GetForProfile(profile_)-> |
| 520 AsWeakPtr(); | 520 AsWeakPtr(); |
| 521 case syncer::MANAGED_USER_SHARED_SETTINGS: | 521 case syncer::SUPERVISED_USER_SHARED_SETTINGS: |
| 522 return ManagedUserSharedSettingsServiceFactory::GetForBrowserContext( | 522 return ManagedUserSharedSettingsServiceFactory::GetForBrowserContext( |
| 523 profile_)->AsWeakPtr(); | 523 profile_)->AsWeakPtr(); |
| 524 #endif | 524 #endif |
| 525 case syncer::ARTICLES: { | 525 case syncer::ARTICLES: { |
| 526 dom_distiller::DomDistillerService* service = | 526 dom_distiller::DomDistillerService* service = |
| 527 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( | 527 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( |
| 528 profile_); | 528 profile_); |
| 529 if (service) | 529 if (service) |
| 530 return service->GetSyncableService()->AsWeakPtr(); | 530 return service->GetSyncableService()->AsWeakPtr(); |
| 531 return base::WeakPtr<syncer::SyncableService>(); | 531 return base::WeakPtr<syncer::SyncableService>(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 new TypedUrlModelAssociator(profile_sync_service, | 614 new TypedUrlModelAssociator(profile_sync_service, |
| 615 history_backend, | 615 history_backend, |
| 616 error_handler); | 616 error_handler); |
| 617 TypedUrlChangeProcessor* change_processor = | 617 TypedUrlChangeProcessor* change_processor = |
| 618 new TypedUrlChangeProcessor(profile_, | 618 new TypedUrlChangeProcessor(profile_, |
| 619 model_associator, | 619 model_associator, |
| 620 history_backend, | 620 history_backend, |
| 621 error_handler); | 621 error_handler); |
| 622 return SyncComponents(model_associator, change_processor); | 622 return SyncComponents(model_associator, change_processor); |
| 623 } | 623 } |
| OLD | NEW |