Index: chrome/common/extensions/api/synced_notifications_private.idl |
diff --git a/chrome/common/extensions/api/synced_notifications_private.idl b/chrome/common/extensions/api/synced_notifications_private.idl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..92af3192b16ecaec3be3211179e867081709f8d3 |
--- /dev/null |
+++ b/chrome/common/extensions/api/synced_notifications_private.idl |
@@ -0,0 +1,69 @@ |
+// Copyright 2014 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. |
+ |
+// Use chrome.syncedNotificationsPrivate API to be aware of notifications that |
+// are generated on the server. |
+[nodoc] namespace syncedNotificationsPrivate { |
not at google - send to devlin
2014/05/02 21:37:38
no need for [nodoc] if you don't add an .html file
dewittj
2014/05/03 00:07:49
Done.
|
+ |
+// Potential sync change types. |
+enum ChangeType { |
+ added, |
+ updated, |
+ deleted |
+}; |
+ |
+// Whether or not to resync all data items if the data type context changes. |
+enum RefreshRequest { |
+ refresh_needed, |
+ no_refresh |
+}; |
+ |
+enum SyncDataType { |
+ synced_notification, |
+ app_info |
+}; |
+ |
+dictionary SyncData { |
+ SyncDataType datatype; |
+ ArrayBuffer dataItem; |
+}; |
+ |
+// Datatype that represents a single sync change to a notification or an app info. |
not at google - send to devlin
2014/05/02 21:37:38
For whole file: keep IDL line length to 80 chars o
dewittj
2014/05/03 00:07:49
Done.
|
+dictionary SyncChange { |
+ SyncData data; |
+ ChangeType changeType; |
+}; |
+ |
+// Gets an array of SyncChange objects representing the current sync state. |
+callback GetInitialDataCallback = void (SyncData[] changes); |
+ |
+interface Functions { |
+ |
+ // Get all data from sync representing the current state (for use at startup). |
not at google - send to devlin
2014/05/02 21:37:38
Gets all data...
dewittj
2014/05/03 00:07:49
Done.
|
+ // This returns both Synced Notifications and AppInfos (with the datatype enum set |
+ // appropriately). |
+ static void getInitialData(GetInitialDataCallback callback); |
+ |
+ // Sending a changed (read state) notification back up to sync. To keep the sync from |
not at google - send to devlin
2014/05/02 21:37:38
Sends a changed...
dewittj
2014/05/03 00:07:49
Done.
|
+ // needing to understand the protocol, we send the whole object, not just the new read state. |
+ static void updateNotification(ArrayBuffer changedNotification); |
+ |
+ // Setting the Locale and DPI scale factor and list of sending services, encoded as a binary |
not at google - send to devlin
2014/05/02 21:37:38
Sets the locale...
dewittj
2014/05/03 00:07:49
Done.
|
+ // protobuf. Sync will persist these values for this and future sessions. |
+ static void setRenderContext(RefreshRequest refresh, |
+ ArrayBuffer dataTypeContext); |
+ |
+}; |
+ |
+interface Events { |
+ // Called by sync when we get new notifications or app infos from the server. |
+ static void onDataChanges(SyncChange[] changes); |
+ |
+ // Called by sync when sync starts up (in case it starts after the app). This is used in the race |
+ // condition where Sync starts after this chrome app so we still get starting data. |
+ static void onSyncStartup(SyncData[] data); |
+}; |
+ |
+}; |
+ |