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

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

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Working patch Created 6 years, 10 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: content/browser/vibration/vibration_message_filter.cc
diff --git a/content/browser/vibration/vibration_message_filter.cc b/content/browser/vibration/vibration_message_filter.cc
index 99811a976dbcd360facac3f706487beb98e2acf4..955104248cab1fbac64b86caf3330aeb6bb988d7 100644
--- a/content/browser/vibration/vibration_message_filter.cc
+++ b/content/browser/vibration/vibration_message_filter.cc
@@ -14,11 +14,20 @@
#include "third_party/WebKit/public/platform/WebVibration.h"
namespace content {
+namespace {
// Minimum duration of a vibration is 1 millisecond.
const int64 kMinimumVibrationDurationMs = 1;
-VibrationMessageFilter::VibrationMessageFilter() {
+const uint32 kFilteredMessageClasses[] = {
+ ViewMsgStart
+};
+
+} // namespace
+
+VibrationMessageFilter::VibrationMessageFilter()
+ : BrowserMessageFilter(
+ kFilteredMessageClasses, arraysize(kFilteredMessageClasses)) {
provider_.reset(GetContentClient()->browser()->OverrideVibrationProvider());
if (!provider_.get())
provider_.reset(CreateProvider());

Powered by Google App Engine
This is Rietveld 408576698