Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 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 #ifndef CONTENT_BROWSER_VIBRATION_MESSAGE_FILTER_H_ | |
| 6 #define CONTENT_BROWSER_VIBRATION_MESSAGE_FILTER_H_ | |
| 7 | |
| 8 #include "content/public/browser/browser_message_filter.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 class CONTENT_EXPORT VibrationMessageFilter | |
| 13 : public BrowserMessageFilter { | |
| 14 public: | |
| 15 VibrationMessageFilter(); | |
|
Peter Beverloo
2013/09/13 16:14:12
If the Create() method is static, then the constru
| |
| 16 | |
| 17 // Create instance of VibrationMessageFilter. | |
|
Peter Beverloo
2013/09/13 16:14:12
"Create a platform-specific instance of the Vibrat
| |
| 18 // Returns NULL if factory is not set (default implementation on android). | |
| 19 static VibrationMessageFilter* Create(); | |
| 20 | |
| 21 // Sets the VibrationMessageFilter factory function. | |
| 22 typedef VibrationMessageFilter* Factory(); | |
|
Peter Beverloo
2013/09/13 16:14:12
I'm not too fussed about this. Like I asked earli
| |
| 23 static void SetFactory(Factory* factory); | |
| 24 | |
| 25 protected: | |
| 26 // Device should start vibrating for N milliseconds. | |
|
Peter Beverloo
2013/09/13 16:14:12
nit: I'd prefer it if this could be written as "vi
| |
| 27 virtual void OnVibrate(int64 milliseconds) = 0; | |
| 28 // Cancels vibration of the device. | |
|
Peter Beverloo
2013/09/13 16:14:12
nit: empty line above here, perhaps?
| |
| 29 virtual void OnCancelVibration() = 0; | |
| 30 | |
| 31 virtual ~VibrationMessageFilter(); | |
| 32 | |
| 33 private: | |
| 34 // BrowserMessageFilter implementation. | |
| 35 virtual bool OnMessageReceived(const IPC::Message& message, | |
| 36 bool* message_was_ok) OVERRIDE; | |
| 37 | |
| 38 static Factory* factory_; | |
| 39 }; | |
| 40 | |
| 41 } // namespace content | |
| 42 | |
| 43 #endif // CONTENT_BROWSER_VIBRATION_MESSAGE_FILTER_H_ | |
| OLD | NEW |