1 // Copyright 2014 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.
5 #include "ash/accelerometer/accelerometer_controller.h"
7 #include "ash/accelerometer/accelerometer_observer.h"
11 AccelerometerController::AccelerometerController() {
14 AccelerometerController::~AccelerometerController() {
17 void AccelerometerController::Initialize(
18 scoped_refptr
<base::TaskRunner
> blocking_task_runner
) {
19 #if defined(OS_CHROMEOS)
21 new chromeos::AccelerometerReader(blocking_task_runner
, this));
25 void AccelerometerController::AddObserver(AccelerometerObserver
* observer
) {
26 observers_
.AddObserver(observer
);
29 void AccelerometerController::RemoveObserver(AccelerometerObserver
* observer
) {
30 observers_
.RemoveObserver(observer
);
33 #if defined(OS_CHROMEOS)
34 void AccelerometerController::HandleAccelerometerUpdate(
35 const ui::AccelerometerUpdate
& update
) {
36 FOR_EACH_OBSERVER(AccelerometerObserver
, observers_
,
37 OnAccelerometerUpdated(update
));