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

Unified Diff: third_party/WebKit/public/platform/modules/nfc/WebNFCWatchOptions.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
« no previous file with comments | « third_party/WebKit/public/platform/modules/nfc/WebNFCPushTarget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/modules/nfc/WebNFCWatchOptions.h
diff --git a/third_party/WebKit/public/platform/modules/nfc/WebNFCWatchOptions.h b/third_party/WebKit/public/platform/modules/nfc/WebNFCWatchOptions.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ac0cfaf949510dc62bfdd9ca8a70a07a6597ebf
--- /dev/null
+++ b/third_party/WebKit/public/platform/modules/nfc/WebNFCWatchOptions.h
@@ -0,0 +1,55 @@
+// 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 WebNFCWatchOptions_h
+#define WebNFCWatchOptions_h
+
+#include "public/platform/WebString.h"
+
+namespace blink {
+
+enum class WebNFCRecordType;
+
+// Enumeration that is mapped to NFCWatchMode as specified in IDL.
+enum class WebNFCWatchMode {
+ WebNFCOnly,
+ Any,
+ ENUM_MAX_VALUE = Any
+};
+
+// Helper wrapper that is used to represent filter for all types of NFC records.
+class WebNFCRecordTypeFilter final {
+public:
+ WebNFCRecordTypeFilter() : m_matchAnyRecord(true) { }
+ explicit WebNFCRecordTypeFilter(const WebNFCRecordType& recordType) :
+ m_matchAnyRecord(false), m_recordType(recordType) { }
+
+ bool matchAnyRecord() const { return m_matchAnyRecord; }
+ WebNFCRecordType recordType() const { return m_recordType; }
+
+private:
+ bool m_matchAnyRecord;
+ WebNFCRecordType m_recordType;
+};
+
+// Contains members of NFCWatchOptions dictionary as specified in the IDL.
+struct WebNFCWatchOptions {
+ WebNFCWatchOptions(const WebString& url = "", const WebNFCRecordTypeFilter& recordFilter = WebNFCRecordTypeFilter(),
+ const WebString& mediaType = "", const WebNFCWatchMode& mode = WebNFCWatchMode::WebNFCOnly)
+ : url(url)
+ , recordFilter(recordFilter)
+ , mediaType(mediaType)
+ , mode(mode)
+ {
+ }
+
+ WebString url;
+ WebNFCRecordTypeFilter recordFilter;
+ WebString mediaType;
+ WebNFCWatchMode mode;
+};
+
+} // namespace blink
+
+#endif // WebNFCWatchOptions_h
« no previous file with comments | « third_party/WebKit/public/platform/modules/nfc/WebNFCPushTarget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698