OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ios/chrome/browser/sync/sync_observer_bridge.h" | 5 #include "ios/chrome/browser/sync/sync_observer_bridge.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "components/sync/driver/sync_service.h" | 8 #include "components/sync/driver/sync_service.h" |
9 | 9 |
10 SyncObserverBridge::SyncObserverBridge(id<SyncObserverModelBridge> delegate, | 10 SyncObserverBridge::SyncObserverBridge(id<SyncObserverModelBridge> delegate, |
11 sync_driver::SyncService* sync_service) | 11 syncer::SyncService* sync_service) |
12 : delegate_(delegate), scoped_observer_(this) { | 12 : delegate_(delegate), scoped_observer_(this) { |
13 DCHECK(delegate); | 13 DCHECK(delegate); |
14 if (sync_service) | 14 if (sync_service) |
15 scoped_observer_.Add(sync_service); | 15 scoped_observer_.Add(sync_service); |
16 } | 16 } |
17 | 17 |
18 SyncObserverBridge::~SyncObserverBridge() { | 18 SyncObserverBridge::~SyncObserverBridge() { |
19 } | 19 } |
20 | 20 |
21 void SyncObserverBridge::OnStateChanged() { | 21 void SyncObserverBridge::OnStateChanged() { |
22 [delegate_ onSyncStateChanged]; | 22 [delegate_ onSyncStateChanged]; |
23 } | 23 } |
24 | 24 |
25 void SyncObserverBridge::OnSyncConfigurationCompleted() { | 25 void SyncObserverBridge::OnSyncConfigurationCompleted() { |
26 if ([delegate_ respondsToSelector:@selector(onSyncConfigurationCompleted:)]) | 26 if ([delegate_ respondsToSelector:@selector(onSyncConfigurationCompleted:)]) |
27 [delegate_ onSyncConfigurationCompleted]; | 27 [delegate_ onSyncConfigurationCompleted]; |
28 } | 28 } |
OLD | NEW |