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

Side by Side Diff: content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc

Issue 856123002: Device Orientation API on Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update to reflect chromeos accelerometer changes Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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_sensors/data_fetcher_shared_memory.h"
6
7 #include "content/browser/device_sensors/sensor_manager_chromeos.h"
8
9 namespace content {
10
11 DataFetcherSharedMemory::DataFetcherSharedMemory() {
12 }
13
14 DataFetcherSharedMemory::~DataFetcherSharedMemory() {
15 }
16
17 bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) {
18 DCHECK(buffer);
19 if (!sensor_manager_)
20 sensor_manager_.reset(new SensorManagerChromeOS);
21
22 switch (consumer_type) {
23 case CONSUMER_TYPE_MOTION:
24 // TODO(jonross): Implement Device Motion API. (crbug.com/427662)
25 NOTIMPLEMENTED();
26 return false;
27 case CONSUMER_TYPE_ORIENTATION:
28 return sensor_manager_->StartFetchingDeviceOrientationData(
29 static_cast<DeviceOrientationHardwareBuffer*>(buffer));
30 case CONSUMER_TYPE_LIGHT:
31 NOTIMPLEMENTED();
32 return false;
33 }
34 NOTREACHED();
35 return false;
36 }
37
38 bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) {
39 switch (consumer_type) {
40 case CONSUMER_TYPE_MOTION:
41 NOTIMPLEMENTED();
42 return false;
43 case CONSUMER_TYPE_ORIENTATION:
44 return sensor_manager_->StopFetchingDeviceOrientationData();
45 case CONSUMER_TYPE_LIGHT:
46 NOTIMPLEMENTED();
47 return false;
48 }
49 NOTREACHED();
50 return false;
51 }
52
53 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/device_sensors/data_fetcher_shared_memory.h ('k') | content/browser/device_sensors/sensor_manager_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698