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

Side by Side Diff: ios/chrome/browser/sync/ios_chrome_sync_client.mm

Issue 2398233003: with sync (Closed)
Patch Set: done Created 4 years, 2 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 "ios/chrome/browser/sync/ios_chrome_sync_client.h" 5 #include "ios/chrome/browser/sync/ios_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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" 45 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
46 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 46 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
47 #include "ios/chrome/browser/browser_state/chrome_browser_state_manager.h" 47 #include "ios/chrome/browser/browser_state/chrome_browser_state_manager.h"
48 #include "ios/chrome/browser/chrome_url_constants.h" 48 #include "ios/chrome/browser/chrome_url_constants.h"
49 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h" 49 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h"
50 #include "ios/chrome/browser/favicon/favicon_service_factory.h" 50 #include "ios/chrome/browser/favicon/favicon_service_factory.h"
51 #include "ios/chrome/browser/history/history_service_factory.h" 51 #include "ios/chrome/browser/history/history_service_factory.h"
52 #include "ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provid er_factory.h" 52 #include "ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provid er_factory.h"
53 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" 53 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h"
54 #include "ios/chrome/browser/pref_names.h" 54 #include "ios/chrome/browser/pref_names.h"
55 #include "ios/chrome/browser/reading_list/reading_list_model.h"
56 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h"
55 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" 57 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h"
56 #include "ios/chrome/browser/sync/glue/sync_start_util.h" 58 #include "ios/chrome/browser/sync/glue/sync_start_util.h"
57 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" 59 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h"
58 #include "ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router .h" 60 #include "ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router .h"
59 #include "ios/chrome/browser/undo/bookmark_undo_service_factory.h" 61 #include "ios/chrome/browser/undo/bookmark_undo_service_factory.h"
60 #include "ios/chrome/browser/web_data_service_factory.h" 62 #include "ios/chrome/browser/web_data_service_factory.h"
61 #include "ios/chrome/common/channel_info.h" 63 #include "ios/chrome/common/channel_info.h"
62 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" 64 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
63 #include "ios/web/public/web_thread.h" 65 #include "ios/web/public/web_thread.h"
64 #include "ui/base/device_form_factor.h" 66 #include "ui/base/device_form_factor.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 330 }
329 331
330 base::WeakPtr<syncer::ModelTypeService> 332 base::WeakPtr<syncer::ModelTypeService>
331 IOSChromeSyncClient::GetModelTypeServiceForType(syncer::ModelType type) { 333 IOSChromeSyncClient::GetModelTypeServiceForType(syncer::ModelType type) {
332 switch (type) { 334 switch (type) {
333 case syncer::DEVICE_INFO: 335 case syncer::DEVICE_INFO:
334 return IOSChromeProfileSyncServiceFactory::GetForBrowserState( 336 return IOSChromeProfileSyncServiceFactory::GetForBrowserState(
335 browser_state_) 337 browser_state_)
336 ->GetDeviceInfoService() 338 ->GetDeviceInfoService()
337 ->AsWeakPtr(); 339 ->AsWeakPtr();
340 case syncer::READING_LIST: {
341 ReadingListModel* reading_list_model =
342 ReadingListModelFactory::GetForBrowserState(browser_state_);
343 if (reading_list_model)
344 return reading_list_model->GetModelTypeService()->AsWeakPtr();
345 return base::WeakPtr<syncer::ModelTypeService>();
346 }
338 default: 347 default:
339 NOTREACHED(); 348 NOTREACHED();
340 return base::WeakPtr<syncer::ModelTypeService>(); 349 return base::WeakPtr<syncer::ModelTypeService>();
341 } 350 }
342 } 351 }
343 352
344 scoped_refptr<syncer::ModelSafeWorker> 353 scoped_refptr<syncer::ModelSafeWorker>
345 IOSChromeSyncClient::CreateModelWorkerForGroup( 354 IOSChromeSyncClient::CreateModelWorkerForGroup(
346 syncer::ModelSafeGroup group, 355 syncer::ModelSafeGroup group,
347 syncer::WorkerLoopDestructionObserver* observer) { 356 syncer::WorkerLoopDestructionObserver* observer) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); 410 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state);
402 if (profile_sync_service != nullptr) { 411 if (profile_sync_service != nullptr) {
403 const syncer::DeviceInfoTracker* tracker = 412 const syncer::DeviceInfoTracker* tracker =
404 profile_sync_service->GetDeviceInfoTracker(); 413 profile_sync_service->GetDeviceInfoTracker();
405 if (tracker != nullptr) { 414 if (tracker != nullptr) {
406 trackers->push_back(tracker); 415 trackers->push_back(tracker);
407 } 416 }
408 } 417 }
409 } 418 }
410 } 419 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/reading_list/reading_list_store.cc ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698