Chromium Code Reviews| Index: content/browser/vibration/vibration_service_impl_android.cc |
| diff --git a/content/browser/vibration/vibration_service_impl_android.cc b/content/browser/vibration/vibration_service_impl_android.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fdbe9b52413c22316ecd3e267c788271a24dfb23 |
| --- /dev/null |
| +++ b/content/browser/vibration/vibration_service_impl_android.cc |
| @@ -0,0 +1,38 @@ |
| +// 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. |
| + |
| +#include "content/browser/vibration/vibration_service_impl_android.h" |
| + |
| +#include "jni/VibrationService_jni.h" |
| + |
| +namespace content { |
| + |
| +VibrationServiceImplAndroid::VibrationServiceImplAndroid() { |
| + java_vibration_service_.Reset( |
| + content::Java_VibrationService_create( |
|
Peter Beverloo
2013/06/13 11:27:45
nit: we're in content, the "content::" namespace p
Michael van Ouwerkerk
2013/06/18 14:39:23
Done.
|
| + base::android::AttachCurrentThread(), |
|
Peter Beverloo
2013/06/13 11:27:45
nit: you use base::android::AttachCurrentThread()
Michael van Ouwerkerk
2013/06/18 14:39:23
Done.
|
| + base::android::GetApplicationContext())); |
| +} |
| + |
| +VibrationServiceImplAndroid::~VibrationServiceImplAndroid() { |
| +} |
| + |
| +void VibrationServiceImplAndroid::Vibrate(unsigned time) { |
| + Java_VibrationService_vibrate( |
|
Peter Beverloo
2013/06/13 11:27:45
nit: indenting. You can indent this line like the
Michael van Ouwerkerk
2013/06/18 14:39:23
Done.
|
| + base::android::AttachCurrentThread(), |
| + java_vibration_service_.obj(), |
| + time); |
| +} |
| + |
| +void VibrationServiceImplAndroid::CancelVibration() { |
| + Java_VibrationService_cancelVibration( |
|
Peter Beverloo
2013/06/13 11:27:45
dito
Michael van Ouwerkerk
2013/06/18 14:39:23
Done.
|
| + base::android::AttachCurrentThread(), |
| + java_vibration_service_.obj()); |
| +} |
| + |
| +bool RegisterVibrationService(JNIEnv* env) { |
| + return RegisterNativesImpl(env); |
| +} |
| + |
| +} // namespace content |