Chromium Code Reviews| 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 30 matching lines...) Expand all Loading... | |
| 41 #include "chrome/browser/sync/glue/data_type_controller.h" | 41 #include "chrome/browser/sync/glue/data_type_controller.h" |
| 42 #include "chrome/browser/sync/glue/device_info.h" | 42 #include "chrome/browser/sync/glue/device_info.h" |
| 43 #include "chrome/browser/sync/glue/favicon_cache.h" | 43 #include "chrome/browser/sync/glue/favicon_cache.h" |
| 44 #include "chrome/browser/sync/glue/session_data_type_controller.h" | 44 #include "chrome/browser/sync/glue/session_data_type_controller.h" |
| 45 #include "chrome/browser/sync/glue/session_model_associator.h" | 45 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 46 #include "chrome/browser/sync/glue/sync_backend_host.h" | 46 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 47 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" | 47 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
| 48 #include "chrome/browser/sync/glue/synced_device_tracker.h" | 48 #include "chrome/browser/sync/glue/synced_device_tracker.h" |
| 49 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 49 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
| 50 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" | 50 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
| 51 #include "chrome/browser/sync/sessions2/notification_service_sessions_router.h" | |
| 51 #include "chrome/browser/sync/sessions2/sessions_sync_manager.h" | 52 #include "chrome/browser/sync/sessions2/sessions_sync_manager.h" |
| 52 #include "chrome/browser/sync/sync_global_error.h" | 53 #include "chrome/browser/sync/sync_global_error.h" |
| 53 #include "chrome/browser/sync/user_selectable_sync_type.h" | 54 #include "chrome/browser/sync/user_selectable_sync_type.h" |
| 54 #include "chrome/browser/ui/browser.h" | 55 #include "chrome/browser/ui/browser.h" |
| 55 #include "chrome/browser/ui/browser_list.h" | 56 #include "chrome/browser/ui/browser_list.h" |
| 56 #include "chrome/browser/ui/browser_window.h" | 57 #include "chrome/browser/ui/browser_window.h" |
| 57 #include "chrome/browser/ui/global_error/global_error_service.h" | 58 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 58 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 59 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 59 #include "chrome/common/chrome_switches.h" | 60 #include "chrome/common/chrome_switches.h" |
| 60 #include "chrome/common/chrome_version_info.h" | 61 #include "chrome/common/chrome_version_info.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 84 #endif | 85 #endif |
| 85 | 86 |
| 86 #if defined(OS_ANDROID) | 87 #if defined(OS_ANDROID) |
| 87 #include "sync/internal_api/public/read_transaction.h" | 88 #include "sync/internal_api/public/read_transaction.h" |
| 88 #endif | 89 #endif |
| 89 | 90 |
| 90 using browser_sync::ChangeProcessor; | 91 using browser_sync::ChangeProcessor; |
| 91 using browser_sync::DataTypeController; | 92 using browser_sync::DataTypeController; |
| 92 using browser_sync::DataTypeManager; | 93 using browser_sync::DataTypeManager; |
| 93 using browser_sync::FailedDataTypesHandler; | 94 using browser_sync::FailedDataTypesHandler; |
| 95 using browser_sync::NotificationServiceSessionsRouter; | |
| 94 using browser_sync::SyncBackendHost; | 96 using browser_sync::SyncBackendHost; |
| 95 using syncer::ModelType; | 97 using syncer::ModelType; |
| 96 using syncer::ModelTypeSet; | 98 using syncer::ModelTypeSet; |
| 97 using syncer::JsBackend; | 99 using syncer::JsBackend; |
| 98 using syncer::JsController; | 100 using syncer::JsController; |
| 99 using syncer::JsEventDetails; | 101 using syncer::JsEventDetails; |
| 100 using syncer::JsEventHandler; | 102 using syncer::JsEventHandler; |
| 101 using syncer::ModelSafeRoutingInfo; | 103 using syncer::ModelSafeRoutingInfo; |
| 102 using syncer::SyncCredentials; | 104 using syncer::SyncCredentials; |
| 103 using syncer::SyncProtocolError; | 105 using syncer::SyncProtocolError; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 // GetChannel hits the registry on Windows. See http://crbug.com/70380. | 191 // GetChannel hits the registry on Windows. See http://crbug.com/70380. |
| 190 base::ThreadRestrictions::ScopedAllowIO allow_io; | 192 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 191 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 193 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 192 if (channel == chrome::VersionInfo::CHANNEL_STABLE || | 194 if (channel == chrome::VersionInfo::CHANNEL_STABLE || |
| 193 channel == chrome::VersionInfo::CHANNEL_BETA) { | 195 channel == chrome::VersionInfo::CHANNEL_BETA) { |
| 194 sync_service_url_ = GURL(kSyncServerUrl); | 196 sync_service_url_ = GURL(kSyncServerUrl); |
| 195 } | 197 } |
| 196 | 198 |
| 197 if (CommandLine::ForCurrentProcess()->HasSwitch( | 199 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 198 switches::kEnableSyncSessionsV2)) { | 200 switches::kEnableSyncSessionsV2)) { |
| 199 sessions_sync_manager_.reset(new SessionsSyncManager(profile, this)); | 201 scoped_ptr<SessionsSyncManager::LocalEventRouter> router( |
|
rlarocque
2013/11/27 22:47:51
It looks like there's a circular dependency here.
tim (not reviewing)
2013/12/02 18:29:49
That's not quite what's happening here. The route
rlarocque
2013/12/02 18:53:53
OK, I think I understand now.
Would it be a viabl
tim (not reviewing)
2013/12/02 19:50:56
Yes, except that the goal with the Router approach
| |
| 202 new NotificationServiceSessionsRouter(profile)); | |
| 203 sessions_sync_manager_.reset( | |
| 204 new SessionsSyncManager(profile, this, router.Pass())); | |
| 200 } | 205 } |
| 201 } | 206 } |
| 202 | 207 |
| 203 ProfileSyncService::~ProfileSyncService() { | 208 ProfileSyncService::~ProfileSyncService() { |
| 204 sync_prefs_.RemoveSyncPrefObserver(this); | 209 sync_prefs_.RemoveSyncPrefObserver(this); |
| 205 // Shutdown() should have been called before destruction. | 210 // Shutdown() should have been called before destruction. |
| 206 CHECK(!backend_initialized_); | 211 CHECK(!backend_initialized_); |
| 207 } | 212 } |
| 208 | 213 |
| 209 bool ProfileSyncService::IsSyncEnabledAndLoggedIn() { | 214 bool ProfileSyncService::IsSyncEnabledAndLoggedIn() { |
| (...skipping 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2252 SyncTokenStatus status; | 2257 SyncTokenStatus status; |
| 2253 status.connection_status_update_time = connection_status_update_time_; | 2258 status.connection_status_update_time = connection_status_update_time_; |
| 2254 status.connection_status = connection_status_; | 2259 status.connection_status = connection_status_; |
| 2255 status.token_request_time = token_request_time_; | 2260 status.token_request_time = token_request_time_; |
| 2256 status.token_receive_time = token_receive_time_; | 2261 status.token_receive_time = token_receive_time_; |
| 2257 status.last_get_token_error = last_get_token_error_; | 2262 status.last_get_token_error = last_get_token_error_; |
| 2258 if (request_access_token_retry_timer_.IsRunning()) | 2263 if (request_access_token_retry_timer_.IsRunning()) |
| 2259 status.next_token_request_time = next_token_request_time_; | 2264 status.next_token_request_time = next_token_request_time_; |
| 2260 return status; | 2265 return status; |
| 2261 } | 2266 } |
| OLD | NEW |