OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file defines the "sync API", an interface to the syncer | 5 // This file defines the "sync API", an interface to the syncer |
6 // backend that exposes (1) the core functionality of maintaining a consistent | 6 // backend that exposes (1) the core functionality of maintaining a consistent |
7 // local snapshot of a hierarchical object set; (2) a means to transactionally | 7 // local snapshot of a hierarchical object set; (2) a means to transactionally |
8 // access and modify those objects; (3) a means to control client/server | 8 // access and modify those objects; (3) a means to control client/server |
9 // synchronization tasks, namely: pushing local object modifications to a | 9 // synchronization tasks, namely: pushing local object modifications to a |
10 // server, pulling nonlocal object modifications from a server to this client, | 10 // server, pulling nonlocal object modifications from a server to this client, |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 // onNotificationStateChange({ enabled: (boolean) }): | 964 // onNotificationStateChange({ enabled: (boolean) }): |
965 // Sent when notifications are enabled or disabled. | 965 // Sent when notifications are enabled or disabled. |
966 // | 966 // |
967 // onIncomingNotification({ changedTypes: (array) }): | 967 // onIncomingNotification({ changedTypes: (array) }): |
968 // Sent when an incoming notification arrives. |changedTypes| | 968 // Sent when an incoming notification arrives. |changedTypes| |
969 // is a list of sync types (strings) which have changed. | 969 // is a list of sync types (strings) which have changed. |
970 // | 970 // |
971 // The following messages are processed by the returned backend: | 971 // The following messages are processed by the returned backend: |
972 // | 972 // |
973 // getNotificationState(): | 973 // getNotificationState(): |
974 // If there is a parent router, sends the | 974 // callback(boolean notificationsEnabled): |
975 // onGetNotificationStateFinished(boolean notificationsEnabled) | 975 // notificationsEnabled: whether or not notifications are |
976 // event to |sender| via the parent router with whether or not | 976 // enabled. |
977 // notifications are enabled. | |
978 // | 977 // |
979 // getRootNode(): | 978 // getRootNode(): |
980 // If there is a parent router, sends the | 979 // callback(dictionary nodeInfo): |
981 // onGetRootNodeFinished(dictionary nodeInfo) event to |sender| | 980 // nodeInfo: Information on the root node. |
982 // via the parent router with information on the root node. | |
983 // | 981 // |
984 // getNodeById(string id): | 982 // getNodesById(array idList): |
985 // If there is a parent router, sends the | 983 // idList: A list of IDs as strings. |
986 // onGetNodeByIdFinished(dictionary nodeInfo) event to |sender| | 984 // callback(array nodeList): |
987 // via the parent router with information on the node with the | 985 // nodeList: Information on each node for each valid id in |
988 // given id (metahandle), if the id is valid and a node with that | 986 // idList. Not guaranteed to be in any order. |
989 // id exists. Otherwise, calls onGetNodeByIdFinished(null). | 987 // |
| 988 // getChildNodeIds(string id): |
| 989 // id: The id of the node for which to return the child node ids. |
| 990 // callback(array idList): |
| 991 // idList: The child node IDs of the node with the given id. |
990 // | 992 // |
991 // All other messages are dropped. | 993 // All other messages are dropped. |
992 browser_sync::JsBackend* GetJsBackend(); | 994 browser_sync::JsBackend* GetJsBackend(); |
993 | 995 |
994 // Status-related getters. Typically GetStatusSummary will suffice, but | 996 // Status-related getters. Typically GetStatusSummary will suffice, but |
995 // GetDetailedSyncStatus can be useful for gathering debug-level details of | 997 // GetDetailedSyncStatus can be useful for gathering debug-level details of |
996 // the internals of the sync engine. | 998 // the internals of the sync engine. |
997 Status::Summary GetStatusSummary() const; | 999 Status::Summary GetStatusSummary() const; |
998 Status GetDetailedStatus() const; | 1000 Status GetDetailedStatus() const; |
999 | 1001 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 private: | 1033 private: |
1032 // An opaque pointer to the nested private class. | 1034 // An opaque pointer to the nested private class. |
1033 SyncInternal* data_; | 1035 SyncInternal* data_; |
1034 | 1036 |
1035 DISALLOW_COPY_AND_ASSIGN(SyncManager); | 1037 DISALLOW_COPY_AND_ASSIGN(SyncManager); |
1036 }; | 1038 }; |
1037 | 1039 |
1038 } // namespace sync_api | 1040 } // namespace sync_api |
1039 | 1041 |
1040 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 1042 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
OLD | NEW |