summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/nfc/nfc_utils.h
blob: 72e2282ad3cc3b441a77c760b39bf64d2b39a3c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2019 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 THIRD_PARTY_BLINK_RENDERER_MODULES_NFC_NFC_UTILS_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_NFC_NFC_UTILS_H_

#include "services/device/public/mojom/nfc.mojom-blink-forward.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/modules/nfc/ndef_message.h"
#include "third_party/blink/renderer/modules/nfc/ndef_record.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

namespace blink {

class DOMException;

size_t GetNDEFMessageSize(const device::mojom::blink::NDEFMessage& message);

bool SetNDEFMessageURL(const String& origin,
                       device::mojom::blink::NDEFMessage* message);

device::mojom::blink::NDEFPushTarget StringToNDEFPushTarget(
    const WTF::String& target);

DOMException* NDEFErrorTypeToDOMException(
    device::mojom::blink::NDEFErrorType error_type);

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_NFC_NFC_UTILS_H_