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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/VibrationMessageFilter.java

Issue 23496051: Make VibrationMessageFilter available to other platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and added contact info for override APIs. Created 7 years, 1 month 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
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
deleted file mode 100644
index fdd58cf1d8bed7b61319303c4e671c27f7e3cbe7..0000000000000000000000000000000000000000
--- a/content/public/android/java/src/org/chromium/content/browser/VibrationMessageFilter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 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.media.AudioManager;
-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 AudioManager mAudioManager;
- private final Vibrator mVibrator;
-
- @CalledByNative
- private static VibrationMessageFilter create(Context context) {
- return new VibrationMessageFilter(context);
- }
-
- @CalledByNative
- private void vibrate(long milliseconds) {
- if (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_SILENT)
- mVibrator.vibrate(milliseconds);
- }
-
- @CalledByNative
- private void cancelVibration() {
- mVibrator.cancel();
- }
-
- private VibrationMessageFilter(Context context) {
- mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
- mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698