Index: device/nfc/nfc_impl_default.cc |
diff --git a/device/nfc/nfc_impl_default.cc b/device/nfc/nfc_impl_default.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..02967460c213e0bb8a6a90a9687cb2f834c826b8 |
--- /dev/null |
+++ b/device/nfc/nfc_impl_default.cc |
@@ -0,0 +1,73 @@ |
+// Copyright 2016 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. |
+ |
+#include "device/nfc/nfc_impl.h" |
+ |
+#include "base/logging.h" |
+#include "mojo/public/cpp/bindings/strong_binding.h" |
+ |
+namespace device { |
+ |
+namespace { |
+ |
+class NFCDefaultImpl : public NFC { |
+ public: |
+ void SetClient(NFCClientPtr client) override { NOTIMPLEMENTED(); } |
+ |
+ void Push(NFCMessagePtr message, |
+ NFCPushOptionsPtr options, |
+ const PushCallback& callback) override { |
+ callback.Run(NotSupported()); |
+ NOTIMPLEMENTED(); |
+ } |
+ |
+ void CancelPush(NFCPushTarget target, |
+ const CancelPushCallback& callback) override { |
+ callback.Run(NotSupported()); |
+ NOTIMPLEMENTED(); |
+ } |
+ |
+ void Watch(NFCWatchOptionsPtr options, |
+ const WatchCallback& callback) override { |
+ callback.Run(0, NotSupported()); |
+ NOTIMPLEMENTED(); |
+ } |
+ |
+ void CancelWatch(uint32_t id, const CancelWatchCallback& callback) override { |
+ callback.Run(NotSupported()); |
+ NOTIMPLEMENTED(); |
+ } |
+ |
+ void CancelAllWatches(const CancelAllWatchesCallback& callback) override { |
+ callback.Run(NotSupported()); |
+ NOTIMPLEMENTED(); |
+ } |
+ |
+ void SuspendNFCOperations() override { NOTIMPLEMENTED(); } |
+ void ResumeNFCOperations() override { NOTIMPLEMENTED(); } |
+ |
+ private: |
+ friend NFCImpl; |
+ |
+ NFCErrorPtr NotSupported() { |
+ NFCErrorPtr error = NFCError::New(); |
+ error->error_type = NFCErrorType::NOT_SUPPORTED; |
+ return error; |
+ } |
+ |
+ explicit NFCDefaultImpl(mojo::InterfaceRequest<NFC> request) |
+ : binding_(this, std::move(request)) {} |
+ ~NFCDefaultImpl() override {} |
+ |
+ mojo::StrongBinding<NFC> binding_; |
+}; |
Reilly Grant (use Gerrit)
2016/04/25 21:48:35
Add DISALLOW_COPY_AND_ASSIGN(NFCDefaultImpl);
shalamov
2016/04/26 10:17:32
Done.
|
+ |
+} // namespace |
+ |
+// static |
+void NFCImpl::Create(mojo::InterfaceRequest<NFC> request) { |
+ new NFCDefaultImpl(std::move(request)); |
+} |
+ |
+} // namespace device |