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

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

Issue 2205843004: [Merge to M53] arc: Initial implemetation of Chrome sync for Arc packages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 profile_)); 605 profile_));
603 #endif 606 #endif
604 607
605 #if defined(OS_CHROMEOS) 608 #if defined(OS_CHROMEOS)
606 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 609 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
607 switches::kEnableWifiCredentialSync) && 610 switches::kEnableWifiCredentialSync) &&
608 !disabled_types.Has(syncer::WIFI_CREDENTIALS)) { 611 !disabled_types.Has(syncer::WIFI_CREDENTIALS)) {
609 sync_service->RegisterDataTypeController(new UIDataTypeController( 612 sync_service->RegisterDataTypeController(new UIDataTypeController(
610 ui_thread, error_callback, syncer::WIFI_CREDENTIALS, this)); 613 ui_thread, error_callback, syncer::WIFI_CREDENTIALS, this));
611 } 614 }
615 // TODO (lgcheng@) Add switch for this.
616 sync_service->RegisterDataTypeController(new UIDataTypeController(
617 ui_thread, error_callback, syncer::ARC_PACKAGE, this));
612 #endif 618 #endif
613 } 619 }
614 620
615 void ChromeSyncClient::RegisterAndroidDataTypes( 621 void ChromeSyncClient::RegisterAndroidDataTypes(
616 sync_driver::SyncService* sync_service, 622 sync_driver::SyncService* sync_service,
617 syncer::ModelTypeSet disabled_types, 623 syncer::ModelTypeSet disabled_types,
618 syncer::ModelTypeSet enabled_types) { 624 syncer::ModelTypeSet enabled_types) {
619 base::Closure error_callback = 625 base::Closure error_callback =
620 base::Bind(&ChromeReportUnrecoverableError, chrome::GetChannel()); 626 base::Bind(&ChromeReportUnrecoverableError, chrome::GetChannel());
621 #if defined(ENABLE_SUPERVISED_USERS) 627 #if defined(ENABLE_SUPERVISED_USERS)
622 sync_service->RegisterDataTypeController( 628 sync_service->RegisterDataTypeController(
623 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS, 629 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS,
624 error_callback, this, profile_)); 630 error_callback, this, profile_));
625 sync_service->RegisterDataTypeController( 631 sync_service->RegisterDataTypeController(
626 new SupervisedUserSyncDataTypeController( 632 new SupervisedUserSyncDataTypeController(
627 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); 633 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_));
628 #endif 634 #endif
629 } 635 }
630 636
631 } // namespace browser_sync 637 } // 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