summaryrefslogtreecommitdiffstats
path: root/device/vibration/vibration_manager_impl_default.cc
blob: 02c5a01eea6025f6dfe4699ac8222674d0cf1ad2 (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
32
33
34
35
36
37
38
39
40
// Copyright 2014 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 <stdint.h>
#include <utility>

#include "device/vibration/vibration_manager_impl.h"
#include "mojo/public/cpp/bindings/strong_binding.h"

namespace device {

namespace {

class VibrationManagerEmptyImpl : public VibrationManager {
 public:
  void Vibrate(int64_t milliseconds) override {}
  void Cancel() override {}

 private:
  friend VibrationManagerImpl;

  explicit VibrationManagerEmptyImpl(
      mojo::InterfaceRequest<VibrationManager> request)
      : binding_(this, std::move(request)) {}
  ~VibrationManagerEmptyImpl() override {}

  // The binding between this object and the other end of the pipe.
  mojo::StrongBinding<VibrationManager> binding_;
};

}  // namespace

// static
void VibrationManagerImpl::Create(
    mojo::InterfaceRequest<VibrationManager> request) {
  new VibrationManagerEmptyImpl(std::move(request));
}

}  // namespace device