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

Unified Diff: third_party/WebKit/public/platform/modules/nfc/WebNFCClient.h

Issue 1481763005: [webnfc] Add public interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added OWNERS file 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
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..a813e7cf182befbab67ac4e0823f4256dcebece4
--- /dev/null
+++ b/third_party/WebKit/public/platform/modules/nfc/WebNFCClient.h
@@ -0,0 +1,61 @@
+// 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 it can notify the observer about
+ // triggered NFC watch events.
+ virtual void setObserver(WebNFCObserver*) = 0;
+
+ // NFC interface methods:
+
+ // See https://w3c.github.io/web-nfc/#the-push-method
+ // WebNFCCallbacks ownership is transfered to the client.
+ virtual void push(const WebNFCMessage&, const WebNFCPushOptions&, WebNFCCallbacks*) = 0;
+
+ // See https://w3c.github.io/web-nfc/#cancelPush
+ // WebNFCCallbacks ownership is transfered to the client.
+ virtual void cancelPush(const WebNFCPushTarget&, WebNFCCallbacks*) = 0;
+
+ // See https://w3c.github.io/web-nfc/#the-watch-method
+ // WebNFCWatchOptionsCallbacks ownership is transfered to the client.
+ virtual void watch(const WebNFCWatchOptions&, WebNFCWatchOptionsCallbacks*) = 0;
+
+ // See https://w3c.github.io/web-nfc/#the-cancelwatch-method
+ // WebNFCCallbacks ownership is transfered to the 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
« no previous file with comments | « third_party/WebKit/public/platform/modules/nfc/OWNERS ('k') | third_party/WebKit/public/platform/modules/nfc/WebNFCError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698