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

Side by Side Diff: third_party/WebKit/public/platform/modules/nfc/WebNFCWatchOptions.h

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 | « third_party/WebKit/public/platform/modules/nfc/WebNFCPushTarget.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 WebNFCWatchOptions_h
6 #define WebNFCWatchOptions_h
7
8 #include "public/platform/WebString.h"
9
10 namespace blink {
11
12 enum class WebNFCRecordType;
13
14 // Enumeration that is mapped to NFCWatchMode as specified in IDL.
15 enum class WebNFCWatchMode {
16 WebNFCOnly,
17 Any,
18 ENUM_MAX_VALUE = Any
19 };
20
21 // Helper wrapper that is used to represent filter for all types of NFC records.
22 class WebNFCRecordTypeFilter final {
23 public:
24 WebNFCRecordTypeFilter() : m_matchAnyRecord(true) { }
25 explicit WebNFCRecordTypeFilter(const WebNFCRecordType& recordType) :
26 m_matchAnyRecord(false), m_recordType(recordType) { }
27
28 bool matchAnyRecord() const { return m_matchAnyRecord; }
29 WebNFCRecordType recordType() const { return m_recordType; }
30
31 private:
32 bool m_matchAnyRecord;
33 WebNFCRecordType m_recordType;
34 };
35
36 // Contains members of NFCWatchOptions dictionary as specified in the IDL.
37 struct WebNFCWatchOptions {
38 WebNFCWatchOptions(const WebString& url = "", const WebNFCRecordTypeFilter& recordFilter = WebNFCRecordTypeFilter(),
39 const WebString& mediaType = "", const WebNFCWatchMode& mode = WebNFCWat chMode::WebNFCOnly)
40 : url(url)
41 , recordFilter(recordFilter)
42 , mediaType(mediaType)
43 , mode(mode)
44 {
45 }
46
47 WebString url;
48 WebNFCRecordTypeFilter recordFilter;
49 WebString mediaType;
50 WebNFCWatchMode mode;
51 };
52
53 } // namespace blink
54
55 #endif // WebNFCWatchOptions_h
OLDNEW
« 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