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

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

Issue 2723953002: [sync] skeleton implementation of TypedURLSyncBridge (Closed)
Patch Set: rebase and address missing parts for bug 558320 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); 489 return base::WeakPtr<syncer::ModelTypeSyncBridge>();
490 case syncer::AUTOFILL: 490 case syncer::AUTOFILL:
491 return autofill::AutocompleteSyncBridge::FromWebDataService( 491 return autofill::AutocompleteSyncBridge::FromWebDataService(
492 web_data_service_.get()); 492 web_data_service_.get());
493 #if defined(OS_CHROMEOS) 493 #if defined(OS_CHROMEOS)
494 case syncer::PRINTERS: 494 case syncer::PRINTERS:
495 return chromeos::PrintersManagerFactory::GetForBrowserContext(profile_) 495 return chromeos::PrintersManagerFactory::GetForBrowserContext(profile_)
496 ->GetSyncBridge() 496 ->GetSyncBridge()
497 ->AsWeakPtr(); 497 ->AsWeakPtr();
498 #endif 498 #endif
499 case syncer::TYPED_URLS: {
500 history::HistoryService* history = HistoryServiceFactory::GetForProfile(
skym 2017/03/07 18:08:04 So, every other place we access the HistoryService
Gang Wu 2017/03/31 19:35:58 Done.
501 profile_, ServiceAccessType::IMPLICIT_ACCESS);
502 if (!history)
503 return base::WeakPtr<history::TypedURLSyncBridge>();
504 return history->GetTypedURLSyncBridge()->AsWeakPtr();
505 }
499 default: 506 default:
500 NOTREACHED(); 507 NOTREACHED();
501 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); 508 return base::WeakPtr<syncer::ModelTypeSyncBridge>();
502 } 509 }
503 } 510 }
504 511
505 scoped_refptr<syncer::ModelSafeWorker> 512 scoped_refptr<syncer::ModelSafeWorker>
506 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { 513 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) {
507 DCHECK_CURRENTLY_ON(BrowserThread::UI); 514 DCHECK_CURRENTLY_ON(BrowserThread::UI);
508 switch (group) { 515 switch (group) {
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 sync_service->RegisterDataTypeController( 699 sync_service->RegisterDataTypeController(
693 base::MakeUnique<SupervisedUserSyncDataTypeController>( 700 base::MakeUnique<SupervisedUserSyncDataTypeController>(
694 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); 701 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_));
695 sync_service->RegisterDataTypeController( 702 sync_service->RegisterDataTypeController(
696 base::MakeUnique<SupervisedUserSyncDataTypeController>( 703 base::MakeUnique<SupervisedUserSyncDataTypeController>(
697 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); 704 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_));
698 #endif 705 #endif
699 } 706 }
700 707
701 } // namespace browser_sync 708 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698