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

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

Issue 709683004: components: add wifi_sync component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-1-security-class
Patch Set: test integration with chromeos network settings backend Created 6 years 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 (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/bookmarks/bookmark_model_factory.h" 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" 8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
10 #include "chrome/browser/history/history_service.h" 10 #include "chrome/browser/history/history_service.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "components/password_manager/core/browser/password_store.h" 52 #include "components/password_manager/core/browser/password_store.h"
53 #include "components/search_engines/template_url_service.h" 53 #include "components/search_engines/template_url_service.h"
54 #include "components/signin/core/browser/signin_manager.h" 54 #include "components/signin/core/browser/signin_manager.h"
55 #include "components/sync_driver/data_type_manager_impl.h" 55 #include "components/sync_driver/data_type_manager_impl.h"
56 #include "components/sync_driver/data_type_manager_observer.h" 56 #include "components/sync_driver/data_type_manager_observer.h"
57 #include "components/sync_driver/device_info_data_type_controller.h" 57 #include "components/sync_driver/device_info_data_type_controller.h"
58 #include "components/sync_driver/generic_change_processor.h" 58 #include "components/sync_driver/generic_change_processor.h"
59 #include "components/sync_driver/proxy_data_type_controller.h" 59 #include "components/sync_driver/proxy_data_type_controller.h"
60 #include "components/sync_driver/shared_change_processor.h" 60 #include "components/sync_driver/shared_change_processor.h"
61 #include "components/sync_driver/ui_data_type_controller.h" 61 #include "components/sync_driver/ui_data_type_controller.h"
62 #include "components/wifi_sync/wifi_credential_syncable_service.h"
63 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h"
62 #include "content/public/browser/browser_thread.h" 64 #include "content/public/browser/browser_thread.h"
63 #include "google_apis/gaia/oauth2_token_service_request.h" 65 #include "google_apis/gaia/oauth2_token_service_request.h"
64 #include "net/url_request/url_request_context_getter.h" 66 #include "net/url_request/url_request_context_getter.h"
65 #include "sync/api/syncable_service.h" 67 #include "sync/api/syncable_service.h"
66 #include "sync/internal_api/public/attachments/attachment_downloader.h" 68 #include "sync/internal_api/public/attachments/attachment_downloader.h"
67 #include "sync/internal_api/public/attachments/attachment_service.h" 69 #include "sync/internal_api/public/attachments/attachment_service.h"
68 #include "sync/internal_api/public/attachments/attachment_service_impl.h" 70 #include "sync/internal_api/public/attachments/attachment_service_impl.h"
69 #include "sync/internal_api/public/attachments/attachment_uploader_impl.h" 71 #include "sync/internal_api/public/attachments/attachment_uploader_impl.h"
70 72
71 #if defined(ENABLE_APP_LIST) 73 #if defined(ENABLE_APP_LIST)
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 new SupervisedUserSyncDataTypeController( 412 new SupervisedUserSyncDataTypeController(
411 syncer::SUPERVISED_USERS, 413 syncer::SUPERVISED_USERS,
412 this, 414 this,
413 profile_)); 415 profile_));
414 pss->RegisterDataTypeController( 416 pss->RegisterDataTypeController(
415 new SupervisedUserSyncDataTypeController( 417 new SupervisedUserSyncDataTypeController(
416 syncer::SUPERVISED_USER_SHARED_SETTINGS, 418 syncer::SUPERVISED_USER_SHARED_SETTINGS,
417 this, 419 this,
418 profile_)); 420 profile_));
419 #endif 421 #endif
422
423 #if defined(OS_CHROMEOS)
mukesh agrawal 2014/12/03 01:44:43 This change is to prevent UI for WiFi sync from ap
424 if (command_line_->HasSwitch(switches::kEnableWifiCredentialSync) &&
425 !disabled_types.Has(syncer::WIFI_CREDENTIALS)) {
426 pss->RegisterDataTypeController(
427 new UIDataTypeController(
428 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
429 base::Bind(&ChromeReportUnrecoverableError),
430 syncer::WIFI_CREDENTIALS,
431 this));
432 }
433 #endif
420 } 434 }
421 435
422 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( 436 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager(
423 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& 437 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&
424 debug_info_listener, 438 debug_info_listener,
425 const DataTypeController::TypeMap* controllers, 439 const DataTypeController::TypeMap* controllers,
426 const sync_driver::DataTypeEncryptionHandler* encryption_handler, 440 const sync_driver::DataTypeEncryptionHandler* encryption_handler,
427 SyncBackendHost* backend, 441 SyncBackendHost* backend,
428 DataTypeManagerObserver* observer) { 442 DataTypeManagerObserver* observer) {
429 return new DataTypeManagerImpl(base::Bind(ChromeReportUnrecoverableError), 443 return new DataTypeManagerImpl(base::Bind(ChromeReportUnrecoverableError),
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 #if defined(PASSWORD_MANAGER_ENABLE_SYNC) 569 #if defined(PASSWORD_MANAGER_ENABLE_SYNC)
556 scoped_refptr<password_manager::PasswordStore> password_store = 570 scoped_refptr<password_manager::PasswordStore> password_store =
557 PasswordStoreFactory::GetForProfile(profile_, 571 PasswordStoreFactory::GetForProfile(profile_,
558 Profile::EXPLICIT_ACCESS); 572 Profile::EXPLICIT_ACCESS);
559 return password_store.get() ? password_store->GetPasswordSyncableService() 573 return password_store.get() ? password_store->GetPasswordSyncableService()
560 : base::WeakPtr<syncer::SyncableService>(); 574 : base::WeakPtr<syncer::SyncableService>();
561 #else 575 #else
562 return base::WeakPtr<syncer::SyncableService>(); 576 return base::WeakPtr<syncer::SyncableService>();
563 #endif 577 #endif
564 } 578 }
579 #if defined(OS_CHROMEOS)
580 case syncer::WIFI_CREDENTIALS:
581 return wifi_sync::WifiCredentialSyncableServiceFactory::
582 GetForBrowserContext(profile_)->AsWeakPtr();
583 #endif
565 default: 584 default:
566 // The following datatypes still need to be transitioned to the 585 // The following datatypes still need to be transitioned to the
567 // syncer::SyncableService API: 586 // syncer::SyncableService API:
568 // Bookmarks 587 // Bookmarks
569 // Typed URLs 588 // Typed URLs
570 NOTREACHED(); 589 NOTREACHED();
571 return base::WeakPtr<syncer::SyncableService>(); 590 return base::WeakPtr<syncer::SyncableService>();
572 } 591 }
573 } 592 }
574 593
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 new TypedUrlModelAssociator(profile_sync_service, 719 new TypedUrlModelAssociator(profile_sync_service,
701 history_backend, 720 history_backend,
702 error_handler); 721 error_handler);
703 TypedUrlChangeProcessor* change_processor = 722 TypedUrlChangeProcessor* change_processor =
704 new TypedUrlChangeProcessor(profile_, 723 new TypedUrlChangeProcessor(profile_,
705 model_associator, 724 model_associator,
706 history_backend, 725 history_backend,
707 error_handler); 726 error_handler);
708 return SyncComponents(model_associator, change_processor); 727 return SyncComponents(model_associator, change_processor);
709 } 728 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698