Chromium Code Reviews| Index: third_party/WebKit/public/platform/modules/nfc/WebNFCClient.h |
| diff --git a/third_party/WebKit/public/platform/modules/nfc/WebNFCClient.h b/third_party/WebKit/public/platform/modules/nfc/WebNFCClient.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c59ad3b0023eff01ff87f28421a794920a8e61d6 |
| --- /dev/null |
| +++ b/third_party/WebKit/public/platform/modules/nfc/WebNFCClient.h |
| @@ -0,0 +1,63 @@ |
| +// 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. |
| + |
| +#ifndef WebNFCClient_h |
| +#define WebNFCClient_h |
| + |
| +#include "public/platform/WebCallbacks.h" |
| +#include "public/platform/WebPassOwnPtr.h" |
| + |
| +namespace blink { |
| + |
| +enum class WebNFCError; |
| +struct WebNFCMessage; |
| +class WebNFCObserver; |
| +struct WebNFCPushOptions; |
| +enum class WebNFCPushTarget; |
| +struct WebNFCWatchOptions; |
| + |
| +// Success and failure callbacks for push, cancelPush, cancelWatch and cancelAllWatches methods. |
| +using WebNFCCallbacks = WebCallbacks<void, const WebNFCError&>; |
| + |
| +// Success and failure callbacks for watch method. |
| +using WebNFCWatchOptionsCallbacks = WebCallbacks<long, const WebNFCError&>; |
| + |
| +class WebNFCClient { |
| +public: |
| + virtual ~WebNFCClient() { } |
| + |
| + // 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.
|
| + // triggered NFC watch. |
| + virtual void setObserver(WebNFCObserver*) = 0; |
| + |
| + // 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.
|
| + // See https://w3c.github.io/web-nfc/#the-push-method |
| + // WebNFCCallbacks ownership is transfered to client. |
|
kenneth.christiansen
2015/11/30 15:35:50
the client
shalamov
2015/12/01 07:57:53
Done.
|
| + virtual void push(const WebNFCMessage&, const WebNFCPushOptions&, WebNFCCallbacks*) = 0; |
| + |
| + // NFC interface method. |
| + // See https://w3c.github.io/web-nfc/#cancelPush |
| + // WebNFCCallbacks ownership is transfered to client. |
| + virtual void cancelPush(const WebNFCPushTarget&, WebNFCCallbacks*) = 0; |
| + |
| + // NFC interface method. |
| + // See https://w3c.github.io/web-nfc/#the-watch-method |
| + // WebNFCWatchOptionsCallbacks ownership is transfered to client. |
| + virtual void watch(const WebNFCWatchOptions&, WebNFCWatchOptionsCallbacks*) = 0; |
| + |
| + // NFC interface method. |
| + // See https://w3c.github.io/web-nfc/#the-cancelwatch-method |
| + // WebNFCCallbacks ownership is transfered to client. |
| + virtual void cancelWatch(long id, WebNFCCallbacks*) = 0; |
| + virtual void cancelAllWatches(WebNFCCallbacks*) = 0; |
| + |
| + // Methods that are required to implement suspended state. |
| + // See https://w3c.github.io/web-nfc/#nfc-suspended |
| + virtual void suspendNFCOperations() = 0; |
| + virtual void resumeNFCOperations() = 0; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // WebNFCClient_h |