summaryrefslogtreecommitdiffstats
path: root/ios/chrome/browser/sync/sync_observer_bridge.mm
blob: 0ccb02acd1bead48d5504625656d7e2f2b744280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ios/chrome/browser/sync/sync_observer_bridge.h"

#include "base/logging.h"
#include "components/sync_driver/sync_service.h"

SyncObserverBridge::SyncObserverBridge(id<SyncObserverModelBridge> delegate,
                                       sync_driver::SyncService* sync_service)
    : delegate_(delegate), scoped_observer_(this) {
  DCHECK(delegate);
  if (sync_service)
    scoped_observer_.Add(sync_service);
}

SyncObserverBridge::~SyncObserverBridge() {
}

void SyncObserverBridge::OnStateChanged() {
  [delegate_ onSyncStateChanged];
}