Skip to content

Commit

Permalink
Fix IOSChromeSyncClient to support syncer::TYPED_URLS.
Browse files Browse the repository at this point in the history
The issue http://crrev.com/1454503002 added support for TYPED_URLS
to desktop ChromeSyncClient but missed IOSChromeSyncClient. Fix the
omission to avoid a DCHECK downstream.

BUG=562170,570296,570297

Review URL: https://codereview.chromium.org/1530123003

Cr-Commit-Position: refs/heads/master@{#365532}
  • Loading branch information
sdefresne authored and Commit bot committed Dec 16, 2015
1 parent 31ef50e commit cc4d506
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ios/chrome/browser/sync/ios_chrome_sync_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ void IOSChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) {
}

sync_driver::SyncService* IOSChromeSyncClient::GetSyncService() {
// TODO(crbug.com/558298): bring back this DCHECK after Typed URLs are
// converted to SyncableService.
// DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI);
DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI);
return sync_service_;
}

Expand Down Expand Up @@ -290,6 +288,13 @@ IOSChromeSyncClient::GetSyncableServiceForType(syncer::ModelType type) {
return history ? history->AsWeakPtr()
: base::WeakPtr<history::HistoryService>();
}
case syncer::TYPED_URLS: {
history::HistoryService* history =
ios::HistoryServiceFactory::GetForBrowserState(
browser_state_, ServiceAccessType::EXPLICIT_ACCESS);
return history ? history->GetTypedUrlSyncableService()->AsWeakPtr()
: base::WeakPtr<syncer::SyncableService>();
}
case syncer::FAVICON_IMAGES:
case syncer::FAVICON_TRACKING: {
browser_sync::FaviconCache* favicons =
Expand Down Expand Up @@ -320,7 +325,6 @@ IOSChromeSyncClient::GetSyncableServiceForType(syncer::ModelType type) {
// TODO(crbug.com/562170) The following datatypes still need to be
// transitioned to the syncer::SyncableService API:
// Bookmarks
// Typed URLs
NOTREACHED();
return base::WeakPtr<syncer::SyncableService>();
}
Expand Down

0 comments on commit cc4d506

Please sign in to comment.