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

Unified Diff: content/browser/vibration/vibration_provider_android.cc

Issue 583663003: Vibration API : migrate to device/vibration using mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hide default service implementation, fix android_aosp Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/vibration/vibration_provider_android.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/vibration/vibration_provider_android.cc
diff --git a/content/browser/vibration/vibration_provider_android.cc b/content/browser/vibration/vibration_provider_android.cc
deleted file mode 100644
index 4694f4ea6d069eb2cb2c730573718a582b8e1626..0000000000000000000000000000000000000000
--- a/content/browser/vibration/vibration_provider_android.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 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_provider_android.h"
-
-#include <algorithm>
-
-#include "content/browser/vibration/vibration_message_filter.h"
-#include "content/common/view_messages.h"
-#include "jni/VibrationProvider_jni.h"
-#include "third_party/WebKit/public/platform/WebVibration.h"
-
-using base::android::AttachCurrentThread;
-
-namespace content {
-
-VibrationProviderAndroid::VibrationProviderAndroid() {
-}
-
-VibrationProviderAndroid::~VibrationProviderAndroid() {
-}
-
-// static
-bool VibrationProviderAndroid::Register(JNIEnv* env) {
- return RegisterNativesImpl(env);
-}
-
-void VibrationProviderAndroid::Vibrate(int64 milliseconds) {
- if (j_vibration_provider_.is_null()) {
- j_vibration_provider_.Reset(
- Java_VibrationProvider_create(
- AttachCurrentThread(),
- base::android::GetApplicationContext()));
- }
- Java_VibrationProvider_vibrate(AttachCurrentThread(),
- j_vibration_provider_.obj(),
- milliseconds);
-}
-
-void VibrationProviderAndroid::CancelVibration() {
- // If somehow a cancel message is received before this object was
- // instantiated, it means there is no current vibration anyway. Just return.
- if (j_vibration_provider_.is_null())
- return;
-
- Java_VibrationProvider_cancelVibration(AttachCurrentThread(),
- j_vibration_provider_.obj());
-}
-
-// static
-VibrationProvider* VibrationMessageFilter::CreateProvider() {
- return new VibrationProviderAndroid();
-}
-
-} // namespace content
« no previous file with comments | « content/browser/vibration/vibration_provider_android.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698