| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdint.h> |
| 6 #include <utility> |
| 7 |
| 5 #include "device/vibration/vibration_manager_impl.h" | 8 #include "device/vibration/vibration_manager_impl.h" |
| 6 | |
| 7 #include <stdint.h> | |
| 8 | |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" | 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 10 | 10 |
| 11 namespace device { | 11 namespace device { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 class VibrationManagerEmptyImpl : public VibrationManager { | 15 class VibrationManagerEmptyImpl : public VibrationManager { |
| 16 public: | 16 public: |
| 17 void Vibrate(int64_t milliseconds) override {} | 17 void Vibrate(int64_t milliseconds) override {} |
| 18 void Cancel() override {} | 18 void Cancel() override {} |
| 19 | 19 |
| 20 private: | 20 private: |
| 21 friend VibrationManagerImpl; | 21 friend VibrationManagerImpl; |
| 22 | 22 |
| 23 explicit VibrationManagerEmptyImpl( | 23 explicit VibrationManagerEmptyImpl( |
| 24 mojo::InterfaceRequest<VibrationManager> request) | 24 mojo::InterfaceRequest<VibrationManager> request) |
| 25 : binding_(this, request.Pass()) {} | 25 : binding_(this, std::move(request)) {} |
| 26 ~VibrationManagerEmptyImpl() override {} | 26 ~VibrationManagerEmptyImpl() override {} |
| 27 | 27 |
| 28 // The binding between this object and the other end of the pipe. | 28 // The binding between this object and the other end of the pipe. |
| 29 mojo::StrongBinding<VibrationManager> binding_; | 29 mojo::StrongBinding<VibrationManager> binding_; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| 34 // static | 34 // static |
| 35 void VibrationManagerImpl::Create( | 35 void VibrationManagerImpl::Create( |
| 36 mojo::InterfaceRequest<VibrationManager> request) { | 36 mojo::InterfaceRequest<VibrationManager> request) { |
| 37 new VibrationManagerEmptyImpl(request.Pass()); | 37 new VibrationManagerEmptyImpl(std::move(request)); |
| 38 } | 38 } |
| 39 | 39 |
| 40 } // namespace device | 40 } // namespace device |
| OLD | NEW |