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

Side by Side Diff: content/browser/vibration/vibration_service_impl_android.cc

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, 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 #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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698