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 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
8 #include "ash/accelerometer/accelerometer_observer.h"
9 #include "base/macros.h"
13 // MaximizeModeController listens to accelerometer events and automatically
14 // enters and exits maximize mode when the lid is opened beyond the triggering
15 // angle and rotates the display to match the device when in maximize mode.
16 class MaximizeModeController : public AccelerometerObserver {
18 MaximizeModeController();
19 virtual ~MaximizeModeController();
21 virtual void OnAccelerometerUpdated(const gfx::Vector3dF& base,
22 const gfx::Vector3dF& lid) OVERRIDE;
24 // Detect hinge rotation from |base| and |lid| accelerometers and
25 // automatically start / stop maximize mode.
26 void HandleHingeRotation(const gfx::Vector3dF& base,
27 const gfx::Vector3dF& lid);
29 // Detect screen rotation from |lid| accelerometer and automatically rotate
31 void HandleScreenRotation(const gfx::Vector3dF& lid);
33 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController);
38 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_