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

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

Issue 16781002: Vibration API: plumbing from Blink to Java. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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
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 @JNINamespace("content")
14 class VibrationService {
15
16 private Vibrator mVibrator;
Peter Beverloo 2013/06/13 11:27:45 This can be final.
Michael van Ouwerkerk 2013/06/18 14:39:23 Done.
17
18 @CalledByNative
19 public static VibrationService create(Context context) {
20 return new VibrationService(context);
21 }
22
23 @CalledByNative
24 public void vibrate(int time) {
25 mVibrator.vibrate(time);
26 }
27
28 @CalledByNative
29 public void cancelVibration() {
30 mVibrator.cancel();
31 }
32
33 private VibrationService(Context context) {
34 mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE );
35 }
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698