Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 1418513005: [sync] Set up notification-free infra for triggering local sync refresh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 1681
1682 bool ProfileSyncService::IsSyncAllowed() const { 1682 bool ProfileSyncService::IsSyncAllowed() const {
1683 return IsSyncAllowedByFlag() && !IsManaged(); 1683 return IsSyncAllowedByFlag() && !IsManaged();
1684 } 1684 }
1685 1685
1686 bool ProfileSyncService::IsSyncActive() const { 1686 bool ProfileSyncService::IsSyncActive() const {
1687 return backend_initialized_ && backend_mode_ == SYNC && data_type_manager_ && 1687 return backend_initialized_ && backend_mode_ == SYNC && data_type_manager_ &&
1688 data_type_manager_->state() != DataTypeManager::STOPPED; 1688 data_type_manager_->state() != DataTypeManager::STOPPED;
1689 } 1689 }
1690 1690
1691 void ProfileSyncService::TriggerRefresh(const syncer::ModelTypeSet& types) {
1692 if (backend_initialized_)
1693 backend_->TriggerRefresh(types);
1694 }
1695
1691 bool ProfileSyncService::IsSignedIn() const { 1696 bool ProfileSyncService::IsSignedIn() const {
1692 // Sync is logged in if there is a non-empty effective account id. 1697 // Sync is logged in if there is a non-empty effective account id.
1693 return !signin_->GetAccountIdToUse().empty(); 1698 return !signin_->GetAccountIdToUse().empty();
1694 } 1699 }
1695 1700
1696 bool ProfileSyncService::IsBackendInitialized() const { 1701 bool ProfileSyncService::IsBackendInitialized() const {
1697 return backend_initialized_; 1702 return backend_initialized_;
1698 } 1703 }
1699 1704
1700 ProfileSyncService::BackendMode ProfileSyncService::backend_mode() const { 1705 ProfileSyncService::BackendMode ProfileSyncService::backend_mode() const {
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
2734 } 2739 }
2735 2740
2736 std::string ProfileSyncService::unrecoverable_error_message() const { 2741 std::string ProfileSyncService::unrecoverable_error_message() const {
2737 return unrecoverable_error_message_; 2742 return unrecoverable_error_message_;
2738 } 2743 }
2739 2744
2740 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() 2745 tracked_objects::Location ProfileSyncService::unrecoverable_error_location()
2741 const { 2746 const {
2742 return unrecoverable_error_location_; 2747 return unrecoverable_error_location_;
2743 } 2748 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698