| Index: content/public/android/java/src/org/chromium/content/browser/VibrationMessageFilter.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/VibrationMessageFilter.java b/content/public/android/java/src/org/chromium/content/browser/VibrationMessageFilter.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..45879bde0929868984753de5a72e7c3f6780b26c
|
| --- /dev/null
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/VibrationMessageFilter.java
|
| @@ -0,0 +1,39 @@
|
| +// 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.
|
| +
|
| +package org.chromium.content.browser;
|
| +
|
| +import android.content.Context;
|
| +import android.os.Vibrator;
|
| +
|
| +import org.chromium.base.CalledByNative;
|
| +import org.chromium.base.JNINamespace;
|
| +
|
| +/**
|
| + * This is the implementation of the C++ counterpart VibrationMessageFilter.
|
| + */
|
| +@JNINamespace("content")
|
| +class VibrationMessageFilter {
|
| +
|
| + private final Vibrator mVibrator;
|
| +
|
| + @CalledByNative
|
| + private static VibrationMessageFilter create(Context context) {
|
| + return new VibrationMessageFilter(context);
|
| + }
|
| +
|
| + @CalledByNative
|
| + private void vibrate(long milliseconds) {
|
| + mVibrator.vibrate(milliseconds);
|
| + }
|
| +
|
| + @CalledByNative
|
| + private void cancelVibration() {
|
| + mVibrator.cancel();
|
| + }
|
| +
|
| + private VibrationMessageFilter(Context context) {
|
| + mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
| + }
|
| +}
|
|
|