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

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

Issue 16781002: Vibration API: plumbing from Blink to Java. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « content/content_jni.gypi ('k') | content/renderer/renderer_webkitplatformsupport_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.content.browser;
6
7 import android.content.Context;
8 import android.os.Vibrator;
9
10 import org.chromium.base.CalledByNative;
11 import org.chromium.base.JNINamespace;
12
13 /**
14 * This is the implementation of the C++ counterpart VibrationMessageFilter.
15 */
16 @JNINamespace("content")
17 class VibrationMessageFilter {
18
19 private final Vibrator mVibrator;
20
21 @CalledByNative
22 private static VibrationMessageFilter create(Context context) {
23 return new VibrationMessageFilter(context);
24 }
25
26 @CalledByNative
27 private void vibrate(long milliseconds) {
28 mVibrator.vibrate(milliseconds);
29 }
30
31 @CalledByNative
32 private void cancelVibration() {
33 mVibrator.cancel();
34 }
35
36 private VibrationMessageFilter(Context context) {
37 mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE );
38 }
39 }
OLDNEW
« no previous file with comments | « content/content_jni.gypi ('k') | content/renderer/renderer_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698