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

Unified Diff: device/nfc/nfc.mojom

Issue 1708543002: [webnfc] Implement push() method in blink nfc module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onionsoup_webnfc
Patch Set: Move dependency from content_browsertests to layouttest_support_content Created 4 years, 6 months 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') | third_party/WebKit/LayoutTests/nfc/mock-nfc.html » ('j') | 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
index 6ba8b7a1ad72449bed2c27c18dc09fdfdc902f4f..1caea1b4f5220d7f9d6076d200b9f4bec173a253 100644
--- a/device/nfc/nfc.mojom
+++ b/device/nfc/nfc.mojom
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-module device;
+module device.nfc;
enum NFCErrorType {
SECURITY,
@@ -68,16 +68,37 @@ struct NFCWatchOptions {
};
interface NFC {
+ // NFCClient interface is used to notify |client| when NFCMessage matches one
+ // or more pending watch operations.
SetClient(NFCClient client);
+
+ // Pushes data to NFC device.
+ // NFCPushOptions specify timeout and type of device where data should be
+ // pushed. If timeout is defined and data is not pushed before timeout is
+ // expired, callback with corresponding error is called.
Push(NFCMessage message, NFCPushOptions? options) => (NFCError? error);
+
+ // Cancels pending push request.
CancelPush(NFCPushTarget target) => (NFCError? error);
+
+ // Starts watching for nearby NFC devices with data that matches
+ // NFCWatchOptions filtering criteria. On success, watch ID is returned.
Watch(NFCWatchOptions options) => (uint32 id, NFCError? error);
+
+ // Cancels watch operation with provided id.
CancelWatch (uint32 id) => (NFCError? error);
+
+ // Cancels all watch operations.
CancelAllWatches () => (NFCError? error);
+
+ // Suspends all pending NFC operations. Could be used when web page
+ // visibility or focus is lost.
SuspendNFCOperations();
+
+ // Resumes all suspended NFC operations.
ResumeNFCOperations();
};
interface NFCClient {
- OnWatch(uint32 id, NFCMessage message);
-};
+ OnWatch(array<uint32> watchIDs, NFCMessage message);
+};
« no previous file with comments | « device/nfc/nfc.gyp ('k') | third_party/WebKit/LayoutTests/nfc/mock-nfc.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698