1 // Copyright (c) 2013 Intel Corporation. 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.
5 // Part of codes are copied from libslp-sensor with original copyright
6 // and license as below.
8 // Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
14 // http://www.apache.org/licenses/LICENSE-2.0
16 #ifndef XWALK_TIZEN_MOBILE_SENSOR_TIZEN_PLATFORM_SENSOR_H_
17 #define XWALK_TIZEN_MOBILE_SENSOR_TIZEN_PLATFORM_SENSOR_H_
22 #include "base/native_library.h"
23 #include "base/threading/thread.h"
24 #include "xwalk/tizen/mobile/sensor/sensor_provider.h"
28 class TizenPlatformSensor : public SensorProvider {
30 TizenPlatformSensor();
31 virtual ~TizenPlatformSensor();
33 virtual bool Initialize() OVERRIDE;
34 virtual void Finish() OVERRIDE;
37 bool auto_rotation_enabled_;
41 static void OnEventReceived(unsigned int event_type,
42 sensor_event_data_t* event_data, void* udata);
43 static void OnAutoRotationEnabledChanged(keynode_t* node, void* udata);
47 scoped_ptr<base::Thread> sensor_thread_;
49 DISALLOW_COPY_AND_ASSIGN(TizenPlatformSensor);
54 #endif // XWALK_TIZEN_MOBILE_SENSOR_TIZEN_PLATFORM_SENSOR_H_