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

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

Issue 1408643002: [Sync] Componentize synced_tab_delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test broken by rebase Created 5 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 22 matching lines...) Expand all
33 #include "chrome/browser/signin/about_signin_internals_factory.h" 33 #include "chrome/browser/signin/about_signin_internals_factory.h"
34 #include "chrome/browser/signin/chrome_signin_client_factory.h" 34 #include "chrome/browser/signin/chrome_signin_client_factory.h"
35 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 35 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
36 #include "chrome/browser/signin/signin_manager_factory.h" 36 #include "chrome/browser/signin/signin_manager_factory.h"
37 #include "chrome/browser/sync/glue/sync_backend_host.h" 37 #include "chrome/browser/sync/glue/sync_backend_host.h"
38 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" 38 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
39 #include "chrome/browser/sync/glue/sync_start_util.h" 39 #include "chrome/browser/sync/glue/sync_start_util.h"
40 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" 40 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h"
41 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" 41 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h"
42 #include "chrome/browser/sync/sync_type_preference_provider.h" 42 #include "chrome/browser/sync/sync_type_preference_provider.h"
43 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" 43 #include "chrome/browser/ui/browser.h"
44 #include "chrome/browser/ui/browser_list.h"
45 #include "chrome/browser/ui/browser_window.h"
46 #include "chrome/browser/ui/global_error/global_error_service.h"
47 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
44 #include "chrome/common/channel_info.h" 48 #include "chrome/common/channel_info.h"
45 #include "chrome/common/chrome_switches.h" 49 #include "chrome/common/chrome_switches.h"
46 #include "chrome/common/pref_names.h" 50 #include "chrome/common/pref_names.h"
47 #include "chrome/grit/generated_resources.h" 51 #include "chrome/grit/generated_resources.h"
48 #include "components/autofill/core/common/autofill_pref_names.h" 52 #include "components/autofill/core/common/autofill_pref_names.h"
49 #include "components/history/core/browser/typed_url_data_type_controller.h" 53 #include "components/history/core/browser/typed_url_data_type_controller.h"
50 #include "components/invalidation/impl/profile_invalidation_provider.h" 54 #include "components/invalidation/impl/profile_invalidation_provider.h"
51 #include "components/invalidation/public/invalidation_service.h" 55 #include "components/invalidation/public/invalidation_service.h"
52 #include "components/password_manager/core/browser/password_store.h" 56 #include "components/password_manager/core/browser/password_store.h"
53 #include "components/pref_registry/pref_registry_syncable.h" 57 #include "components/pref_registry/pref_registry_syncable.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #include "sync/internal_api/public/util/sync_db_util.h" 93 #include "sync/internal_api/public/util/sync_db_util.h"
90 #include "sync/internal_api/public/util/sync_string_conversions.h" 94 #include "sync/internal_api/public/util/sync_string_conversions.h"
91 #include "sync/js/js_event_details.h" 95 #include "sync/js/js_event_details.h"
92 #include "sync/protocol/sync.pb.h" 96 #include "sync/protocol/sync.pb.h"
93 #include "sync/syncable/directory.h" 97 #include "sync/syncable/directory.h"
94 #include "sync/util/cryptographer.h" 98 #include "sync/util/cryptographer.h"
95 #include "ui/base/l10n/l10n_util.h" 99 #include "ui/base/l10n/l10n_util.h"
96 #include "ui/base/l10n/time_format.h" 100 #include "ui/base/l10n/time_format.h"
97 101
98 #if defined(OS_ANDROID) 102 #if defined(OS_ANDROID)
99 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h"
100 #include "sync/internal_api/public/read_transaction.h" 103 #include "sync/internal_api/public/read_transaction.h"
101 #endif 104 #endif
102 105
103 using browser_sync::NotificationServiceSessionsRouter; 106 using browser_sync::NotificationServiceSessionsRouter;
104 using browser_sync::ProfileSyncServiceStartBehavior; 107 using browser_sync::ProfileSyncServiceStartBehavior;
105 using browser_sync::SessionsSyncManager; 108 using browser_sync::SessionsSyncManager;
106 using browser_sync::SyncBackendHost; 109 using browser_sync::SyncBackendHost;
107 using sync_driver::ChangeProcessor; 110 using sync_driver::ChangeProcessor;
108 using sync_driver::DataTypeController; 111 using sync_driver::DataTypeController;
109 using sync_driver::DataTypeManager; 112 using sync_driver::DataTypeManager;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 signin_.get(), 259 signin_.get(),
257 base::Bind(&ProfileSyncService::StartUpSlowBackendComponents, 260 base::Bind(&ProfileSyncService::StartUpSlowBackendComponents,
258 startup_controller_weak_factory_.GetWeakPtr(), 261 startup_controller_weak_factory_.GetWeakPtr(),
259 BACKUP), 262 BACKUP),
260 base::Bind(&ProfileSyncService::StartUpSlowBackendComponents, 263 base::Bind(&ProfileSyncService::StartUpSlowBackendComponents,
261 startup_controller_weak_factory_.GetWeakPtr(), 264 startup_controller_weak_factory_.GetWeakPtr(),
262 ROLLBACK))); 265 ROLLBACK)));
263 syncer::SyncableService::StartSyncFlare flare( 266 syncer::SyncableService::StartSyncFlare flare(
264 sync_start_util::GetFlareForSyncableService(profile->GetPath())); 267 sync_start_util::GetFlareForSyncableService(profile->GetPath()));
265 scoped_ptr<browser_sync::LocalSessionEventRouter> router( 268 scoped_ptr<browser_sync::LocalSessionEventRouter> router(
266 new NotificationServiceSessionsRouter(profile, flare)); 269 new NotificationServiceSessionsRouter(
267 270 profile, sync_client_->GetSyncSessionsClient(), flare));
268 local_device_ = sync_client_->GetSyncApiComponentFactory() 271 local_device_ = sync_client_->GetSyncApiComponentFactory()
269 ->CreateLocalDeviceInfoProvider(); 272 ->CreateLocalDeviceInfoProvider();
270 sync_stopped_reporter_.reset( 273 sync_stopped_reporter_.reset(
271 new browser_sync::SyncStoppedReporter( 274 new browser_sync::SyncStoppedReporter(
272 sync_service_url_, 275 sync_service_url_,
273 local_device_->GetSyncUserAgent(), 276 local_device_->GetSyncUserAgent(),
274 profile_->GetRequestContext(), 277 profile_->GetRequestContext(),
275 browser_sync::SyncStoppedReporter::ResultCallback())); 278 browser_sync::SyncStoppedReporter::ResultCallback()));
276 scoped_ptr<browser_sync::SyncedWindowDelegatesGetter> synced_window_getter(
277 #if defined(OS_ANDROID)
278 new browser_sync::SyncedWindowDelegatesGetterAndroid());
279 #else
280 new browser_sync::BrowserSyncedWindowDelegatesGetter());
281 #endif
282 sessions_sync_manager_.reset( 279 sessions_sync_manager_.reset(
283 new SessionsSyncManager(profile, local_device_.get(), router.Pass(), 280 new SessionsSyncManager(sync_client_->GetSyncSessionsClient(), profile,
284 synced_window_getter.Pass())); 281 local_device_.get(), router.Pass()));
285 device_info_sync_service_.reset( 282 device_info_sync_service_.reset(
286 new DeviceInfoSyncService(local_device_.get())); 283 new DeviceInfoSyncService(local_device_.get()));
287 284
288 std::string last_version = sync_prefs_.GetLastRunVersion(); 285 std::string last_version = sync_prefs_.GetLastRunVersion();
289 std::string current_version = PRODUCT_VERSION; 286 std::string current_version = PRODUCT_VERSION;
290 sync_prefs_.SetLastRunVersion(current_version); 287 sync_prefs_.SetLastRunVersion(current_version);
291 288
292 // Check for a major version change. Note that the versions have format 289 // Check for a major version change. Note that the versions have format
293 // MAJOR.MINOR.BUILD.PATCH. 290 // MAJOR.MINOR.BUILD.PATCH.
294 if (last_version.substr(0, last_version.find('.')) != 291 if (last_version.substr(0, last_version.find('.')) !=
(...skipping 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after
2738 } 2735 }
2739 2736
2740 std::string ProfileSyncService::unrecoverable_error_message() const { 2737 std::string ProfileSyncService::unrecoverable_error_message() const {
2741 return unrecoverable_error_message_; 2738 return unrecoverable_error_message_;
2742 } 2739 }
2743 2740
2744 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() 2741 tracked_objects::Location ProfileSyncService::unrecoverable_error_location()
2745 const { 2742 const {
2746 return unrecoverable_error_location_; 2743 return unrecoverable_error_location_;
2747 } 2744 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698