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 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2432 } | 2432 } |
2433 helper->OnReceivedNodesForTypes(type_vector, empty_results.Pass()); | 2433 helper->OnReceivedNodesForTypes(type_vector, empty_results.Pass()); |
2434 } else { | 2434 } else { |
2435 backend_->GetAllNodesForTypes( | 2435 backend_->GetAllNodesForTypes( |
2436 directory_types, | 2436 directory_types, |
2437 base::Bind(&GetAllNodesRequestHelper::OnReceivedNodesForTypes, helper)); | 2437 base::Bind(&GetAllNodesRequestHelper::OnReceivedNodesForTypes, helper)); |
2438 } | 2438 } |
2439 } | 2439 } |
2440 | 2440 |
2441 bool ProfileSyncService::HasObserver( | 2441 bool ProfileSyncService::HasObserver( |
2442 ProfileSyncServiceBase::Observer* observer) const { | 2442 const ProfileSyncServiceBase::Observer* observer) const { |
2443 return observers_.HasObserver(observer); | 2443 return observers_.HasObserver(observer); |
2444 } | 2444 } |
2445 | 2445 |
2446 base::WeakPtr<syncer::JsController> ProfileSyncService::GetJsController() { | 2446 base::WeakPtr<syncer::JsController> ProfileSyncService::GetJsController() { |
2447 return sync_js_controller_.AsWeakPtr(); | 2447 return sync_js_controller_.AsWeakPtr(); |
2448 } | 2448 } |
2449 | 2449 |
2450 void ProfileSyncService::SyncEvent(SyncEventCodes code) { | 2450 void ProfileSyncService::SyncEvent(SyncEventCodes code) { |
2451 UMA_HISTOGRAM_ENUMERATION("Sync.EventCodes", code, MAX_SYNC_EVENT_CODE); | 2451 UMA_HISTOGRAM_ENUMERATION("Sync.EventCodes", code, MAX_SYNC_EVENT_CODE); |
2452 } | 2452 } |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2730 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const { | 2730 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const { |
2731 return device_info_sync_service_->GetLocalDeviceBackupTime(); | 2731 return device_info_sync_service_->GetLocalDeviceBackupTime(); |
2732 } | 2732 } |
2733 | 2733 |
2734 void ProfileSyncService::FlushDirectory() const { | 2734 void ProfileSyncService::FlushDirectory() const { |
2735 // backend_initialized_ implies backend_ isn't NULL and the manager exists. | 2735 // backend_initialized_ implies backend_ isn't NULL and the manager exists. |
2736 // If sync is not initialized yet, we fail silently. | 2736 // If sync is not initialized yet, we fail silently. |
2737 if (backend_initialized_) | 2737 if (backend_initialized_) |
2738 backend_->FlushDirectory(); | 2738 backend_->FlushDirectory(); |
2739 } | 2739 } |
OLD | NEW |