Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Unified Diff: mojo/dart/packages/mojo_services/lib/notifications/notifications.mojom.dart

Issue 1476823003: Fix notifications. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/services/notifications/interfaces/notifications.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/packages/mojo_services/lib/notifications/notifications.mojom.dart
diff --git a/mojo/dart/packages/mojo_services/lib/notifications/notifications.mojom.dart b/mojo/dart/packages/mojo_services/lib/notifications/notifications.mojom.dart
index 037ca4b85536a3454c708a4e4ccf06ff39adf98d..cceffc23ce93ef0bdcebf418f2e5fea52b7490b0 100644
--- a/mojo/dart/packages/mojo_services/lib/notifications/notifications.mojom.dart
+++ b/mojo/dart/packages/mojo_services/lib/notifications/notifications.mojom.dart
@@ -13,10 +13,13 @@ import 'package:mojo/core.dart' as core;
class NotificationData extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
- const bindings.StructDataHeader(24, 0)
+ const bindings.StructDataHeader(32, 0)
];
String title = null;
String text = null;
+ bool playSound = false;
+ bool vibrate = false;
+ bool setLights = false;
NotificationData() : super(kVersions.last.size);
@@ -61,6 +64,18 @@ class NotificationData extends bindings.Struct {
result.text = decoder0.decodeString(16, true);
}
+ if (mainDataHeader.version >= 0) {
+
+ result.playSound = decoder0.decodeBool(24, 0);
+ }
+ if (mainDataHeader.version >= 0) {
+
+ result.vibrate = decoder0.decodeBool(24, 1);
+ }
+ if (mainDataHeader.version >= 0) {
+
+ result.setLights = decoder0.decodeBool(24, 2);
+ }
return result;
}
@@ -70,18 +85,30 @@ class NotificationData extends bindings.Struct {
encoder0.encodeString(title, 8, true);
encoder0.encodeString(text, 16, true);
+
+ encoder0.encodeBool(playSound, 24, 0);
+
+ encoder0.encodeBool(vibrate, 24, 1);
+
+ encoder0.encodeBool(setLights, 24, 2);
}
String toString() {
return "NotificationData("
"title: $title" ", "
- "text: $text" ")";
+ "text: $text" ", "
+ "playSound: $playSound" ", "
+ "vibrate: $vibrate" ", "
+ "setLights: $setLights" ")";
}
Map toJson() {
Map map = new Map();
map["title"] = title;
map["text"] = text;
+ map["playSound"] = playSound;
+ map["vibrate"] = vibrate;
+ map["setLights"] = setLights;
return map;
}
}
« no previous file with comments | « no previous file | mojo/services/notifications/interfaces/notifications.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698