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

Unified Diff: Source/modules/vibration/NavigatorVibration.cpp

Issue 18478003: Vibration cannot be canceled during pattern vibration. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adoptation for recently changing of NavigatorVibration. Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/vibration/NavigatorVibration.cpp
diff --git a/Source/modules/vibration/NavigatorVibration.cpp b/Source/modules/vibration/NavigatorVibration.cpp
index 05ff456debd2367b505d37ca5edcd887586c4229..987f48c2dd5e0343407916d044036ea680ea334a 100644
--- a/Source/modules/vibration/NavigatorVibration.cpp
+++ b/Source/modules/vibration/NavigatorVibration.cpp
@@ -85,6 +85,7 @@ bool NavigatorVibration::vibrate(const VibrationPattern& pattern)
}
m_timerStart.startOneShot(0);
+ m_isVibrating = true;
return true;
}
@@ -103,7 +104,6 @@ void NavigatorVibration::timerStartFired(Timer<NavigatorVibration>* timer)
ASSERT_UNUSED(timer, timer == &m_timerStart);
if (m_pattern.size()) {
- m_isVibrating = true;
WebKit::Platform::current()->vibrate(m_pattern[0]);
m_timerStop.startOneShot(m_pattern[0] / 1000.0);
m_pattern.remove(0);
@@ -114,7 +114,8 @@ void NavigatorVibration::timerStopFired(Timer<NavigatorVibration>* timer)
{
ASSERT_UNUSED(timer, timer == &m_timerStop);
- m_isVibrating = false;
+ if (!m_pattern.size())
+ m_isVibrating = false;
if (m_pattern.size()) {
m_timerStart.startOneShot(m_pattern[0] / 1000.0);
« Source/core/testing/Internals.cpp ('K') | « Source/modules/vibration/NavigatorVibration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698