| Index: content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc
|
| diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc b/content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..323e71a0e0fba9682c49283ee9aab952e1b87ab3
|
| --- /dev/null
|
| +++ b/content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc
|
| @@ -0,0 +1,50 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/browser/device_sensors/data_fetcher_shared_memory.h"
|
| +
|
| +#include "content/common/device_sensors/device_orientation_messages.h"
|
| +#include "content/public/browser/sensor_manager.h"
|
| +
|
| +namespace content {
|
| +
|
| +DataFetcherSharedMemory::DataFetcherSharedMemory() {
|
| +}
|
| +
|
| +DataFetcherSharedMemory::~DataFetcherSharedMemory() {
|
| +}
|
| +
|
| +bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) {
|
| + DCHECK(buffer);
|
| + switch (consumer_type) {
|
| + case CONSUMER_TYPE_MOTION:
|
| + return false;
|
| + case CONSUMER_TYPE_ORIENTATION:
|
| + SensorManager::GetInstance()->StartFetchingDeviceOrientationData(
|
| + static_cast<DeviceOrientationHardwareBuffer*>(buffer));
|
| + return true;
|
| + case CONSUMER_TYPE_LIGHT:
|
| + return false;
|
| + default:
|
| + NOTREACHED();
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) {
|
| + switch (consumer_type) {
|
| + case CONSUMER_TYPE_MOTION:
|
| + return false;
|
| + case CONSUMER_TYPE_ORIENTATION:
|
| + SensorManager::GetInstance()->StopFetchingDeviceOrientationData();
|
| + return true;
|
| + case CONSUMER_TYPE_LIGHT:
|
| + return false;
|
| + default:
|
| + NOTREACHED();
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +} // namespace content
|
|
|