1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/sync_driver/sync_error_controller.h"
7 #include "components/sync_driver/sync_service.h"
9 SyncErrorController::SyncErrorController(sync_driver::SyncService
* service
)
14 SyncErrorController::~SyncErrorController() {
17 bool SyncErrorController::HasError() {
18 return service_
->HasSyncSetupCompleted() &&
19 service_
->IsPassphraseRequired() &&
20 service_
->IsPassphraseRequiredForDecryption();
23 void SyncErrorController::AddObserver(Observer
* observer
) {
24 observer_list_
.AddObserver(observer
);
27 void SyncErrorController::RemoveObserver(Observer
* observer
) {
28 observer_list_
.RemoveObserver(observer
);
31 void SyncErrorController::OnStateChanged() {
32 FOR_EACH_OBSERVER(Observer
,