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

Unified Diff: device/nfc/nfc_adapter_factory.h

Issue 77563002: nfc: Add native NFC API definitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed clang error. Created 7 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 | « device/nfc/nfc_adapter.cc ('k') | device/nfc/nfc_adapter_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/nfc/nfc_adapter_factory.h
diff --git a/device/nfc/nfc_adapter_factory.h b/device/nfc/nfc_adapter_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..c064e1e8a412bd8aafc7277c002b4470508c0c4c
--- /dev/null
+++ b/device/nfc/nfc_adapter_factory.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2013 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 DEVICE_NFC_NFC_ADAPTER_FACTORY_H_
+#define DEVICE_NFC_NFC_ADAPTER_FACTORY_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "device/nfc/nfc_adapter.h"
+
+namespace device {
+
+// NfcAdapterFactory is a class that contains static methods, which
+// instantiate either a specific NFC adapter, or the generic "default
+// adapter" which may change depending on availability.
+class NfcAdapterFactory {
+ public:
+ typedef base::Callback<void(scoped_refptr<NfcAdapter>)> AdapterCallback;
+
+ // Returns true if NFC is available for the current platform.
+ static bool IsNfcAvailable();
+
+ // Returns the shared instance of the default adapter, creating and
+ // initializing it if necessary. |callback| is called with the adapter
+ // instance passed only once the adapter is fully initialized and ready to
+ // use.
+ static void GetAdapter(const AdapterCallback& callback);
+};
+
+} // namespace device
+
+#endif // DEVICE_NFC_NFC_ADAPTER_FACTORY_H_
« no previous file with comments | « device/nfc/nfc_adapter.cc ('k') | device/nfc/nfc_adapter_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698