Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: chrome/browser/sync/chrome_sync_client.cc

Issue 2468723003: Move session service and supervised users to buildflags. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chrome_sync_client.h" 5 #include "chrome/browser/sync/chrome_sync_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 #include "ui/app_list/app_list_switches.h" 72 #include "ui/app_list/app_list_switches.h"
73 #endif 73 #endif
74 74
75 #if defined(ENABLE_EXTENSIONS) 75 #if defined(ENABLE_EXTENSIONS)
76 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" 76 #include "chrome/browser/extensions/api/storage/settings_sync_util.h"
77 #include "chrome/browser/extensions/extension_sync_service.h" 77 #include "chrome/browser/extensions/extension_sync_service.h"
78 #include "chrome/browser/sync/glue/extension_data_type_controller.h" 78 #include "chrome/browser/sync/glue/extension_data_type_controller.h"
79 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h" 79 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h"
80 #endif 80 #endif
81 81
82 #if defined(ENABLE_SUPERVISED_USERS) 82 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
83 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_ service.h" 83 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_ service.h"
84 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_ service_factory.h" 84 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_ service_factory.h"
85 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" 85 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h"
86 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_fac tory.h" 86 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_fac tory.h"
87 #include "chrome/browser/supervised_user/supervised_user_service.h" 87 #include "chrome/browser/supervised_user/supervised_user_service.h"
88 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" 88 #include "chrome/browser/supervised_user/supervised_user_service_factory.h"
89 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" 89 #include "chrome/browser/supervised_user/supervised_user_settings_service.h"
90 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h" 90 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h"
91 #include "chrome/browser/supervised_user/supervised_user_sync_data_type_controll er.h" 91 #include "chrome/browser/supervised_user/supervised_user_sync_data_type_controll er.h"
92 #include "chrome/browser/supervised_user/supervised_user_whitelist_service.h" 92 #include "chrome/browser/supervised_user/supervised_user_whitelist_service.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 return SpellcheckServiceFactory::GetForContext(profile_)-> 369 return SpellcheckServiceFactory::GetForContext(profile_)->
370 GetCustomDictionary()->AsWeakPtr(); 370 GetCustomDictionary()->AsWeakPtr();
371 #endif 371 #endif
372 case syncer::FAVICON_IMAGES: 372 case syncer::FAVICON_IMAGES:
373 case syncer::FAVICON_TRACKING: { 373 case syncer::FAVICON_TRACKING: {
374 sync_sessions::FaviconCache* favicons = 374 sync_sessions::FaviconCache* favicons =
375 ProfileSyncServiceFactory::GetForProfile(profile_)->GetFaviconCache(); 375 ProfileSyncServiceFactory::GetForProfile(profile_)->GetFaviconCache();
376 return favicons ? favicons->AsWeakPtr() 376 return favicons ? favicons->AsWeakPtr()
377 : base::WeakPtr<syncer::SyncableService>(); 377 : base::WeakPtr<syncer::SyncableService>();
378 } 378 }
379 #if defined(ENABLE_SUPERVISED_USERS) 379 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
380 case syncer::SUPERVISED_USER_SETTINGS: 380 case syncer::SUPERVISED_USER_SETTINGS:
381 return SupervisedUserSettingsServiceFactory::GetForProfile(profile_)-> 381 return SupervisedUserSettingsServiceFactory::GetForProfile(profile_)->
382 AsWeakPtr(); 382 AsWeakPtr();
383 #if !defined(OS_ANDROID) 383 #if !defined(OS_ANDROID)
384 case syncer::SUPERVISED_USERS: 384 case syncer::SUPERVISED_USERS:
385 return SupervisedUserSyncServiceFactory::GetForProfile(profile_)-> 385 return SupervisedUserSyncServiceFactory::GetForProfile(profile_)->
386 AsWeakPtr(); 386 AsWeakPtr();
387 case syncer::SUPERVISED_USER_SHARED_SETTINGS: 387 case syncer::SUPERVISED_USER_SHARED_SETTINGS:
388 return SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext( 388 return SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
389 profile_)->AsWeakPtr(); 389 profile_)->AsWeakPtr();
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 579
580 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS) 580 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS)
581 // Dictionary sync is enabled by default. 581 // Dictionary sync is enabled by default.
582 if (!disabled_types.Has(syncer::DICTIONARY)) { 582 if (!disabled_types.Has(syncer::DICTIONARY)) {
583 sync_service->RegisterDataTypeController( 583 sync_service->RegisterDataTypeController(
584 base::MakeUnique<UIDataTypeController>(syncer::DICTIONARY, 584 base::MakeUnique<UIDataTypeController>(syncer::DICTIONARY,
585 error_callback, this)); 585 error_callback, this));
586 } 586 }
587 #endif 587 #endif
588 588
589 #if defined(ENABLE_SUPERVISED_USERS) 589 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
590 sync_service->RegisterDataTypeController( 590 sync_service->RegisterDataTypeController(
591 base::MakeUnique<SupervisedUserSyncDataTypeController>( 591 base::MakeUnique<SupervisedUserSyncDataTypeController>(
592 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); 592 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_));
593 sync_service->RegisterDataTypeController( 593 sync_service->RegisterDataTypeController(
594 base::MakeUnique<SupervisedUserSyncDataTypeController>( 594 base::MakeUnique<SupervisedUserSyncDataTypeController>(
595 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); 595 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_));
596 sync_service->RegisterDataTypeController( 596 sync_service->RegisterDataTypeController(
597 base::MakeUnique<SupervisedUserSyncDataTypeController>( 597 base::MakeUnique<SupervisedUserSyncDataTypeController>(
598 syncer::SUPERVISED_USERS, error_callback, this, profile_)); 598 syncer::SUPERVISED_USERS, error_callback, this, profile_));
599 sync_service->RegisterDataTypeController( 599 sync_service->RegisterDataTypeController(
(...skipping 16 matching lines...) Expand all
616 syncer::ARC_PACKAGE, error_callback, this, profile_)); 616 syncer::ARC_PACKAGE, error_callback, this, profile_));
617 #endif 617 #endif
618 } 618 }
619 619
620 void ChromeSyncClient::RegisterAndroidDataTypes( 620 void ChromeSyncClient::RegisterAndroidDataTypes(
621 syncer::SyncService* sync_service, 621 syncer::SyncService* sync_service,
622 syncer::ModelTypeSet disabled_types, 622 syncer::ModelTypeSet disabled_types,
623 syncer::ModelTypeSet enabled_types) { 623 syncer::ModelTypeSet enabled_types) {
624 base::Closure error_callback = 624 base::Closure error_callback =
625 base::Bind(&syncer::ReportUnrecoverableError, chrome::GetChannel()); 625 base::Bind(&syncer::ReportUnrecoverableError, chrome::GetChannel());
626 #if defined(ENABLE_SUPERVISED_USERS) 626 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
627 sync_service->RegisterDataTypeController( 627 sync_service->RegisterDataTypeController(
628 base::MakeUnique<SupervisedUserSyncDataTypeController>( 628 base::MakeUnique<SupervisedUserSyncDataTypeController>(
629 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); 629 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_));
630 sync_service->RegisterDataTypeController( 630 sync_service->RegisterDataTypeController(
631 base::MakeUnique<SupervisedUserSyncDataTypeController>( 631 base::MakeUnique<SupervisedUserSyncDataTypeController>(
632 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); 632 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_));
633 #endif 633 #endif
634 } 634 }
635 635
636 } // namespace browser_sync 636 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698