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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 module device; 5 module device.nfc;
6 6
7 enum NFCErrorType { 7 enum NFCErrorType {
8 SECURITY, 8 SECURITY,
9 NOT_SUPPORTED, 9 NOT_SUPPORTED,
10 DEVICE_DISABLED, 10 DEVICE_DISABLED,
11 NOT_FOUND, 11 NOT_FOUND,
12 INVALID_MESSAGE, 12 INVALID_MESSAGE,
13 OPERATION_CANCELLED, 13 OPERATION_CANCELLED,
14 TIMER_EXPIRED, 14 TIMER_EXPIRED,
15 CANNOT_CANCEL, 15 CANNOT_CANCEL,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 }; 61 };
62 62
63 struct NFCWatchOptions { 63 struct NFCWatchOptions {
64 string? url; 64 string? url;
65 NFCRecordTypeFilter? recordFilter; 65 NFCRecordTypeFilter? recordFilter;
66 string? mediaType; 66 string? mediaType;
67 NFCWatchMode mode; 67 NFCWatchMode mode;
68 }; 68 };
69 69
70 interface NFC { 70 interface NFC {
71 // NFCClient interface is used to notify |client| when NFCMessage matches one
72 // or more pending watch operations.
71 SetClient(NFCClient client); 73 SetClient(NFCClient client);
74
75 // Pushes data to NFC device.
76 // NFCPushOptions specify timeout and type of device where data should be
77 // pushed. If timeout is defined and data is not pushed before timeout is
78 // expired, callback with corresponding error is called.
72 Push(NFCMessage message, NFCPushOptions? options) => (NFCError? error); 79 Push(NFCMessage message, NFCPushOptions? options) => (NFCError? error);
80
81 // Cancels pending push request.
73 CancelPush(NFCPushTarget target) => (NFCError? error); 82 CancelPush(NFCPushTarget target) => (NFCError? error);
83
84 // Starts watching for nearby NFC devices with data that matches
85 // NFCWatchOptions filtering criteria. On success, watch ID is returned.
74 Watch(NFCWatchOptions options) => (uint32 id, NFCError? error); 86 Watch(NFCWatchOptions options) => (uint32 id, NFCError? error);
87
88 // Cancels watch operation with provided id.
75 CancelWatch (uint32 id) => (NFCError? error); 89 CancelWatch (uint32 id) => (NFCError? error);
90
91 // Cancels all watch operations.
76 CancelAllWatches () => (NFCError? error); 92 CancelAllWatches () => (NFCError? error);
93
94 // Suspends all pending NFC operations. Could be used when web page
95 // visibility or focus is lost.
77 SuspendNFCOperations(); 96 SuspendNFCOperations();
97
98 // Resumes all suspended NFC operations.
78 ResumeNFCOperations(); 99 ResumeNFCOperations();
79 }; 100 };
80 101
81 interface NFCClient { 102 interface NFCClient {
82 OnWatch(uint32 id, NFCMessage message); 103 OnWatch(array<uint32> watchIDs, NFCMessage message);
83 }; 104 };
OLDNEW
« 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