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