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

Unified Diff: device/nfc/nfc.mojom

Issue 2894373002: [DeviceService] Move //device/nfc to be part of the internal impl of Device Service (Closed)
Patch Set: Modify code comment Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java ('k') | device/nfc/nfc_provider.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/nfc/nfc.mojom
diff --git a/device/nfc/nfc.mojom b/device/nfc/nfc.mojom
deleted file mode 100644
index eb40e40203db9980f63ed01bddd0d8950fea143d..0000000000000000000000000000000000000000
--- a/device/nfc/nfc.mojom
+++ /dev/null
@@ -1,138 +0,0 @@
-// 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.
-
-// TODO(blundell): This should be moved to device.mojom.
-module device.nfc.mojom;
-
-enum NFCErrorType {
- SECURITY,
- NOT_SUPPORTED,
- DEVICE_DISABLED,
- NOT_FOUND,
- INVALID_MESSAGE,
- OPERATION_CANCELLED,
- TIMER_EXPIRED,
- CANNOT_CANCEL,
- IO_ERROR
-};
-
-enum NFCRecordType {
- EMPTY,
- TEXT,
- URL,
- JSON,
- OPAQUE_RECORD
-};
-
-enum NFCPushTarget {
- // The target of a push operation must be the NFC tag.
- TAG,
- // The target of a push operation must be the NFC peer (device to device).
- PEER,
- // The target of a push operation must be either NFC tag or peer.
- ANY
-};
-
-enum NFCWatchMode {
- // Restricts scope of the watch operation. Only Web NFC messages must be
- // used by matching algorithm.
- WEBNFC_ONLY,
- // Allows performing watch operation for all NFC messages. For example, NFC
- // tags with valid NDEF messages.
- ANY
-};
-
-struct NFCError {
- NFCErrorType error_type;
-};
-
-struct NFCRecord {
- // The type of NFCRecord.
- NFCRecordType record_type;
-
- // Represents the IANA media type of the NFCRecord data field.
- string? media_type;
-
- // Payload of the NFCRecord.
- array<uint8> data;
-};
-
-struct NFCMessage {
- // The body of the NFCMessage is a collection of NFCRecord objects.
- array<NFCRecord> data;
-
- // The |url| field is an ASCII serialized origin, optionally followed by a URL
- // path. It represents Web NFC id, that can be used for matching Web NFC
- // content with the filter specified by |url| field in NFCWatchOptions.
- string? url;
-
- // Maximum size of NFC message that can be sent over IPC is 32KB.
- const uint32 kMaxSize = 32768;
-};
-
-struct NFCPushOptions {
- // The target of the push operation.
- NFCPushTarget target;
-
- // The timeout for the push operation, in milliseconds.
- double timeout;
-
- // If the property is true, the push operation will suspend active watchers
- // until its completion.
- bool ignore_read;
-};
-
-struct NFCRecordTypeFilter {
- NFCRecordType record_type;
-};
-
-struct NFCWatchOptions {
- // Defines filtering constraint for NFC messages with specified |url|.
- string? url;
-
- // Defines filtering constraint for NFC records with specified record type.
- NFCRecordTypeFilter? record_filter;
-
- // Defines media type filtering constraint.
- string? media_type;
-
- // Defines mode of watch operation.
- NFCWatchMode mode;
-};
-
-interface NFC {
- // NFCClient interface is used to notify |client| when NFCMessage matches one
- // or more pending watch operations.
- SetClient(NFCClient client);
-
- // Pushes data to NFC device.
- // NFCPushOptions specify timeout and type of device where data should be
- // pushed. If timeout is defined and data is not pushed before timeout is
- // expired, callback with corresponding error is called.
- Push(NFCMessage message, NFCPushOptions? options) => (NFCError? error);
-
- // Cancels pending push request.
- CancelPush(NFCPushTarget target) => (NFCError? error);
-
- // Starts watching for nearby NFC devices with data that matches
- // NFCWatchOptions filtering criteria. On success, watch id is returned.
- Watch(NFCWatchOptions options) => (uint32 id, NFCError? error);
-
- // Cancels watch operation with provided id.
- CancelWatch (uint32 id) => (NFCError? error);
-
- // Cancels all watch operations.
- CancelAllWatches () => (NFCError? error);
-
- // Suspends all pending NFC operations. Could be used when web page
- // visibility or focus is lost.
- SuspendNFCOperations();
-
- // Resumes all suspended NFC operations.
- ResumeNFCOperations();
-};
-
-interface NFCClient {
- OnWatch(array<uint32> watch_ids, NFCMessage message);
-};
« no previous file with comments | « device/nfc/android/junit/src/org/chromium/device/nfc/NFCTest.java ('k') | device/nfc/nfc_provider.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698