| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 5 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| 6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/accelerometer/accelerometer_observer.h" | 8 #include "ash/accelerometer/accelerometer_observer.h" |
| 9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
| 11 #include "ash/display/display_manager.h" | 11 #include "ash/display/display_manager.h" |
| 12 #include "ash/shell_observer.h" | 12 #include "ash/shell_observer.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/power_monitor/power_observer.h" | 16 #include "base/power_monitor/power_observer.h" |
| 17 #include "ui/gfx/display.h" | 17 #include "ui/gfx/display.h" |
| 18 | 18 |
| 19 namespace ui { | 19 namespace ui { |
| 20 class EventHandler; | 20 class EventHandler; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| 24 | 24 |
| 25 class MaximizeModeControllerTest; | 25 class MaximizeModeControllerTest; |
| 26 class MaximizeModeEventBlocker; | 26 class ScopedDisableInternalMouseAndKeyboard; |
| 27 class MaximizeModeWindowManager; | 27 class MaximizeModeWindowManager; |
| 28 class MaximizeModeWindowManagerTest; | 28 class MaximizeModeWindowManagerTest; |
| 29 | 29 |
| 30 // MaximizeModeController listens to accelerometer events and automatically | 30 // MaximizeModeController listens to accelerometer events and automatically |
| 31 // enters and exits maximize mode when the lid is opened beyond the triggering | 31 // enters and exits maximize mode when the lid is opened beyond the triggering |
| 32 // angle and rotates the display to match the device when in maximize mode. | 32 // angle and rotates the display to match the device when in maximize mode. |
| 33 class ASH_EXPORT MaximizeModeController : public AccelerometerObserver, | 33 class ASH_EXPORT MaximizeModeController : public AccelerometerObserver, |
| 34 public base::PowerObserver, | 34 public base::PowerObserver, |
| 35 public ShellObserver, | 35 public ShellObserver, |
| 36 public DisplayController::Observer { | 36 public DisplayController::Observer { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // Removes MaximizeModeWindowManager and resets the display rotation if there | 129 // Removes MaximizeModeWindowManager and resets the display rotation if there |
| 130 // is no rotation lock. | 130 // is no rotation lock. |
| 131 void LeaveMaximizeMode(); | 131 void LeaveMaximizeMode(); |
| 132 | 132 |
| 133 // Record UMA stats tracking touchview usage. | 133 // Record UMA stats tracking touchview usage. |
| 134 void RecordTouchViewStateTransition(); | 134 void RecordTouchViewStateTransition(); |
| 135 | 135 |
| 136 // The maximized window manager (if enabled). | 136 // The maximized window manager (if enabled). |
| 137 scoped_ptr<MaximizeModeWindowManager> maximize_mode_window_manager_; | 137 scoped_ptr<MaximizeModeWindowManager> maximize_mode_window_manager_; |
| 138 | 138 |
| 139 // An event targeter controller which traps mouse and keyboard events while | 139 // A helper class which when instantiated will block native events from the |
| 140 // maximize mode is engaged. | 140 // internal keyboard and touchpad. |
| 141 scoped_ptr<MaximizeModeEventBlocker> event_blocker_; | 141 scoped_ptr<ScopedDisableInternalMouseAndKeyboard> event_blocker_; |
| 142 | 142 |
| 143 // An event handler used to detect screenshot actions while in maximize mode. | 143 // An event handler used to detect screenshot actions while in maximize mode. |
| 144 scoped_ptr<ui::EventHandler> event_handler_; | 144 scoped_ptr<ui::EventHandler> event_handler_; |
| 145 | 145 |
| 146 // When true calls to OnAccelerometerUpdated will not rotate the display. | 146 // When true calls to OnAccelerometerUpdated will not rotate the display. |
| 147 bool rotation_locked_; | 147 bool rotation_locked_; |
| 148 | 148 |
| 149 // Whether we have ever seen accelerometer data. | 149 // Whether we have ever seen accelerometer data. |
| 150 bool have_seen_accelerometer_data_; | 150 bool have_seen_accelerometer_data_; |
| 151 | 151 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 168 base::Time last_touchview_transition_time_; | 168 base::Time last_touchview_transition_time_; |
| 169 base::TimeDelta total_touchview_time_; | 169 base::TimeDelta total_touchview_time_; |
| 170 base::TimeDelta total_non_touchview_time_; | 170 base::TimeDelta total_non_touchview_time_; |
| 171 | 171 |
| 172 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); | 172 DISALLOW_COPY_AND_ASSIGN(MaximizeModeController); |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 } // namespace ash | 175 } // namespace ash |
| 176 | 176 |
| 177 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ | 177 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_ |
| OLD | NEW |