OLD | NEW |
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "ios/chrome/browser/favicon/favicon_service_factory.h" | 51 #include "ios/chrome/browser/favicon/favicon_service_factory.h" |
52 #include "ios/chrome/browser/history/history_service_factory.h" | 52 #include "ios/chrome/browser/history/history_service_factory.h" |
53 #include "ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provid
er_factory.h" | 53 #include "ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provid
er_factory.h" |
54 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" | 54 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" |
55 #include "ios/chrome/browser/pref_names.h" | 55 #include "ios/chrome/browser/pref_names.h" |
56 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h" | 56 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h" |
57 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" | 57 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" |
58 #include "ios/chrome/browser/sync/glue/sync_start_util.h" | 58 #include "ios/chrome/browser/sync/glue/sync_start_util.h" |
59 #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" |
60 #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" |
| 61 #include "ios/chrome/browser/tabs/tab_model_synced_window_delegate_getter.h" |
61 #include "ios/chrome/browser/undo/bookmark_undo_service_factory.h" | 62 #include "ios/chrome/browser/undo/bookmark_undo_service_factory.h" |
62 #include "ios/chrome/browser/web_data_service_factory.h" | 63 #include "ios/chrome/browser/web_data_service_factory.h" |
63 #include "ios/chrome/common/channel_info.h" | 64 #include "ios/chrome/common/channel_info.h" |
64 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | |
65 #include "ios/web/public/web_thread.h" | 65 #include "ios/web/public/web_thread.h" |
66 #include "ui/base/device_form_factor.h" | 66 #include "ui/base/device_form_factor.h" |
67 | 67 |
68 #if !defined(__has_feature) || !__has_feature(objc_arc) | 68 #if !defined(__has_feature) || !__has_feature(objc_arc) |
69 #error "This file requires ARC support." | 69 #error "This file requires ARC support." |
70 #endif | 70 #endif |
71 | 71 |
72 namespace { | 72 namespace { |
73 | 73 |
74 // iOS implementation of SyncSessionsClient. Needs to be in a separate class | 74 // iOS implementation of SyncSessionsClient. Needs to be in a separate class |
75 // due to possible multiple inheritance issues, wherein IOSChromeSyncClient | 75 // due to possible multiple inheritance issues, wherein IOSChromeSyncClient |
76 // might inherit from other interfaces with same methods. | 76 // might inherit from other interfaces with same methods. |
77 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { | 77 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { |
78 public: | 78 public: |
79 explicit SyncSessionsClientImpl(ios::ChromeBrowserState* browser_state) | 79 explicit SyncSessionsClientImpl(ios::ChromeBrowserState* browser_state) |
80 : browser_state_(browser_state), | 80 : browser_state_(browser_state), |
81 window_delegates_getter_( | 81 window_delegates_getter_( |
82 ios::GetChromeBrowserProvider()->CreateSyncedWindowDelegatesGetter( | 82 base::MakeUnique<TabModelSyncedWindowDelegatesGetter>( |
83 browser_state)) {} | 83 browser_state)) {} |
84 | 84 |
85 ~SyncSessionsClientImpl() override {} | 85 ~SyncSessionsClientImpl() override {} |
86 | 86 |
87 // SyncSessionsClient implementation. | 87 // SyncSessionsClient implementation. |
88 bookmarks::BookmarkModel* GetBookmarkModel() override { | 88 bookmarks::BookmarkModel* GetBookmarkModel() override { |
89 DCHECK_CURRENTLY_ON(web::WebThread::UI); | 89 DCHECK_CURRENTLY_ON(web::WebThread::UI); |
90 return ios::BookmarkModelFactory::GetForBrowserState(browser_state_); | 90 return ios::BookmarkModelFactory::GetForBrowserState(browser_state_); |
91 } | 91 } |
92 | 92 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); | 417 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); |
418 if (profile_sync_service != nullptr) { | 418 if (profile_sync_service != nullptr) { |
419 const syncer::DeviceInfoTracker* tracker = | 419 const syncer::DeviceInfoTracker* tracker = |
420 profile_sync_service->GetDeviceInfoTracker(); | 420 profile_sync_service->GetDeviceInfoTracker(); |
421 if (tracker != nullptr) { | 421 if (tracker != nullptr) { |
422 trackers->push_back(tracker); | 422 trackers->push_back(tracker); |
423 } | 423 } |
424 } | 424 } |
425 } | 425 } |
426 } | 426 } |
OLD | NEW |