OLD | NEW |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "chrome/browser/sync/glue/sync_start_util.h" | 45 #include "chrome/browser/sync/glue/sync_start_util.h" |
46 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 46 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
47 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" | 47 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" |
48 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" | 48 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" |
49 #include "chrome/browser/sync/sync_type_preference_provider.h" | 49 #include "chrome/browser/sync/sync_type_preference_provider.h" |
50 #include "chrome/browser/ui/browser.h" | 50 #include "chrome/browser/ui/browser.h" |
51 #include "chrome/browser/ui/browser_list.h" | 51 #include "chrome/browser/ui/browser_list.h" |
52 #include "chrome/browser/ui/browser_window.h" | 52 #include "chrome/browser/ui/browser_window.h" |
53 #include "chrome/browser/ui/global_error/global_error_service.h" | 53 #include "chrome/browser/ui/global_error/global_error_service.h" |
54 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 54 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 55 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" |
55 #include "chrome/common/channel_info.h" | 56 #include "chrome/common/channel_info.h" |
56 #include "chrome/common/chrome_switches.h" | 57 #include "chrome/common/chrome_switches.h" |
57 #include "chrome/common/pref_names.h" | 58 #include "chrome/common/pref_names.h" |
58 #include "chrome/common/url_constants.h" | 59 #include "chrome/common/url_constants.h" |
59 #include "chrome/grit/generated_resources.h" | 60 #include "chrome/grit/generated_resources.h" |
60 #include "components/autofill/core/common/autofill_pref_names.h" | 61 #include "components/autofill/core/common/autofill_pref_names.h" |
61 #include "components/invalidation/impl/profile_invalidation_provider.h" | 62 #include "components/invalidation/impl/profile_invalidation_provider.h" |
62 #include "components/invalidation/public/invalidation_service.h" | 63 #include "components/invalidation/public/invalidation_service.h" |
63 #include "components/password_manager/core/browser/password_store.h" | 64 #include "components/password_manager/core/browser/password_store.h" |
64 #include "components/pref_registry/pref_registry_syncable.h" | 65 #include "components/pref_registry/pref_registry_syncable.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #include "sync/internal_api/public/util/sync_db_util.h" | 99 #include "sync/internal_api/public/util/sync_db_util.h" |
99 #include "sync/internal_api/public/util/sync_string_conversions.h" | 100 #include "sync/internal_api/public/util/sync_string_conversions.h" |
100 #include "sync/js/js_event_details.h" | 101 #include "sync/js/js_event_details.h" |
101 #include "sync/protocol/sync.pb.h" | 102 #include "sync/protocol/sync.pb.h" |
102 #include "sync/syncable/directory.h" | 103 #include "sync/syncable/directory.h" |
103 #include "sync/util/cryptographer.h" | 104 #include "sync/util/cryptographer.h" |
104 #include "ui/base/l10n/l10n_util.h" | 105 #include "ui/base/l10n/l10n_util.h" |
105 #include "ui/base/l10n/time_format.h" | 106 #include "ui/base/l10n/time_format.h" |
106 | 107 |
107 #if defined(OS_ANDROID) | 108 #if defined(OS_ANDROID) |
| 109 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" |
108 #include "sync/internal_api/public/read_transaction.h" | 110 #include "sync/internal_api/public/read_transaction.h" |
109 #endif | 111 #endif |
110 | 112 |
111 using browser_sync::NotificationServiceSessionsRouter; | 113 using browser_sync::NotificationServiceSessionsRouter; |
112 using browser_sync::ProfileSyncServiceStartBehavior; | 114 using browser_sync::ProfileSyncServiceStartBehavior; |
113 using browser_sync::SessionsSyncManager; | 115 using browser_sync::SessionsSyncManager; |
114 using browser_sync::SyncBackendHost; | 116 using browser_sync::SyncBackendHost; |
115 using sync_driver::ChangeProcessor; | 117 using sync_driver::ChangeProcessor; |
116 using sync_driver::DataTypeController; | 118 using sync_driver::DataTypeController; |
117 using sync_driver::DataTypeManager; | 119 using sync_driver::DataTypeManager; |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 scoped_ptr<browser_sync::LocalSessionEventRouter> router( | 272 scoped_ptr<browser_sync::LocalSessionEventRouter> router( |
271 new NotificationServiceSessionsRouter(profile, flare)); | 273 new NotificationServiceSessionsRouter(profile, flare)); |
272 | 274 |
273 DCHECK(factory_.get()); | 275 DCHECK(factory_.get()); |
274 local_device_ = factory_->CreateLocalDeviceInfoProvider(); | 276 local_device_ = factory_->CreateLocalDeviceInfoProvider(); |
275 sync_stopped_reporter_.reset( | 277 sync_stopped_reporter_.reset( |
276 new browser_sync::SyncStoppedReporter( | 278 new browser_sync::SyncStoppedReporter( |
277 sync_service_url_, | 279 sync_service_url_, |
278 local_device_->GetSyncUserAgent(), | 280 local_device_->GetSyncUserAgent(), |
279 profile_->GetRequestContext(), | 281 profile_->GetRequestContext(), |
280 browser_sync::SyncStoppedReporter::ResultCallback())), | 282 browser_sync::SyncStoppedReporter::ResultCallback())); |
| 283 scoped_ptr<browser_sync::SyncedWindowDelegatesGetter> synced_window_getter( |
| 284 #if defined(OS_ANDROID) |
| 285 new browser_sync::SyncedWindowDelegatesGetterAndroid()); |
| 286 #else |
| 287 new browser_sync::BrowserSyncedWindowDelegatesGetter()); |
| 288 #endif |
281 sessions_sync_manager_.reset( | 289 sessions_sync_manager_.reset( |
282 new SessionsSyncManager(profile, local_device_.get(), router.Pass())); | 290 new SessionsSyncManager(profile, local_device_.get(), router.Pass(), |
| 291 synced_window_getter.Pass())); |
283 device_info_sync_service_.reset( | 292 device_info_sync_service_.reset( |
284 new DeviceInfoSyncService(local_device_.get())); | 293 new DeviceInfoSyncService(local_device_.get())); |
285 | 294 |
286 std::string last_version = sync_prefs_.GetLastRunVersion(); | 295 std::string last_version = sync_prefs_.GetLastRunVersion(); |
287 std::string current_version = PRODUCT_VERSION; | 296 std::string current_version = PRODUCT_VERSION; |
288 sync_prefs_.SetLastRunVersion(current_version); | 297 sync_prefs_.SetLastRunVersion(current_version); |
289 | 298 |
290 // Check for a major version change. Note that the versions have format | 299 // Check for a major version change. Note that the versions have format |
291 // MAJOR.MINOR.BUILD.PATCH. | 300 // MAJOR.MINOR.BUILD.PATCH. |
292 if (last_version.substr(0, last_version.find('.')) != | 301 if (last_version.substr(0, last_version.find('.')) != |
(...skipping 2502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2795 } | 2804 } |
2796 | 2805 |
2797 std::string ProfileSyncService::unrecoverable_error_message() const { | 2806 std::string ProfileSyncService::unrecoverable_error_message() const { |
2798 return unrecoverable_error_message_; | 2807 return unrecoverable_error_message_; |
2799 } | 2808 } |
2800 | 2809 |
2801 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() | 2810 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() |
2802 const { | 2811 const { |
2803 return unrecoverable_error_location_; | 2812 return unrecoverable_error_location_; |
2804 } | 2813 } |
OLD | NEW |