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

Side by Side Diff: components/sync_driver/sync_error_controller.cc

Issue 1272713002: [Sync] Move sync error controller to sync driver component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN Created 5 years, 4 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
« no previous file with comments | « components/sync_driver/sync_error_controller.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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/sync_error_controller.h" 5 #include "components/sync_driver/sync_error_controller.h"
6 6
7 #include "chrome/browser/sync/profile_sync_service.h" 7 #include "components/sync_driver/sync_service.h"
8 #include "chrome/browser/sync/profile_sync_service_factory.h"
9 8
10 SyncErrorController::SyncErrorController(ProfileSyncService* service) 9 SyncErrorController::SyncErrorController(sync_driver::SyncService* service)
11 : service_(service) { 10 : service_(service) {
12 DCHECK(service_); 11 DCHECK(service_);
13 } 12 }
14 13
15 SyncErrorController::~SyncErrorController() { 14 SyncErrorController::~SyncErrorController() {
16 } 15 }
17 16
18 bool SyncErrorController::HasError() { 17 bool SyncErrorController::HasError() {
19 return service_->HasSyncSetupCompleted() && 18 return service_->HasSyncSetupCompleted() &&
20 service_->IsPassphraseRequired() && 19 service_->IsPassphraseRequired() &&
21 service_->IsPassphraseRequiredForDecryption(); 20 service_->IsPassphraseRequiredForDecryption();
22 } 21 }
23 22
24 void SyncErrorController::AddObserver(Observer* observer) { 23 void SyncErrorController::AddObserver(Observer* observer) {
25 observer_list_.AddObserver(observer); 24 observer_list_.AddObserver(observer);
26 } 25 }
27 26
28 void SyncErrorController::RemoveObserver(Observer* observer) { 27 void SyncErrorController::RemoveObserver(Observer* observer) {
29 observer_list_.RemoveObserver(observer); 28 observer_list_.RemoveObserver(observer);
30 } 29 }
31 30
32 void SyncErrorController::OnStateChanged() { 31 void SyncErrorController::OnStateChanged() {
33 FOR_EACH_OBSERVER(Observer, 32 FOR_EACH_OBSERVER(Observer,
34 observer_list_, 33 observer_list_,
35 OnErrorChanged()); 34 OnErrorChanged());
36 } 35 }
OLDNEW
« no previous file with comments | « components/sync_driver/sync_error_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698