| Index: ash/wm/tablet_mode/tablet_mode_controller.h
|
| diff --git a/ash/wm/maximize_mode/maximize_mode_controller.h b/ash/wm/tablet_mode/tablet_mode_controller.h
|
| similarity index 74%
|
| rename from ash/wm/maximize_mode/maximize_mode_controller.h
|
| rename to ash/wm/tablet_mode/tablet_mode_controller.h
|
| index 7ce9549c2787fcc9b8336c7ef50f0fb94ff5f339..8df527af1b297e3ee83ad43be9bce1928fdf3f8a 100644
|
| --- a/ash/wm/maximize_mode/maximize_mode_controller.h
|
| +++ b/ash/wm/tablet_mode/tablet_mode_controller.h
|
| @@ -2,8 +2,8 @@
|
| // 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_
|
| +#ifndef ASH_WM_TABLET_MODE_TABLET_MODE_CONTROLLER_H_
|
| +#define ASH_WM_TABLET_MODE_TABLET_MODE_CONTROLLER_H_
|
|
|
| #include <memory>
|
|
|
| @@ -37,20 +37,20 @@ class Vector3dF;
|
|
|
| namespace ash {
|
|
|
| -class MaximizeModeControllerTest;
|
| +class TabletModeControllerTest;
|
| class ScopedDisableInternalMouseAndKeyboard;
|
| -class MaximizeModeWindowManager;
|
| -class MaximizeModeWindowManagerTest;
|
| +class TabletModeWindowManager;
|
| +class TabletModeWindowManagerTest;
|
|
|
| namespace test {
|
| class MultiUserWindowManagerChromeOSTest;
|
| class VirtualKeyboardControllerTest;
|
| }
|
|
|
| -// 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 ASH_EXPORT MaximizeModeController
|
| +// TabletModeController listens to accelerometer events and automatically
|
| +// enters and exits tablet mode when the lid is opened beyond the triggering
|
| +// angle and rotates the display to match the device when in tablet mode.
|
| +class ASH_EXPORT TabletModeController
|
| : public chromeos::AccelerometerReader::Observer,
|
| public chromeos::PowerManagerClient::Observer,
|
| NON_EXPORTED_BASE(public mojom::TouchViewManager),
|
| @@ -66,36 +66,36 @@ class ASH_EXPORT MaximizeModeController
|
| TOUCHVIEW,
|
| };
|
|
|
| - MaximizeModeController();
|
| - ~MaximizeModeController() override;
|
| + TabletModeController();
|
| + ~TabletModeController() override;
|
|
|
| - // True if it is possible to enter maximize mode in the current
|
| + // True if it is possible to enter tablet mode in the current
|
| // configuration. If this returns false, it should never be the case that
|
| - // maximize mode becomes enabled.
|
| - bool CanEnterMaximizeMode();
|
| + // tablet mode becomes enabled.
|
| + bool CanEnterTabletMode();
|
|
|
| - // TODO(jonross): Merge this with EnterMaximizeMode. Currently these are
|
| + // TODO(jonross): Merge this with EnterTabletMode. Currently these are
|
| // separate for several reasons: there is no internal display when running
|
| // unittests; the event blocker prevents keyboard input when running ChromeOS
|
| // on linux. http://crbug.com/362881
|
| - // Turn the always maximize mode window manager on or off.
|
| - void EnableMaximizeModeWindowManager(bool should_enable);
|
| + // Turn the always tablet mode window manager on or off.
|
| + void EnableTabletModeWindowManager(bool should_enable);
|
|
|
| - // Test if the MaximizeModeWindowManager is enabled or not.
|
| - bool IsMaximizeModeWindowManagerEnabled() const;
|
| + // Test if the TabletModeWindowManager is enabled or not.
|
| + bool IsTabletModeWindowManagerEnabled() const;
|
|
|
| - // Add a special window to the MaximizeModeWindowManager for tracking. This is
|
| + // Add a special window to the TabletModeWindowManager for tracking. This is
|
| // only required for special windows which are handled by other window
|
| // managers like the |MultiUserWindowManager|.
|
| - // If the maximize mode is not enabled no action will be performed.
|
| + // If the tablet mode is not enabled no action will be performed.
|
| void AddWindow(aura::Window* window);
|
|
|
| // Binds the mojom::TouchViewManager interface request to this object.
|
| void BindRequest(mojom::TouchViewManagerRequest request);
|
|
|
| // ShellObserver:
|
| - void OnMaximizeModeStarted() override;
|
| - void OnMaximizeModeEnded() override;
|
| + void OnTabletModeStarted() override;
|
| + void OnTabletModeEnded() override;
|
| void OnShellInitialized() override;
|
|
|
| // WmDisplayObserver:
|
| @@ -117,8 +117,8 @@ class ASH_EXPORT MaximizeModeController
|
| void SuspendDone(const base::TimeDelta& sleep_duration) override;
|
|
|
| private:
|
| - friend class MaximizeModeControllerTest;
|
| - friend class MaximizeModeWindowManagerTest;
|
| + friend class TabletModeControllerTest;
|
| + friend class TabletModeWindowManagerTest;
|
| friend class test::MultiUserWindowManagerChromeOSTest;
|
| friend class test::VirtualKeyboardControllerTest;
|
|
|
| @@ -134,7 +134,7 @@ class ASH_EXPORT MaximizeModeController
|
| void SetTickClockForTest(std::unique_ptr<base::TickClock> tick_clock);
|
|
|
| // Detect hinge rotation from base and lid accelerometers and automatically
|
| - // start / stop maximize mode.
|
| + // start / stop tablet mode.
|
| void HandleHingeRotation(
|
| scoped_refptr<const chromeos::AccelerometerUpdate> update);
|
|
|
| @@ -144,13 +144,13 @@ class ASH_EXPORT MaximizeModeController
|
| // Returns true if the lid was recently opened.
|
| bool WasLidOpenedRecently() const;
|
|
|
| - // Enables MaximizeModeWindowManager, and determines the current state of
|
| + // Enables TabletModeWindowManager, and determines the current state of
|
| // rotation lock.
|
| - void EnterMaximizeMode();
|
| + void EnterTabletMode();
|
|
|
| - // Removes MaximizeModeWindowManager and resets the display rotation if there
|
| + // Removes TabletModeWindowManager and resets the display rotation if there
|
| // is no rotation lock.
|
| - void LeaveMaximizeMode();
|
| + void LeaveTabletMode();
|
|
|
| // Record UMA stats tracking TouchView usage. If |type| is
|
| // TOUCH_VIEW_INTERVAL_INACTIVE, then record that TouchView has been
|
| @@ -166,13 +166,13 @@ class ASH_EXPORT MaximizeModeController
|
| // mojom::TouchViewManager:
|
| void AddObserver(mojom::TouchViewObserverPtr observer) override;
|
|
|
| - // Checks whether we want to allow entering and exiting maximize mode. This
|
| + // Checks whether we want to allow entering and exiting tablet mode. This
|
| // returns false if the user set a flag for the software to behave in a
|
| // certain way regardless of configuration.
|
| - bool AllowEnterExitMaximizeMode() const;
|
| + bool AllowEnterExitTabletMode() const;
|
|
|
| // The maximized window manager (if enabled).
|
| - std::unique_ptr<MaximizeModeWindowManager> maximize_mode_window_manager_;
|
| + std::unique_ptr<TabletModeWindowManager> tablet_mode_window_manager_;
|
|
|
| // A helper class which when instantiated will block native events from the
|
| // internal keyboard and touchpad.
|
| @@ -197,10 +197,10 @@ class ASH_EXPORT MaximizeModeController
|
| // Source for the current time in base::TimeTicks.
|
| std::unique_ptr<base::TickClock> tick_clock_;
|
|
|
| - // Set when tablet mode switch is on. This is used to force maximize mode.
|
| + // Set when tablet mode switch is on. This is used to force tablet mode.
|
| bool tablet_mode_switch_is_on_;
|
|
|
| - // Tracks when the lid is closed. Used to prevent entering maximize mode.
|
| + // Tracks when the lid is closed. Used to prevent entering tablet mode.
|
| bool lid_is_closed_;
|
|
|
| // Tracks smoothed accelerometer data over time. This is done when the hinge
|
| @@ -215,16 +215,16 @@ class ASH_EXPORT MaximizeModeController
|
| // The set of touchview observers to be notified about mode changes.
|
| mojo::InterfacePtrSet<mojom::TouchViewObserver> observers_;
|
|
|
| - // Tracks whether a flag is used to force maximize mode.
|
| + // Tracks whether a flag is used to force tablet mode.
|
| ForceTabletMode force_tablet_mode_ = ForceTabletMode::NONE;
|
|
|
| ScopedSessionObserver scoped_session_observer_;
|
|
|
| - base::WeakPtrFactory<MaximizeModeController> weak_factory_;
|
| + base::WeakPtrFactory<TabletModeController> weak_factory_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(MaximizeModeController);
|
| + DISALLOW_COPY_AND_ASSIGN(TabletModeController);
|
| };
|
|
|
| } // namespace ash
|
|
|
| -#endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_CONTROLLER_H_
|
| +#endif // ASH_WM_TABLET_MODE_TABLET_MODE_CONTROLLER_H_
|
|
|