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/about_flags.h" | 7 #include "chrome/browser/about_flags.h" |
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
9 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 9 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #include "chrome/common/chrome_switches.h" | 65 #include "chrome/common/chrome_switches.h" |
66 #include "chrome/common/pref_names.h" | 66 #include "chrome/common/pref_names.h" |
67 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 67 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
68 #include "components/dom_distiller/core/dom_distiller_service.h" | 68 #include "components/dom_distiller/core/dom_distiller_service.h" |
69 #include "content/public/browser/browser_thread.h" | 69 #include "content/public/browser/browser_thread.h" |
70 #include "sync/api/syncable_service.h" | 70 #include "sync/api/syncable_service.h" |
71 | 71 |
72 #if defined(ENABLE_MANAGED_USERS) | 72 #if defined(ENABLE_MANAGED_USERS) |
73 #include "chrome/browser/managed_mode/managed_user_settings_service.h" | 73 #include "chrome/browser/managed_mode/managed_user_settings_service.h" |
74 #include "chrome/browser/managed_mode/managed_user_settings_service_factory.h" | 74 #include "chrome/browser/managed_mode/managed_user_settings_service_factory.h" |
| 75 #include "chrome/browser/managed_mode/managed_user_shared_settings_service.h" |
| 76 #include "chrome/browser/managed_mode/managed_user_shared_settings_service_facto
ry.h" |
75 #include "chrome/browser/managed_mode/managed_user_sync_service.h" | 77 #include "chrome/browser/managed_mode/managed_user_sync_service.h" |
76 #include "chrome/browser/managed_mode/managed_user_sync_service_factory.h" | 78 #include "chrome/browser/managed_mode/managed_user_sync_service_factory.h" |
77 #endif | 79 #endif |
78 | 80 |
79 #if !defined(OS_ANDROID) | 81 #if !defined(OS_ANDROID) |
80 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" | 82 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" |
81 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac
tory.h" | 83 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac
tory.h" |
82 #endif | 84 #endif |
83 | 85 |
84 #if defined(ENABLE_SPELLCHECK) | 86 #if defined(ENABLE_SPELLCHECK) |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 #if defined(ENABLE_MANAGED_USERS) | 222 #if defined(ENABLE_MANAGED_USERS) |
221 if (profile_->IsManaged()) { | 223 if (profile_->IsManaged()) { |
222 pss->RegisterDataTypeController( | 224 pss->RegisterDataTypeController( |
223 new UIDataTypeController( | 225 new UIDataTypeController( |
224 syncer::MANAGED_USER_SETTINGS, this, profile_, pss)); | 226 syncer::MANAGED_USER_SETTINGS, this, profile_, pss)); |
225 } else { | 227 } else { |
226 pss->RegisterDataTypeController( | 228 pss->RegisterDataTypeController( |
227 new UIDataTypeController( | 229 new UIDataTypeController( |
228 syncer::MANAGED_USERS, this, profile_, pss)); | 230 syncer::MANAGED_USERS, this, profile_, pss)); |
229 } | 231 } |
| 232 pss->RegisterDataTypeController( |
| 233 new UIDataTypeController( |
| 234 syncer::MANAGED_USER_SHARED_SETTINGS, this, profile_, pss)); |
230 #endif | 235 #endif |
231 } | 236 } |
232 | 237 |
233 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( | 238 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( |
234 ProfileSyncService* pss) { | 239 ProfileSyncService* pss) { |
235 // App sync is enabled by default. Register unless explicitly | 240 // App sync is enabled by default. Register unless explicitly |
236 // disabled. | 241 // disabled. |
237 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { | 242 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { |
238 pss->RegisterDataTypeController( | 243 pss->RegisterDataTypeController( |
239 new ExtensionDataTypeController(syncer::APPS, this, profile_, pss)); | 244 new ExtensionDataTypeController(syncer::APPS, this, profile_, pss)); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 return favicons ? favicons->AsWeakPtr() | 432 return favicons ? favicons->AsWeakPtr() |
428 : base::WeakPtr<syncer::SyncableService>(); | 433 : base::WeakPtr<syncer::SyncableService>(); |
429 } | 434 } |
430 #if defined(ENABLE_MANAGED_USERS) | 435 #if defined(ENABLE_MANAGED_USERS) |
431 case syncer::MANAGED_USER_SETTINGS: | 436 case syncer::MANAGED_USER_SETTINGS: |
432 return ManagedUserSettingsServiceFactory::GetForProfile(profile_)-> | 437 return ManagedUserSettingsServiceFactory::GetForProfile(profile_)-> |
433 AsWeakPtr(); | 438 AsWeakPtr(); |
434 case syncer::MANAGED_USERS: | 439 case syncer::MANAGED_USERS: |
435 return ManagedUserSyncServiceFactory::GetForProfile(profile_)-> | 440 return ManagedUserSyncServiceFactory::GetForProfile(profile_)-> |
436 AsWeakPtr(); | 441 AsWeakPtr(); |
| 442 case syncer::MANAGED_USER_SHARED_SETTINGS: |
| 443 return ManagedUserSharedSettingsServiceFactory::GetForBrowserContext( |
| 444 profile_)->AsWeakPtr(); |
437 #endif | 445 #endif |
438 case syncer::ARTICLES: { | 446 case syncer::ARTICLES: { |
439 dom_distiller::DomDistillerService* service = | 447 dom_distiller::DomDistillerService* service = |
440 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( | 448 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( |
441 profile_); | 449 profile_); |
442 if (service) | 450 if (service) |
443 return service->GetSyncableService()->AsWeakPtr(); | 451 return service->GetSyncableService()->AsWeakPtr(); |
444 return base::WeakPtr<syncer::SyncableService>(); | 452 return base::WeakPtr<syncer::SyncableService>(); |
445 } | 453 } |
446 case syncer::SESSIONS: { | 454 case syncer::SESSIONS: { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 ProfileSyncComponentsFactory::SyncComponents | 528 ProfileSyncComponentsFactory::SyncComponents |
521 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 529 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
522 ProfileSyncService* profile_sync_service, | 530 ProfileSyncService* profile_sync_service, |
523 DataTypeErrorHandler* error_handler) { | 531 DataTypeErrorHandler* error_handler) { |
524 SessionModelAssociator* model_associator = | 532 SessionModelAssociator* model_associator = |
525 new SessionModelAssociator(profile_sync_service, error_handler); | 533 new SessionModelAssociator(profile_sync_service, error_handler); |
526 SessionChangeProcessor* change_processor = | 534 SessionChangeProcessor* change_processor = |
527 new SessionChangeProcessor(error_handler, model_associator); | 535 new SessionChangeProcessor(error_handler, model_associator); |
528 return SyncComponents(model_associator, change_processor); | 536 return SyncComponents(model_associator, change_processor); |
529 } | 537 } |
OLD | NEW |