| 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_file_system/sync_file_system_service.h" | 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 iter != local_sync_runners_.end(); ++iter) | 571 iter != local_sync_runners_.end(); ++iter) |
| 572 local_changes += (*iter)->pending_changes(); | 572 local_changes += (*iter)->pending_changes(); |
| 573 if (local_changes == 0 && v2_remote_service_) | 573 if (local_changes == 0 && v2_remote_service_) |
| 574 v2_remote_service_->PromoteDemotedChanges(); | 574 v2_remote_service_->PromoteDemotedChanges(); |
| 575 } | 575 } |
| 576 | 576 |
| 577 void SyncFileSystemService::OnRemoteServiceStateUpdated( | 577 void SyncFileSystemService::OnRemoteServiceStateUpdated( |
| 578 RemoteServiceState state, | 578 RemoteServiceState state, |
| 579 const std::string& description) { | 579 const std::string& description) { |
| 580 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 580 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 581 util::Log(logging::LOG_INFO, FROM_HERE, | 581 util::Log(logging::LOG_VERBOSE, FROM_HERE, |
| 582 "OnRemoteServiceStateChanged: %d %s", state, description.c_str()); | 582 "OnRemoteServiceStateChanged: %d %s", state, description.c_str()); |
| 583 | 583 |
| 584 FOR_EACH_OBSERVER( | 584 FOR_EACH_OBSERVER( |
| 585 SyncEventObserver, observers_, | 585 SyncEventObserver, observers_, |
| 586 OnSyncStateUpdated(GURL(), | 586 OnSyncStateUpdated(GURL(), |
| 587 RemoteStateToSyncServiceState(state), | 587 RemoteStateToSyncServiceState(state), |
| 588 description)); | 588 description)); |
| 589 | 589 |
| 590 RunForEachSyncRunners(&SyncProcessRunner::Schedule); | 590 RunForEachSyncRunners(&SyncProcessRunner::Schedule); |
| 591 } | 591 } |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 v2_remote_service_.get())); | 763 v2_remote_service_.get())); |
| 764 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); | 764 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); |
| 765 v2_remote_service_->AddFileStatusObserver(this); | 765 v2_remote_service_->AddFileStatusObserver(this); |
| 766 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); | 766 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); |
| 767 remote_sync_runners_.push_back(v2_remote_syncer.release()); | 767 remote_sync_runners_.push_back(v2_remote_syncer.release()); |
| 768 } | 768 } |
| 769 return v2_remote_service_.get(); | 769 return v2_remote_service_.get(); |
| 770 } | 770 } |
| 771 | 771 |
| 772 } // namespace sync_file_system | 772 } // namespace sync_file_system |
| OLD | NEW |