Findbugs roll from 2.0.3 to 3.0.0
[chromium-blink-merge.git] / ash / accelerometer / accelerometer_controller.cc
blobe68702d4bf4dba1b8a67830622bec3d255eed0ac
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"
9 namespace ash {
11 AccelerometerController::AccelerometerController() {
14 AccelerometerController::~AccelerometerController() {
17 void AccelerometerController::Initialize(
18 scoped_refptr<base::TaskRunner> blocking_task_runner) {
19 #if defined(OS_CHROMEOS)
20 reader_.reset(
21 new chromeos::AccelerometerReader(blocking_task_runner, this));
22 #endif
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));
39 #endif
41 } // namespace ash