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

Unified Diff: device/nfc/nfc.mojom

Issue 1486033002: [webnfc] Introduce NFC mojo service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dependency from content / browser Created 5 years 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 | « device/nfc/nfc.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/nfc/nfc.mojom
diff --git a/device/nfc/nfc.mojom b/device/nfc/nfc.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..72b3e9eae3462a6a8d077e0b2b6e0d7c4e72e6d8
--- /dev/null
+++ b/device/nfc/nfc.mojom
@@ -0,0 +1,83 @@
+// Copyright 2015 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.
+
+module device;
+
+enum NFCErrorType {
+ SECURITY,
+ NOT_SUPPORTED,
+ DEVICE_DISABLED,
+ NOT_FOUND,
+ INVALID_MESSAGE,
+ OPERATION_CANCELLED,
+ TIMER_EXPIRED,
+ CANNOT_CANCEL,
+ IO_ERROR
+};
+
+enum NFCRecordType {
+ EMPTY,
+ TEXT,
+ URL,
+ JSON,
+ OPAQUE
+};
+
+enum NFCPushTarget {
+ TAG,
+ PEER,
+ ANY
+};
+
+enum NFCWatchMode {
+ WEBNFC_ONLY,
+ ANY
+};
+
+struct NFCError {
+ NFCErrorType error_type;
+};
+
+struct NFCRecord {
+ NFCRecordType recordType;
+ string? mediaType;
+ array<uint8> data;
+};
+
+struct NFCMessage {
+ array<NFCRecord> data;
+ string? url;
+};
+
+struct NFCPushOptions {
+ NFCPushTarget target;
+ double timeout;
+ bool ignoreRead;
+};
+
+struct NFCRecordTypeFilter {
+ NFCRecordType recordType;
+};
+
+struct NFCWatchOptions {
+ string? url;
+ NFCRecordTypeFilter? recordFilter;
+ string? mediaType;
+ NFCWatchMode mode;
+};
+
+interface NFC {
+ SetClient(NFCClient client);
+ Push(NFCMessage message, NFCPushOptions? options) => (NFCError? error);
+ CancelPush(NFCPushTarget target) => (NFCError? error);
+ Watch(NFCWatchOptions options) => (uint32 id, NFCError? error);
+ CancelWatch (uint32 id) => (NFCError? error);
+ CancelAllWatches () => (NFCError? error);
+ SuspendNFCOperations();
+ ResumeNFCOperations();
+};
+
+interface NFCClient {
+ OnWatch(uint32 id, NFCMessage message);
+};
« no previous file with comments | « device/nfc/nfc.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698