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

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

Issue 2106663004: arc: Initial implemetation of Chrome sync for Arc packages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify target Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_factory_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 #if defined(ENABLE_SPELLCHECK) 95 #if defined(ENABLE_SPELLCHECK)
96 #include "chrome/browser/spellchecker/spellcheck_factory.h" 96 #include "chrome/browser/spellchecker/spellcheck_factory.h"
97 #include "chrome/browser/spellchecker/spellcheck_service.h" 97 #include "chrome/browser/spellchecker/spellcheck_service.h"
98 #endif 98 #endif
99 99
100 #if BUILDFLAG(ANDROID_JAVA_UI) 100 #if BUILDFLAG(ANDROID_JAVA_UI)
101 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" 101 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h"
102 #endif 102 #endif
103 103
104 #if defined(OS_CHROMEOS) 104 #if defined(OS_CHROMEOS)
105 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h"
105 #include "components/wifi_sync/wifi_credential_syncable_service.h" 106 #include "components/wifi_sync/wifi_credential_syncable_service.h"
106 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" 107 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h"
107 #endif 108 #endif
108 109
109 using content::BrowserThread; 110 using content::BrowserThread;
110 #if defined(ENABLE_EXTENSIONS) 111 #if defined(ENABLE_EXTENSIONS)
111 using browser_sync::ExtensionDataTypeController; 112 using browser_sync::ExtensionDataTypeController;
112 using browser_sync::ExtensionSettingDataTypeController; 113 using browser_sync::ExtensionSettingDataTypeController;
113 #endif 114 #endif
114 using browser_sync::SearchEngineDataTypeController; 115 using browser_sync::SearchEngineDataTypeController;
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 } 406 }
406 case syncer::PASSWORDS: { 407 case syncer::PASSWORDS: {
407 return password_store_.get() 408 return password_store_.get()
408 ? password_store_->GetPasswordSyncableService() 409 ? password_store_->GetPasswordSyncableService()
409 : base::WeakPtr<syncer::SyncableService>(); 410 : base::WeakPtr<syncer::SyncableService>();
410 } 411 }
411 #if defined(OS_CHROMEOS) 412 #if defined(OS_CHROMEOS)
412 case syncer::WIFI_CREDENTIALS: 413 case syncer::WIFI_CREDENTIALS:
413 return wifi_sync::WifiCredentialSyncableServiceFactory:: 414 return wifi_sync::WifiCredentialSyncableServiceFactory::
414 GetForBrowserContext(profile_)->AsWeakPtr(); 415 GetForBrowserContext(profile_)->AsWeakPtr();
416 case syncer::ARC_PACKAGE:
417 return arc::ArcPackageSyncableService::Get(profile_)->AsWeakPtr();
415 #endif 418 #endif
416 default: 419 default:
417 // The following datatypes still need to be transitioned to the 420 // The following datatypes still need to be transitioned to the
418 // syncer::SyncableService API: 421 // syncer::SyncableService API:
419 // Bookmarks 422 // Bookmarks
420 NOTREACHED(); 423 NOTREACHED();
421 return base::WeakPtr<syncer::SyncableService>(); 424 return base::WeakPtr<syncer::SyncableService>();
422 } 425 }
423 } 426 }
424 427
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 profile_)); 603 profile_));
601 #endif 604 #endif
602 605
603 #if defined(OS_CHROMEOS) 606 #if defined(OS_CHROMEOS)
604 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 607 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
605 switches::kEnableWifiCredentialSync) && 608 switches::kEnableWifiCredentialSync) &&
606 !disabled_types.Has(syncer::WIFI_CREDENTIALS)) { 609 !disabled_types.Has(syncer::WIFI_CREDENTIALS)) {
607 sync_service->RegisterDataTypeController(new UIDataTypeController( 610 sync_service->RegisterDataTypeController(new UIDataTypeController(
608 ui_thread, error_callback, syncer::WIFI_CREDENTIALS, this)); 611 ui_thread, error_callback, syncer::WIFI_CREDENTIALS, this));
609 } 612 }
613 // TODO (lgcheng@) Add switch for this.
614 sync_service->RegisterDataTypeController(new UIDataTypeController(
615 ui_thread, error_callback, syncer::ARC_PACKAGE, this));
610 #endif 616 #endif
611 } 617 }
612 618
613 void ChromeSyncClient::RegisterAndroidDataTypes( 619 void ChromeSyncClient::RegisterAndroidDataTypes(
614 sync_driver::SyncService* sync_service, 620 sync_driver::SyncService* sync_service,
615 syncer::ModelTypeSet disabled_types, 621 syncer::ModelTypeSet disabled_types,
616 syncer::ModelTypeSet enabled_types) { 622 syncer::ModelTypeSet enabled_types) {
617 base::Closure error_callback = 623 base::Closure error_callback =
618 base::Bind(&ChromeReportUnrecoverableError, chrome::GetChannel()); 624 base::Bind(&ChromeReportUnrecoverableError, chrome::GetChannel());
619 #if defined(ENABLE_SUPERVISED_USERS) 625 #if defined(ENABLE_SUPERVISED_USERS)
620 sync_service->RegisterDataTypeController( 626 sync_service->RegisterDataTypeController(
621 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS, 627 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS,
622 error_callback, this, profile_)); 628 error_callback, this, profile_));
623 sync_service->RegisterDataTypeController( 629 sync_service->RegisterDataTypeController(
624 new SupervisedUserSyncDataTypeController( 630 new SupervisedUserSyncDataTypeController(
625 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); 631 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_));
626 #endif 632 #endif
627 } 633 }
628 634
629 } // namespace browser_sync 635 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698