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

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: Rebase Created 5 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 (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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "chrome/browser/sync/glue/sync_start_util.h" 43 #include "chrome/browser/sync/glue/sync_start_util.h"
44 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" 44 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h"
45 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" 45 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h"
46 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" 46 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h"
47 #include "chrome/browser/sync/sync_type_preference_provider.h" 47 #include "chrome/browser/sync/sync_type_preference_provider.h"
48 #include "chrome/browser/ui/browser.h" 48 #include "chrome/browser/ui/browser.h"
49 #include "chrome/browser/ui/browser_list.h" 49 #include "chrome/browser/ui/browser_list.h"
50 #include "chrome/browser/ui/browser_window.h" 50 #include "chrome/browser/ui/browser_window.h"
51 #include "chrome/browser/ui/global_error/global_error_service.h" 51 #include "chrome/browser/ui/global_error/global_error_service.h"
52 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 52 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
53 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h"
54 #include "chrome/common/channel_info.h" 53 #include "chrome/common/channel_info.h"
55 #include "chrome/common/chrome_switches.h" 54 #include "chrome/common/chrome_switches.h"
56 #include "chrome/common/pref_names.h" 55 #include "chrome/common/pref_names.h"
57 #include "chrome/common/url_constants.h" 56 #include "chrome/common/url_constants.h"
58 #include "chrome/grit/generated_resources.h" 57 #include "chrome/grit/generated_resources.h"
59 #include "components/autofill/core/common/autofill_pref_names.h" 58 #include "components/autofill/core/common/autofill_pref_names.h"
60 #include "components/invalidation/impl/profile_invalidation_provider.h" 59 #include "components/invalidation/impl/profile_invalidation_provider.h"
61 #include "components/invalidation/public/invalidation_service.h" 60 #include "components/invalidation/public/invalidation_service.h"
62 #include "components/password_manager/core/browser/password_store.h" 61 #include "components/password_manager/core/browser/password_store.h"
63 #include "components/pref_registry/pref_registry_syncable.h" 62 #include "components/pref_registry/pref_registry_syncable.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 #include "sync/internal_api/public/util/sync_db_util.h" 98 #include "sync/internal_api/public/util/sync_db_util.h"
100 #include "sync/internal_api/public/util/sync_string_conversions.h" 99 #include "sync/internal_api/public/util/sync_string_conversions.h"
101 #include "sync/js/js_event_details.h" 100 #include "sync/js/js_event_details.h"
102 #include "sync/protocol/sync.pb.h" 101 #include "sync/protocol/sync.pb.h"
103 #include "sync/syncable/directory.h" 102 #include "sync/syncable/directory.h"
104 #include "sync/util/cryptographer.h" 103 #include "sync/util/cryptographer.h"
105 #include "ui/base/l10n/l10n_util.h" 104 #include "ui/base/l10n/l10n_util.h"
106 #include "ui/base/l10n/time_format.h" 105 #include "ui/base/l10n/time_format.h"
107 106
108 #if defined(OS_ANDROID) 107 #if defined(OS_ANDROID)
109 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h"
110 #include "sync/internal_api/public/read_transaction.h" 108 #include "sync/internal_api/public/read_transaction.h"
111 #endif 109 #endif
112 110
113 using browser_sync::NotificationServiceSessionsRouter; 111 using browser_sync::NotificationServiceSessionsRouter;
114 using browser_sync::ProfileSyncServiceStartBehavior; 112 using browser_sync::ProfileSyncServiceStartBehavior;
115 using browser_sync::SessionsSyncManager; 113 using browser_sync::SessionsSyncManager;
116 using browser_sync::SyncBackendHost; 114 using browser_sync::SyncBackendHost;
117 using sync_driver::ChangeProcessor; 115 using sync_driver::ChangeProcessor;
118 using sync_driver::DataTypeController; 116 using sync_driver::DataTypeController;
119 using sync_driver::DataTypeManager; 117 using sync_driver::DataTypeManager;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 signin_.get(), 264 signin_.get(),
267 base::Bind(&ProfileSyncService::StartUpSlowBackendComponents, 265 base::Bind(&ProfileSyncService::StartUpSlowBackendComponents,
268 startup_controller_weak_factory_.GetWeakPtr(), 266 startup_controller_weak_factory_.GetWeakPtr(),
269 BACKUP), 267 BACKUP),
270 base::Bind(&ProfileSyncService::StartUpSlowBackendComponents, 268 base::Bind(&ProfileSyncService::StartUpSlowBackendComponents,
271 startup_controller_weak_factory_.GetWeakPtr(), 269 startup_controller_weak_factory_.GetWeakPtr(),
272 ROLLBACK))); 270 ROLLBACK)));
273 syncer::SyncableService::StartSyncFlare flare( 271 syncer::SyncableService::StartSyncFlare flare(
274 sync_start_util::GetFlareForSyncableService(profile->GetPath())); 272 sync_start_util::GetFlareForSyncableService(profile->GetPath()));
275 scoped_ptr<browser_sync::LocalSessionEventRouter> router( 273 scoped_ptr<browser_sync::LocalSessionEventRouter> router(
276 new NotificationServiceSessionsRouter(profile, flare)); 274 new NotificationServiceSessionsRouter(
277 275 profile, sync_client_->GetSyncSessionsClient(), flare));
278 local_device_ = sync_client_->GetSyncApiComponentFactory() 276 local_device_ = sync_client_->GetSyncApiComponentFactory()
279 ->CreateLocalDeviceInfoProvider(); 277 ->CreateLocalDeviceInfoProvider();
280 sync_stopped_reporter_.reset( 278 sync_stopped_reporter_.reset(
281 new browser_sync::SyncStoppedReporter( 279 new browser_sync::SyncStoppedReporter(
282 sync_service_url_, 280 sync_service_url_,
283 local_device_->GetSyncUserAgent(), 281 local_device_->GetSyncUserAgent(),
284 profile_->GetRequestContext(), 282 profile_->GetRequestContext(),
285 browser_sync::SyncStoppedReporter::ResultCallback())); 283 browser_sync::SyncStoppedReporter::ResultCallback()));
286 scoped_ptr<browser_sync::SyncedWindowDelegatesGetter> synced_window_getter(
287 #if defined(OS_ANDROID)
288 new browser_sync::SyncedWindowDelegatesGetterAndroid());
289 #else
290 new browser_sync::BrowserSyncedWindowDelegatesGetter());
291 #endif
292 sessions_sync_manager_.reset( 284 sessions_sync_manager_.reset(
293 new SessionsSyncManager(profile, local_device_.get(), router.Pass(), 285 new SessionsSyncManager(sync_client_->GetSyncSessionsClient(), profile,
294 synced_window_getter.Pass())); 286 local_device_.get(), router.Pass()));
295 device_info_sync_service_.reset( 287 device_info_sync_service_.reset(
296 new DeviceInfoSyncService(local_device_.get())); 288 new DeviceInfoSyncService(local_device_.get()));
297 289
298 std::string last_version = sync_prefs_.GetLastRunVersion(); 290 std::string last_version = sync_prefs_.GetLastRunVersion();
299 std::string current_version = PRODUCT_VERSION; 291 std::string current_version = PRODUCT_VERSION;
300 sync_prefs_.SetLastRunVersion(current_version); 292 sync_prefs_.SetLastRunVersion(current_version);
301 293
302 // Check for a major version change. Note that the versions have format 294 // Check for a major version change. Note that the versions have format
303 // MAJOR.MINOR.BUILD.PATCH. 295 // MAJOR.MINOR.BUILD.PATCH.
304 if (last_version.substr(0, last_version.find('.')) != 296 if (last_version.substr(0, last_version.find('.')) !=
(...skipping 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after
2738 } 2730 }
2739 2731
2740 std::string ProfileSyncService::unrecoverable_error_message() const { 2732 std::string ProfileSyncService::unrecoverable_error_message() const {
2741 return unrecoverable_error_message_; 2733 return unrecoverable_error_message_;
2742 } 2734 }
2743 2735
2744 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() 2736 tracked_objects::Location ProfileSyncService::unrecoverable_error_location()
2745 const { 2737 const {
2746 return unrecoverable_error_location_; 2738 return unrecoverable_error_location_;
2747 } 2739 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698