| 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_SYSTEM_ROTATION_TRAY_ROTATION_LOCK_H_ | 5 #ifndef ASH_SYSTEM_ROTATION_TRAY_ROTATION_LOCK_H_ |
| 6 #define ASH_SYSTEM_ROTATION_TRAY_ROTATION_LOCK_H_ | 6 #define ASH_SYSTEM_ROTATION_TRAY_ROTATION_LOCK_H_ |
| 7 | 7 |
| 8 #include "ash/display/screen_orientation_controller_chromeos.h" | 8 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 9 #include "ash/shell_observer.h" | 9 #include "ash/shell_observer.h" |
| 10 #include "ash/system/tray/tray_image_item.h" | 10 #include "ash/system/tray/tray_image_item.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 explicit TrayRotationLock(SystemTray* system_tray); | 25 explicit TrayRotationLock(SystemTray* system_tray); |
| 26 ~TrayRotationLock() override; | 26 ~TrayRotationLock() override; |
| 27 | 27 |
| 28 // ScreenOrientationController::Observer: | 28 // ScreenOrientationController::Observer: |
| 29 void OnUserRotationLockChanged() override; | 29 void OnUserRotationLockChanged() override; |
| 30 | 30 |
| 31 // SystemTrayItem: | 31 // SystemTrayItem: |
| 32 views::View* CreateDefaultView(LoginStatus status) override; | 32 views::View* CreateDefaultView(LoginStatus status) override; |
| 33 | 33 |
| 34 // ShellObserver: | 34 // ShellObserver: |
| 35 void OnMaximizeModeStarted() override; | 35 void OnTabletModeStarted() override; |
| 36 void OnMaximizeModeEnded() override; | 36 void OnTabletModeEnded() override; |
| 37 | 37 |
| 38 // TrayImageItem: | 38 // TrayImageItem: |
| 39 void DestroyTrayView() override; | 39 void DestroyTrayView() override; |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 // TrayImageItem: | 42 // TrayImageItem: |
| 43 bool GetInitialVisibility() override; | 43 bool GetInitialVisibility() override; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 friend class TrayRotationLockTest; | 46 friend class TrayRotationLockTest; |
| 47 | 47 |
| 48 // Update tray image based on whether user rotation lock is enabled. | 48 // Update tray image based on whether user rotation lock is enabled. |
| 49 void UpdateTrayImage(); | 49 void UpdateTrayImage(); |
| 50 | 50 |
| 51 // True if |on_primary_display_|, maximize mode is enabled. | 51 // True if |on_primary_display_|, tablet mode is enabled. |
| 52 bool ShouldBeVisible(); | 52 bool ShouldBeVisible(); |
| 53 | 53 |
| 54 // True if this is owned by a SystemTray on the primary display. | 54 // True if this is owned by a SystemTray on the primary display. |
| 55 bool OnPrimaryDisplay() const; | 55 bool OnPrimaryDisplay() const; |
| 56 | 56 |
| 57 // Removes TrayRotationLock as a ScreenOrientationController::Observer if | 57 // Removes TrayRotationLock as a ScreenOrientationController::Observer if |
| 58 // currently observing. | 58 // currently observing. |
| 59 void StopObservingRotation(); | 59 void StopObservingRotation(); |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(TrayRotationLock); | 61 DISALLOW_COPY_AND_ASSIGN(TrayRotationLock); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace ash | 64 } // namespace ash |
| 65 | 65 |
| 66 #endif // ASH_SYSTEM_ROTATION_TRAY_ROTATION_LOCK_H_ | 66 #endif // ASH_SYSTEM_ROTATION_TRAY_ROTATION_LOCK_H_ |
| OLD | NEW |