Chromium Code Reviews| Index: content/renderer/renderer_webkitplatformsupport_impl.cc |
| diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc |
| index 850166d7663cb5613989f4815c289979a8a2334f..193e33d430c8cb7234823e16cdd46e07c6885869 100644 |
| --- a/content/renderer/renderer_webkitplatformsupport_impl.cc |
| +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc |
| @@ -35,6 +35,7 @@ |
| #include "content/common/mime_registry_messages.h" |
| #include "content/common/view_messages.h" |
| #include "content/public/common/content_switches.h" |
| +#include "content/public/common/service_registry.h" |
| #include "content/public/common/webplugininfo.h" |
| #include "content/public/renderer/content_renderer_client.h" |
| #include "content/renderer/battery_status/battery_status_dispatcher.h" |
| @@ -1036,12 +1037,16 @@ void RendererWebKitPlatformSupportImpl::SetMockDeviceOrientationDataForTesting( |
| //------------------------------------------------------------------------------ |
| void RendererWebKitPlatformSupportImpl::vibrate(unsigned int milliseconds) { |
| - RenderThread::Get()->Send( |
| - new ViewHostMsg_Vibrate(base::checked_cast<int64>(milliseconds))); |
| + if (!vibration_manager_) { |
| + RenderThread::Get()->GetServiceRegistry() |
| + ->ConnectToRemoteService(&vibration_manager_); |
| + } |
| + vibration_manager_->Vibrate(milliseconds); |
|
Michael van Ouwerkerk
2014/09/29 12:55:19
Why did you omit the cast?
timvolodine
2014/10/03 15:57:14
I've put it back. Done.
|
| } |
| void RendererWebKitPlatformSupportImpl::cancelVibration() { |
| - RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); |
| + if (vibration_manager_) |
|
Michael van Ouwerkerk
2014/09/29 12:55:19
Why isn't one instantiated when needed? A vibratio
timvolodine
2014/10/03 15:57:14
good point. Done.
|
| + vibration_manager_->Cancel(); |
| } |
| //------------------------------------------------------------------------------ |