// 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.
#ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
#define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
#include "ash/accelerometer/accelerometer_observer.h"
#include "base/macros.h"
namespace ash {
// MaximizeModeController listens to accelerometer events and automatically
// enters and exits maximize mode when the lid is opened beyond the triggering
// angle and rotates the display to match the device when in maximize mode.
class MaximizeModeController : public AccelerometerObserver {
public:
MaximizeModeController();
virtual ~MaximizeModeController();
virtual void OnAccelerometerUpdated(const gfx::Vector3dF& base,
const gfx::Vector3dF& lid) OVERRIDE;
private:
// Detect hinge rotation from |base| and |lid| accelerometers and
// automatically start / stop maximize mode.
void HandleHingeRotation(const gfx::Vector3dF& base,
const gfx::Vector3dF& lid);
// Detect screen rotation from |lid| accelerometer and automatically rotate
// screen.
void HandleScreenRotation(const gfx::Vector3dF& lid);
DISALLOW_COPY_AND_ASSIGN(MaximizeModeController);
};
} // namespace ash
#endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_