| 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 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 | 1680 |
| 1681 bool ProfileSyncService::IsSyncAllowed() const { | 1681 bool ProfileSyncService::IsSyncAllowed() const { |
| 1682 return IsSyncAllowedByFlag() && !IsManaged(); | 1682 return IsSyncAllowedByFlag() && !IsManaged(); |
| 1683 } | 1683 } |
| 1684 | 1684 |
| 1685 bool ProfileSyncService::IsSyncActive() const { | 1685 bool ProfileSyncService::IsSyncActive() const { |
| 1686 return backend_initialized_ && backend_mode_ == SYNC && data_type_manager_ && | 1686 return backend_initialized_ && backend_mode_ == SYNC && data_type_manager_ && |
| 1687 data_type_manager_->state() != DataTypeManager::STOPPED; | 1687 data_type_manager_->state() != DataTypeManager::STOPPED; |
| 1688 } | 1688 } |
| 1689 | 1689 |
| 1690 void ProfileSyncService::TriggerRefresh(const syncer::ModelTypeSet& types) { |
| 1691 if (backend_initialized_) |
| 1692 backend_->TriggerRefresh(types); |
| 1693 } |
| 1694 |
| 1690 bool ProfileSyncService::IsSignedIn() const { | 1695 bool ProfileSyncService::IsSignedIn() const { |
| 1691 // Sync is logged in if there is a non-empty effective account id. | 1696 // Sync is logged in if there is a non-empty effective account id. |
| 1692 return !signin_->GetAccountIdToUse().empty(); | 1697 return !signin_->GetAccountIdToUse().empty(); |
| 1693 } | 1698 } |
| 1694 | 1699 |
| 1695 bool ProfileSyncService::IsBackendInitialized() const { | 1700 bool ProfileSyncService::IsBackendInitialized() const { |
| 1696 return backend_initialized_; | 1701 return backend_initialized_; |
| 1697 } | 1702 } |
| 1698 | 1703 |
| 1699 ProfileSyncService::BackendMode ProfileSyncService::backend_mode() const { | 1704 ProfileSyncService::BackendMode ProfileSyncService::backend_mode() const { |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2733 } | 2738 } |
| 2734 | 2739 |
| 2735 std::string ProfileSyncService::unrecoverable_error_message() const { | 2740 std::string ProfileSyncService::unrecoverable_error_message() const { |
| 2736 return unrecoverable_error_message_; | 2741 return unrecoverable_error_message_; |
| 2737 } | 2742 } |
| 2738 | 2743 |
| 2739 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() | 2744 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() |
| 2740 const { | 2745 const { |
| 2741 return unrecoverable_error_location_; | 2746 return unrecoverable_error_location_; |
| 2742 } | 2747 } |
| OLD | NEW |