Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 #include "content/browser/device_orientation/motion_message_filter.h" | |
| 6 | |
| 7 #include "content/browser/device_orientation/device_data.h" | |
| 8 #include "content/common/device_motion_messages.h" | |
| 9 #include "content/public/browser/browser_thread.h" | |
| 10 | |
| 11 using content::BrowserThread; | |
|
jam
2012/08/15 19:13:45
nit: not needed
aousterh
2012/08/16 13:09:14
Done.
| |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 MotionMessageFilter::MotionMessageFilter() | |
| 16 : MessageFilter(DeviceData::kTypeMotion) { | |
| 17 } | |
| 18 | |
| 19 MotionMessageFilter::~MotionMessageFilter() { | |
| 20 } | |
| 21 | |
| 22 bool MotionMessageFilter::OnMessageReceived(const IPC::Message& message, | |
| 23 bool* message_was_ok) { | |
| 24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
| 25 bool handled = true; | |
| 26 IPC_BEGIN_MESSAGE_MAP_EX(MotionMessageFilter, message, *message_was_ok) | |
| 27 IPC_MESSAGE_HANDLER(DeviceMotionHostMsg_StartUpdating, OnStartUpdating) | |
| 28 IPC_MESSAGE_HANDLER(DeviceMotionHostMsg_StopUpdating, OnStopUpdating) | |
| 29 IPC_MESSAGE_UNHANDLED(handled = false) | |
| 30 IPC_END_MESSAGE_MAP() | |
| 31 return handled; | |
| 32 } | |
| 33 | |
| 34 } // namespace content | |
| OLD | NEW |