OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WebNFCClient_h | |
6 #define WebNFCClient_h | |
7 | |
8 #include "public/platform/WebCallbacks.h" | |
9 #include "public/platform/WebPassOwnPtr.h" | |
10 | |
11 namespace blink { | |
12 | |
13 enum class WebNFCError; | |
14 struct WebNFCMessage; | |
15 class WebNFCObserver; | |
16 struct WebNFCPushOptions; | |
17 enum class WebNFCPushTarget; | |
18 struct WebNFCWatchOptions; | |
19 | |
20 // Success and failure callbacks for push, cancelPush, cancelWatch and cancelAll Watches methods. | |
21 using WebNFCCallbacks = WebCallbacks<void, const WebNFCError&>; | |
22 | |
23 // Success and failure callbacks for watch method. | |
24 using WebNFCWatchOptionsCallbacks = WebCallbacks<long, const WebNFCError&>; | |
25 | |
26 class WebNFCClient { | |
27 public: | |
28 virtual ~WebNFCClient() { } | |
29 | |
30 // Sets observer to the client so that the client can notify observer about | |
kenneth.christiansen
2015/11/30 15:35:50
s/the client/it/
s/observer/the observer/
s/watch/
shalamov
2015/12/01 07:57:53
Done.
| |
31 // triggered NFC watch. | |
32 virtual void setObserver(WebNFCObserver*) = 0; | |
33 | |
34 // NFC interface method. | |
kenneth.christiansen
2015/11/30 15:35:50
Why not just group them and write
// NFC interfac
shalamov
2015/12/01 07:57:53
Done.
| |
35 // See https://w3c.github.io/web-nfc/#the-push-method | |
36 // WebNFCCallbacks ownership is transfered to client. | |
kenneth.christiansen
2015/11/30 15:35:50
the client
shalamov
2015/12/01 07:57:53
Done.
| |
37 virtual void push(const WebNFCMessage&, const WebNFCPushOptions&, WebNFCCall backs*) = 0; | |
38 | |
39 // NFC interface method. | |
40 // See https://w3c.github.io/web-nfc/#cancelPush | |
41 // WebNFCCallbacks ownership is transfered to client. | |
42 virtual void cancelPush(const WebNFCPushTarget&, WebNFCCallbacks*) = 0; | |
43 | |
44 // NFC interface method. | |
45 // See https://w3c.github.io/web-nfc/#the-watch-method | |
46 // WebNFCWatchOptionsCallbacks ownership is transfered to client. | |
47 virtual void watch(const WebNFCWatchOptions&, WebNFCWatchOptionsCallbacks*) = 0; | |
48 | |
49 // NFC interface method. | |
50 // See https://w3c.github.io/web-nfc/#the-cancelwatch-method | |
51 // WebNFCCallbacks ownership is transfered to client. | |
52 virtual void cancelWatch(long id, WebNFCCallbacks*) = 0; | |
53 virtual void cancelAllWatches(WebNFCCallbacks*) = 0; | |
54 | |
55 // Methods that are required to implement suspended state. | |
56 // See https://w3c.github.io/web-nfc/#nfc-suspended | |
57 virtual void suspendNFCOperations() = 0; | |
58 virtual void resumeNFCOperations() = 0; | |
59 }; | |
60 | |
61 } // namespace blink | |
62 | |
63 #endif // WebNFCClient_h | |
OLD | NEW |