1 // Copyright (c) 2012 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 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_OBSERVER_H_
6 #define COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_OBSERVER_H_
8 namespace sync_driver
{
10 // Various UI components such as the New Tab page can be driven by observing
11 // the SyncService through this interface.
12 class SyncServiceObserver
{
14 // When one of the following events occurs, OnStateChanged() is called.
15 // Observers should query the service to determine what happened.
16 // - We initialized successfully.
17 // - The sync servers are unavailable at this time.
18 // - Credentials are now in flight for authentication.
19 // - The data type configuration has started or ended.
21 // - Sync errors (passphrase, auth, unrecoverable, actionable, etc.).
22 // - Encryption changes.
23 virtual void OnStateChanged() = 0;
25 // If a client wishes to handle sync cycle completed events in a special way,
26 // they can use this function. By default, it re-routes to OnStateChanged().
27 virtual void OnSyncCycleCompleted();
30 virtual ~SyncServiceObserver() {}
33 } // namespace sync_driver
35 #endif // COMPONENTS_SYNC_DRIVER_SYNC_SERVICE_OBSERVER_H_