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 "chrome/browser/sync/sync_error_controller.h"
7 #include "chrome/browser/sync/profile_sync_service.h"
8 #include "chrome/browser/sync/profile_sync_service_factory.h"
10 SyncErrorController::SyncErrorController(ProfileSyncService
* service
)
15 SyncErrorController::~SyncErrorController() {
18 bool SyncErrorController::HasError() {
19 return service_
->HasSyncSetupCompleted() &&
20 service_
->IsPassphraseRequired() &&
21 service_
->IsPassphraseRequiredForDecryption();
24 void SyncErrorController::AddObserver(Observer
* observer
) {
25 observer_list_
.AddObserver(observer
);
28 void SyncErrorController::RemoveObserver(Observer
* observer
) {
29 observer_list_
.RemoveObserver(observer
);
32 void SyncErrorController::OnStateChanged() {
33 FOR_EACH_OBSERVER(Observer
,