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

Side by Side Diff: ios/chrome/browser/sync/sync_observer_bridge.mm

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Chromeos fix Created 3 years, 10 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
OLDNEW
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 #if !defined(__has_feature) || !__has_feature(objc_arc) 10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support." 11 #error "This file requires ARC support."
12 #endif 12 #endif
13 13
14 SyncObserverBridge::SyncObserverBridge(id<SyncObserverModelBridge> delegate, 14 SyncObserverBridge::SyncObserverBridge(id<SyncObserverModelBridge> delegate,
15 syncer::SyncService* sync_service) 15 syncer::SyncService* sync_service)
16 : delegate_(delegate), scoped_observer_(this) { 16 : delegate_(delegate), scoped_observer_(this) {
17 DCHECK(delegate); 17 DCHECK(delegate);
18 if (sync_service) 18 if (sync_service)
19 scoped_observer_.Add(sync_service); 19 scoped_observer_.Add(sync_service);
20 } 20 }
21 21
22 SyncObserverBridge::~SyncObserverBridge() { 22 SyncObserverBridge::~SyncObserverBridge() {
23 } 23 }
24 24
25 void SyncObserverBridge::OnStateChanged() { 25 void SyncObserverBridge::OnStateChanged(syncer::SyncService* sync) {
26 [delegate_ onSyncStateChanged]; 26 [delegate_ onSyncStateChanged];
27 } 27 }
28 28
29 void SyncObserverBridge::OnSyncConfigurationCompleted() { 29 void SyncObserverBridge::OnSyncConfigurationCompleted(
30 syncer::SyncService* sync) {
30 if ([delegate_ respondsToSelector:@selector(onSyncConfigurationCompleted)]) 31 if ([delegate_ respondsToSelector:@selector(onSyncConfigurationCompleted)])
31 [delegate_ onSyncConfigurationCompleted]; 32 [delegate_ onSyncConfigurationCompleted];
32 } 33 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/sync/sync_observer_bridge.h ('k') | ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698