| 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 "components/browser_sync/profile_sync_service.h" | 5 #include "components/browser_sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 syncer::ModelType type) const { | 417 syncer::ModelType type) const { |
| 418 DataTypeController::TypeMap::const_iterator iter = | 418 DataTypeController::TypeMap::const_iterator iter = |
| 419 data_type_controllers_.find(type); | 419 data_type_controllers_.find(type); |
| 420 if (iter == data_type_controllers_.end()) { | 420 if (iter == data_type_controllers_.end()) { |
| 421 return false; | 421 return false; |
| 422 } | 422 } |
| 423 return iter->second->state() == DataTypeController::RUNNING; | 423 return iter->second->state() == DataTypeController::RUNNING; |
| 424 } | 424 } |
| 425 | 425 |
| 426 sync_sessions::OpenTabsUIDelegate* ProfileSyncService::GetOpenTabsUIDelegate() { | 426 sync_sessions::OpenTabsUIDelegate* ProfileSyncService::GetOpenTabsUIDelegate() { |
| 427 if (!IsDataTypeControllerRunning(syncer::SESSIONS)) | 427 // Although the backing data actually is of type |SESSIONS|, the desire to use |
| 428 return nullptr; | 428 // open tabs functionality is tracked by the state of the |PROXY_TABS| type. |
| 429 return sessions_sync_manager_.get(); | 429 return IsDataTypeControllerRunning(syncer::PROXY_TABS) |
| 430 ? sessions_sync_manager_.get() |
| 431 : nullptr; |
| 430 } | 432 } |
| 431 | 433 |
| 432 sync_sessions::FaviconCache* ProfileSyncService::GetFaviconCache() { | 434 sync_sessions::FaviconCache* ProfileSyncService::GetFaviconCache() { |
| 433 return sessions_sync_manager_->GetFaviconCache(); | 435 return sessions_sync_manager_->GetFaviconCache(); |
| 434 } | 436 } |
| 435 | 437 |
| 436 syncer::DeviceInfoTracker* ProfileSyncService::GetDeviceInfoTracker() const { | 438 syncer::DeviceInfoTracker* ProfileSyncService::GetDeviceInfoTracker() const { |
| 437 // One of the two should always be non-null after initialization is done. | 439 // One of the two should always be non-null after initialization is done. |
| 438 if (device_info_service_) { | 440 if (device_info_service_) { |
| 439 return device_info_service_.get(); | 441 return device_info_service_.get(); |
| (...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2525 | 2527 |
| 2526 DCHECK(startup_controller_->IsSetupInProgress()); | 2528 DCHECK(startup_controller_->IsSetupInProgress()); |
| 2527 startup_controller_->SetSetupInProgress(false); | 2529 startup_controller_->SetSetupInProgress(false); |
| 2528 | 2530 |
| 2529 if (IsBackendInitialized()) | 2531 if (IsBackendInitialized()) |
| 2530 ReconfigureDatatypeManager(); | 2532 ReconfigureDatatypeManager(); |
| 2531 NotifyObservers(); | 2533 NotifyObservers(); |
| 2532 } | 2534 } |
| 2533 | 2535 |
| 2534 } // namespace browser_sync | 2536 } // namespace browser_sync |
| OLD | NEW |