OLD | NEW |
---|---|
(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 #include "content/browser/vibration/vibration_service_impl_android.h" | |
6 | |
7 #include "jni/VibrationService_jni.h" | |
8 | |
9 using base::android::AttachCurrentThread; | |
10 | |
11 namespace content { | |
12 | |
13 VibrationServiceImplAndroid::VibrationServiceImplAndroid() { | |
14 j_vibration_service_.Reset( | |
bulach
2013/06/20 14:21:04
nit: unindent
Michael van Ouwerkerk
2013/06/20 17:34:09
Done.
| |
15 Java_VibrationService_create( | |
16 AttachCurrentThread(), | |
17 base::android::GetApplicationContext())); | |
18 } | |
19 | |
20 VibrationServiceImplAndroid::~VibrationServiceImplAndroid() { | |
21 } | |
22 | |
23 void VibrationServiceImplAndroid::Vibrate(unsigned milliseconds) { | |
24 Java_VibrationService_vibrate(AttachCurrentThread(), | |
25 j_vibration_service_.obj(), | |
26 milliseconds); | |
27 } | |
28 | |
29 void VibrationServiceImplAndroid::CancelVibration() { | |
30 Java_VibrationService_cancelVibration(AttachCurrentThread(), | |
31 j_vibration_service_.obj()); | |
32 } | |
33 | |
34 bool RegisterVibrationService(JNIEnv* env) { | |
35 return RegisterNativesImpl(env); | |
36 } | |
37 | |
38 } // namespace content | |
OLD | NEW |