| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_DATA_H_ | 5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_DATA_H_ |
| 6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_DATA_H_ | 6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_DATA_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 | 10 |
| 11 namespace IPC { | 11 namespace IPC { |
| 12 class Message; | 12 class Message; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class CONTENT_EXPORT DeviceData : | 17 class CONTENT_EXPORT DeviceData : |
| 18 public base::RefCountedThreadSafe<DeviceData> { | 18 public base::RefCountedThreadSafe<DeviceData> { |
| 19 public: | 19 public: |
| 20 // TODO(timvolodine): move the DeviceData::Type enum to the service class |
| 21 // once it is implemented. |
| 20 enum Type { | 22 enum Type { |
| 21 kTypeMotion, | 23 kTypeOrientation = 0, |
| 22 kTypeOrientation, | 24 kTypeMotion = 1, |
| 23 kTypeTest | 25 kTypeTest = 100 |
| 24 }; | 26 }; |
| 25 | 27 |
| 26 virtual IPC::Message* CreateIPCMessage(int render_view_id) const = 0; | 28 virtual IPC::Message* CreateIPCMessage(int render_view_id) const = 0; |
| 27 virtual bool ShouldFireEvent(const DeviceData* other) const = 0; | 29 virtual bool ShouldFireEvent(const DeviceData* other) const = 0; |
| 28 | 30 |
| 29 protected: | 31 protected: |
| 30 DeviceData() {} | 32 DeviceData() {} |
| 31 virtual ~DeviceData() {} | 33 virtual ~DeviceData() {} |
| 32 | 34 |
| 33 private: | 35 private: |
| 34 friend class base::RefCountedThreadSafe<DeviceData>; | 36 friend class base::RefCountedThreadSafe<DeviceData>; |
| 35 | 37 |
| 36 DISALLOW_COPY_AND_ASSIGN(DeviceData); | 38 DISALLOW_COPY_AND_ASSIGN(DeviceData); |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 } // namespace content | 41 } // namespace content |
| 40 | 42 |
| 41 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_DATA_H_ | 43 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_DATA_H_ |
| OLD | NEW |