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

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

Issue 2740363002: [Sync] Fix EnableDisableSingleClientTest (Closed)
Patch Set: fix unit_tests Created 3 years, 9 months 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 #if BUILDFLAG(ENABLE_SPELLCHECK) 101 #if BUILDFLAG(ENABLE_SPELLCHECK)
102 #include "chrome/browser/spellchecker/spellcheck_factory.h" 102 #include "chrome/browser/spellchecker/spellcheck_factory.h"
103 #include "chrome/browser/spellchecker/spellcheck_service.h" 103 #include "chrome/browser/spellchecker/spellcheck_service.h"
104 #endif 104 #endif
105 105
106 #if defined(OS_ANDROID) 106 #if defined(OS_ANDROID)
107 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" 107 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h"
108 #endif 108 #endif
109 109
110 #if defined(OS_CHROMEOS) 110 #if defined(OS_CHROMEOS)
111 #include "chrome/browser/chromeos/arc/arc_util.h"
111 #include "chrome/browser/chromeos/printing/printers_manager.h" 112 #include "chrome/browser/chromeos/printing/printers_manager.h"
112 #include "chrome/browser/chromeos/printing/printers_manager_factory.h" 113 #include "chrome/browser/chromeos/printing/printers_manager_factory.h"
113 #include "chrome/browser/chromeos/printing/printers_sync_bridge.h" 114 #include "chrome/browser/chromeos/printing/printers_sync_bridge.h"
114 #include "chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h " 115 #include "chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h "
115 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h" 116 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h"
116 #include "components/sync_wifi/wifi_credential_syncable_service.h" 117 #include "components/sync_wifi/wifi_credential_syncable_service.h"
117 #include "components/sync_wifi/wifi_credential_syncable_service_factory.h" 118 #include "components/sync_wifi/wifi_credential_syncable_service_factory.h"
118 #endif 119 #endif
119 120
120 using content::BrowserThread; 121 using content::BrowserThread;
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 #if defined(OS_CHROMEOS) 673 #if defined(OS_CHROMEOS)
673 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 674 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
674 switches::kEnableWifiCredentialSync) && 675 switches::kEnableWifiCredentialSync) &&
675 !disabled_types.Has(syncer::WIFI_CREDENTIALS)) { 676 !disabled_types.Has(syncer::WIFI_CREDENTIALS)) {
676 sync_service->RegisterDataTypeController( 677 sync_service->RegisterDataTypeController(
677 base::MakeUnique<AsyncDirectoryTypeController>( 678 base::MakeUnique<AsyncDirectoryTypeController>(
678 syncer::WIFI_CREDENTIALS, error_callback, this, syncer::GROUP_UI, 679 syncer::WIFI_CREDENTIALS, error_callback, this, syncer::GROUP_UI,
679 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); 680 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)));
680 } 681 }
681 682
682 // TODO(lgcheng): Add switch for this. 683 if (arc::IsArcAllowedForProfile(profile_)) {
lgcheng 2017/03/14 21:59:28 I am not sure about the test infrastructure. But I
Gang Wu 2017/03/15 07:55:45 Add a switch here not just for fixing test, but al
skym 2017/03/15 15:45:58 I think the piece of information you need to decid
lgcheng 2017/03/15 17:20:58 There are two stage for Enabling Arc. IsArcAllowed
Gang Wu 2017/03/16 18:40:30 If user can enable Arc at runtime, I think it is g
683 sync_service->RegisterDataTypeController( 684 sync_service->RegisterDataTypeController(
684 base::MakeUnique<ArcPackageSyncDataTypeController>( 685 base::MakeUnique<ArcPackageSyncDataTypeController>(
685 syncer::ARC_PACKAGE, error_callback, this, profile_)); 686 syncer::ARC_PACKAGE, error_callback, this, profile_));
687 }
686 #endif 688 #endif
687 } 689 }
688 690
689 void ChromeSyncClient::RegisterAndroidDataTypes( 691 void ChromeSyncClient::RegisterAndroidDataTypes(
690 syncer::SyncService* sync_service, 692 syncer::SyncService* sync_service,
691 syncer::ModelTypeSet disabled_types, 693 syncer::ModelTypeSet disabled_types,
692 syncer::ModelTypeSet enabled_types) { 694 syncer::ModelTypeSet enabled_types) {
693 base::Closure error_callback = 695 base::Closure error_callback =
694 base::Bind(&syncer::ReportUnrecoverableError, chrome::GetChannel()); 696 base::Bind(&syncer::ReportUnrecoverableError, chrome::GetChannel());
695 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) 697 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
696 sync_service->RegisterDataTypeController( 698 sync_service->RegisterDataTypeController(
697 base::MakeUnique<SupervisedUserSyncDataTypeController>( 699 base::MakeUnique<SupervisedUserSyncDataTypeController>(
698 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); 700 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_));
699 sync_service->RegisterDataTypeController( 701 sync_service->RegisterDataTypeController(
700 base::MakeUnique<SupervisedUserSyncDataTypeController>( 702 base::MakeUnique<SupervisedUserSyncDataTypeController>(
701 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); 703 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_));
702 #endif 704 #endif
703 } 705 }
704 706
705 } // namespace browser_sync 707 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698