| 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 "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 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" | 21 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" |
| 22 #include "chrome/browser/password_manager/password_store_factory.h" | 22 #include "chrome/browser/password_manager/password_store_factory.h" |
| 23 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 23 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
| 26 #include "chrome/browser/search_engines/template_url_service_factory.h" | 26 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 27 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 27 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 28 #include "chrome/browser/sync/glue/sync_start_util.h" | 28 #include "chrome/browser/sync/glue/sync_start_util.h" |
| 29 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | 29 #include "chrome/browser/sync/glue/theme_data_type_controller.h" |
| 30 #include "chrome/browser/sync/profile_sync_service_factory.h" | 30 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 31 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" | 31 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h" |
| 32 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory
.h" |
| 32 #include "chrome/browser/themes/theme_service.h" | 33 #include "chrome/browser/themes/theme_service.h" |
| 33 #include "chrome/browser/themes/theme_service_factory.h" | 34 #include "chrome/browser/themes/theme_service_factory.h" |
| 34 #include "chrome/browser/themes/theme_syncable_service.h" | 35 #include "chrome/browser/themes/theme_syncable_service.h" |
| 35 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" | 36 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" |
| 36 #include "chrome/browser/undo/bookmark_undo_service_factory.h" | 37 #include "chrome/browser/undo/bookmark_undo_service_factory.h" |
| 37 #include "chrome/browser/web_data_service_factory.h" | 38 #include "chrome/browser/web_data_service_factory.h" |
| 38 #include "chrome/common/channel_info.h" | 39 #include "chrome/common/channel_info.h" |
| 39 #include "chrome/common/chrome_paths.h" | 40 #include "chrome/common/chrome_paths.h" |
| 40 #include "chrome/common/features.h" | 41 #include "chrome/common/features.h" |
| 41 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 60 #include "components/spellcheck/spellcheck_build_features.h" | 61 #include "components/spellcheck/spellcheck_build_features.h" |
| 61 #include "components/sync/base/pref_names.h" | 62 #include "components/sync/base/pref_names.h" |
| 62 #include "components/sync/base/report_unrecoverable_error.h" | 63 #include "components/sync/base/report_unrecoverable_error.h" |
| 63 #include "components/sync/driver/async_directory_type_controller.h" | 64 #include "components/sync/driver/async_directory_type_controller.h" |
| 64 #include "components/sync/driver/sync_api_component_factory.h" | 65 #include "components/sync/driver/sync_api_component_factory.h" |
| 65 #include "components/sync/driver/sync_util.h" | 66 #include "components/sync/driver/sync_util.h" |
| 66 #include "components/sync/engine/browser_thread_model_worker.h" | 67 #include "components/sync/engine/browser_thread_model_worker.h" |
| 67 #include "components/sync/engine/passive_model_worker.h" | 68 #include "components/sync/engine/passive_model_worker.h" |
| 68 #include "components/sync/engine/ui_model_worker.h" | 69 #include "components/sync/engine/ui_model_worker.h" |
| 69 #include "components/sync_preferences/pref_service_syncable.h" | 70 #include "components/sync_preferences/pref_service_syncable.h" |
| 71 #include "components/sync_sessions/favicon_cache.h" |
| 70 #include "components/sync_sessions/sync_sessions_client.h" | 72 #include "components/sync_sessions/sync_sessions_client.h" |
| 71 #include "content/public/browser/browser_thread.h" | 73 #include "content/public/browser/browser_thread.h" |
| 72 #include "extensions/features/features.h" | 74 #include "extensions/features/features.h" |
| 73 #include "ui/base/device_form_factor.h" | 75 #include "ui/base/device_form_factor.h" |
| 74 | 76 |
| 75 #if BUILDFLAG(ENABLE_APP_LIST) | 77 #if BUILDFLAG(ENABLE_APP_LIST) |
| 76 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 78 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 77 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 79 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| 78 #include "ui/app_list/app_list_switches.h" | 80 #include "ui/app_list/app_list_switches.h" |
| 79 #endif | 81 #endif |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 177 } |
| 176 return url.is_valid() && !url.SchemeIs(content::kChromeUIScheme) && | 178 return url.is_valid() && !url.SchemeIs(content::kChromeUIScheme) && |
| 177 !url.SchemeIs(chrome::kChromeNativeScheme) && !url.SchemeIsFile(); | 179 !url.SchemeIs(chrome::kChromeNativeScheme) && !url.SchemeIsFile(); |
| 178 } | 180 } |
| 179 | 181 |
| 180 sync_sessions::SyncedWindowDelegatesGetter* GetSyncedWindowDelegatesGetter() | 182 sync_sessions::SyncedWindowDelegatesGetter* GetSyncedWindowDelegatesGetter() |
| 181 override { | 183 override { |
| 182 return window_delegates_getter_.get(); | 184 return window_delegates_getter_.get(); |
| 183 } | 185 } |
| 184 | 186 |
| 185 std::unique_ptr<sync_sessions::LocalSessionEventRouter> | 187 sync_sessions::LocalSessionEventRouter* GetLocalSessionEventRouter() |
| 186 GetLocalSessionEventRouter() override { | 188 override { |
| 187 syncer::SyncableService::StartSyncFlare flare( | 189 syncer::SyncableService::StartSyncFlare flare( |
| 188 sync_start_util::GetFlareForSyncableService(profile_->GetPath())); | 190 sync_start_util::GetFlareForSyncableService(profile_->GetPath())); |
| 189 return base::MakeUnique<sync_sessions::NotificationServiceSessionsRouter>( | 191 sync_sessions::SyncSessionsWebContentsRouter* router = |
| 190 profile_, this, flare); | 192 sync_sessions::SyncSessionsWebContentsRouterFactory::GetForProfile( |
| 193 profile_); |
| 194 router->InjectStartSyncFlare(flare); |
| 195 return router; |
| 191 } | 196 } |
| 192 | 197 |
| 193 private: | 198 private: |
| 194 Profile* profile_; | 199 Profile* profile_; |
| 195 std::unique_ptr<sync_sessions::SyncedWindowDelegatesGetter> | 200 std::unique_ptr<sync_sessions::SyncedWindowDelegatesGetter> |
| 196 window_delegates_getter_; | 201 window_delegates_getter_; |
| 197 | 202 |
| 198 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClientImpl); | 203 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClientImpl); |
| 199 }; | 204 }; |
| 200 | 205 |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 sync_service->RegisterDataTypeController( | 702 sync_service->RegisterDataTypeController( |
| 698 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 703 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 699 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); | 704 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); |
| 700 sync_service->RegisterDataTypeController( | 705 sync_service->RegisterDataTypeController( |
| 701 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 706 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 702 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 707 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
| 703 #endif | 708 #endif |
| 704 } | 709 } |
| 705 | 710 |
| 706 } // namespace browser_sync | 711 } // namespace browser_sync |
| OLD | NEW |