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 <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "chrome/browser/sync/glue/data_type_controller.h" | 43 #include "chrome/browser/sync/glue/data_type_controller.h" |
44 #include "chrome/browser/sync/glue/device_info.h" | 44 #include "chrome/browser/sync/glue/device_info.h" |
45 #include "chrome/browser/sync/glue/favicon_cache.h" | 45 #include "chrome/browser/sync/glue/favicon_cache.h" |
46 #include "chrome/browser/sync/glue/session_data_type_controller.h" | 46 #include "chrome/browser/sync/glue/session_data_type_controller.h" |
47 #include "chrome/browser/sync/glue/session_model_associator.h" | 47 #include "chrome/browser/sync/glue/session_model_associator.h" |
48 #include "chrome/browser/sync/glue/sync_backend_host.h" | 48 #include "chrome/browser/sync/glue/sync_backend_host.h" |
49 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" | 49 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
50 #include "chrome/browser/sync/glue/synced_device_tracker.h" | 50 #include "chrome/browser/sync/glue/synced_device_tracker.h" |
51 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 51 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
52 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" | 52 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
| 53 #include "chrome/browser/sync/sessions2/notification_service_sessions_router.h" |
53 #include "chrome/browser/sync/sessions2/sessions_sync_manager.h" | 54 #include "chrome/browser/sync/sessions2/sessions_sync_manager.h" |
54 #include "chrome/browser/sync/sync_global_error.h" | 55 #include "chrome/browser/sync/sync_global_error.h" |
55 #include "chrome/browser/sync/user_selectable_sync_type.h" | 56 #include "chrome/browser/sync/user_selectable_sync_type.h" |
56 #include "chrome/browser/ui/browser.h" | 57 #include "chrome/browser/ui/browser.h" |
57 #include "chrome/browser/ui/browser_list.h" | 58 #include "chrome/browser/ui/browser_list.h" |
58 #include "chrome/browser/ui/browser_window.h" | 59 #include "chrome/browser/ui/browser_window.h" |
59 #include "chrome/browser/ui/global_error/global_error_service.h" | 60 #include "chrome/browser/ui/global_error/global_error_service.h" |
60 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 61 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
61 #include "chrome/common/chrome_switches.h" | 62 #include "chrome/common/chrome_switches.h" |
62 #include "chrome/common/chrome_version_info.h" | 63 #include "chrome/common/chrome_version_info.h" |
(...skipping 23 matching lines...) Expand all Loading... |
86 #endif | 87 #endif |
87 | 88 |
88 #if defined(OS_ANDROID) | 89 #if defined(OS_ANDROID) |
89 #include "sync/internal_api/public/read_transaction.h" | 90 #include "sync/internal_api/public/read_transaction.h" |
90 #endif | 91 #endif |
91 | 92 |
92 using browser_sync::ChangeProcessor; | 93 using browser_sync::ChangeProcessor; |
93 using browser_sync::DataTypeController; | 94 using browser_sync::DataTypeController; |
94 using browser_sync::DataTypeManager; | 95 using browser_sync::DataTypeManager; |
95 using browser_sync::FailedDataTypesHandler; | 96 using browser_sync::FailedDataTypesHandler; |
| 97 using browser_sync::NotificationServiceSessionsRouter; |
96 using browser_sync::SyncBackendHost; | 98 using browser_sync::SyncBackendHost; |
97 using syncer::ModelType; | 99 using syncer::ModelType; |
98 using syncer::ModelTypeSet; | 100 using syncer::ModelTypeSet; |
99 using syncer::JsBackend; | 101 using syncer::JsBackend; |
100 using syncer::JsController; | 102 using syncer::JsController; |
101 using syncer::JsEventDetails; | 103 using syncer::JsEventDetails; |
102 using syncer::JsEventHandler; | 104 using syncer::JsEventHandler; |
103 using syncer::ModelSafeRoutingInfo; | 105 using syncer::ModelSafeRoutingInfo; |
104 using syncer::SyncCredentials; | 106 using syncer::SyncCredentials; |
105 using syncer::SyncProtocolError; | 107 using syncer::SyncProtocolError; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // GetChannel hits the registry on Windows. See http://crbug.com/70380. | 193 // GetChannel hits the registry on Windows. See http://crbug.com/70380. |
192 base::ThreadRestrictions::ScopedAllowIO allow_io; | 194 base::ThreadRestrictions::ScopedAllowIO allow_io; |
193 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 195 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
194 if (channel == chrome::VersionInfo::CHANNEL_STABLE || | 196 if (channel == chrome::VersionInfo::CHANNEL_STABLE || |
195 channel == chrome::VersionInfo::CHANNEL_BETA) { | 197 channel == chrome::VersionInfo::CHANNEL_BETA) { |
196 sync_service_url_ = GURL(kSyncServerUrl); | 198 sync_service_url_ = GURL(kSyncServerUrl); |
197 } | 199 } |
198 | 200 |
199 if (CommandLine::ForCurrentProcess()->HasSwitch( | 201 if (CommandLine::ForCurrentProcess()->HasSwitch( |
200 switches::kEnableSyncSessionsV2)) { | 202 switches::kEnableSyncSessionsV2)) { |
201 sessions_sync_manager_.reset(new SessionsSyncManager(profile, this)); | 203 scoped_ptr<SessionsSyncManager::LocalEventRouter> router( |
| 204 new NotificationServiceSessionsRouter(profile)); |
| 205 sessions_sync_manager_.reset( |
| 206 new SessionsSyncManager(profile, this, router.Pass())); |
202 } | 207 } |
203 } | 208 } |
204 | 209 |
205 ProfileSyncService::~ProfileSyncService() { | 210 ProfileSyncService::~ProfileSyncService() { |
206 sync_prefs_.RemoveSyncPrefObserver(this); | 211 sync_prefs_.RemoveSyncPrefObserver(this); |
207 // Shutdown() should have been called before destruction. | 212 // Shutdown() should have been called before destruction. |
208 CHECK(!backend_initialized_); | 213 CHECK(!backend_initialized_); |
209 } | 214 } |
210 | 215 |
211 bool ProfileSyncService::IsSyncEnabledAndLoggedIn() { | 216 bool ProfileSyncService::IsSyncEnabledAndLoggedIn() { |
(...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2261 SyncTokenStatus status; | 2266 SyncTokenStatus status; |
2262 status.connection_status_update_time = connection_status_update_time_; | 2267 status.connection_status_update_time = connection_status_update_time_; |
2263 status.connection_status = connection_status_; | 2268 status.connection_status = connection_status_; |
2264 status.token_request_time = token_request_time_; | 2269 status.token_request_time = token_request_time_; |
2265 status.token_receive_time = token_receive_time_; | 2270 status.token_receive_time = token_receive_time_; |
2266 status.last_get_token_error = last_get_token_error_; | 2271 status.last_get_token_error = last_get_token_error_; |
2267 if (request_access_token_retry_timer_.IsRunning()) | 2272 if (request_access_token_retry_timer_.IsRunning()) |
2268 status.next_token_request_time = next_token_request_time_; | 2273 status.next_token_request_time = next_token_request_time_; |
2269 return status; | 2274 return status; |
2270 } | 2275 } |
OLD | NEW |