1c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved.
2c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// found in the LICENSE file.
4c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
5c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_SERVICE_STATE_H_
6c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_SERVICE_STATE_H_
7c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
8c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)namespace sync_file_system {
9c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
10c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// This enum is translated into syncFileSystem.ServiceStatus
11c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// (defined in chrome/common/extensions/api/sync_file_system.idl).
12c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// When you update this enum please consider updating the other enum in IDL.
13c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)enum SyncServiceState {
14c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // The sync service is up and running, or has not seen any errors yet.
15c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // The consumer of this service can make new requests while the
16c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // service is in this state.
17c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  SYNC_SERVICE_RUNNING,
18c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
19c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // The sync service is not synchronizing files because the remote service
20c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // needs to be authenticated by the user to proceed.
21c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // This state may be automatically resolved when the underlying
22c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // network condition or service condition changes.
23c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // The consumer of this service can still make new requests but
24c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // they may fail (with recoverable error code).
25c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  SYNC_SERVICE_AUTHENTICATION_REQUIRED,
26c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
27c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // The sync service is not synchronizing files because the remote service
28c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // is (temporarily) unavailable due to some recoverable errors, e.g.
29c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // network is offline, the remote service is down or not
30c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // reachable etc. More details should be given by |description| parameter
31c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // in OnSyncStateUpdated (which could contain service-specific details).
32c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  SYNC_SERVICE_TEMPORARY_UNAVAILABLE,
33c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
34c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // The sync service is disabled by configuration change or due to some
35c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // unrecoverable errors, e.g. local database corruption.
36c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // Any new requests will immediately fail when the service is in
37c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // this state.
38c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  SYNC_SERVICE_DISABLED,
39c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)};
40c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
41c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)}  // namespace sync_file_system
42c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
43c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#endif  // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_SERVICE_STATE_H_
44