Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: ash/system/chromeos/rotation/tray_rotation_lock.h

Issue 2757493002: User orientation lock (Closed)
Patch Set: rebase again Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_CHROMEOS_ROTATION_TRAY_ROTATION_LOCK_H_ 5 #ifndef ASH_SYSTEM_CHROMEOS_ROTATION_TRAY_ROTATION_LOCK_H_
6 #define ASH_SYSTEM_CHROMEOS_ROTATION_TRAY_ROTATION_LOCK_H_ 6 #define ASH_SYSTEM_CHROMEOS_ROTATION_TRAY_ROTATION_LOCK_H_
7 7
8 #include "ash/common/shell_observer.h" 8 #include "ash/common/shell_observer.h"
9 #include "ash/common/system/tray/tray_image_item.h" 9 #include "ash/common/system/tray/tray_image_item.h"
10 #include "ash/display/screen_orientation_controller_chromeos.h" 10 #include "ash/display/screen_orientation_controller_chromeos.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 12
13 namespace ash { 13 namespace ash {
14 14
15 // TrayRotationLock is a provider of views for the SystemTray. Both a tray view 15 // TrayRotationLock is a provider of views for the SystemTray. Both a tray view
16 // and a default view are provided. Each view indicates the current state of 16 // and a default view are provided. Each view indicates the current state of
17 // the rotation lock for the display which it appears on. The default view can 17 // the rotation lock for the display which it appears on. The default view can
18 // be interacted with, it toggles the state of the rotation lock. 18 // be interacted with, it toggles the state of the rotation lock.
19 // TrayRotationLock is only available on the primary display. 19 // TrayRotationLock is only available on the primary display.
20 class ASH_EXPORT TrayRotationLock 20 class ASH_EXPORT TrayRotationLock
21 : public TrayImageItem, 21 : public TrayImageItem,
22 public ScreenOrientationController::Observer, 22 public ScreenOrientationController::Observer,
23 public ShellObserver { 23 public ShellObserver {
24 public: 24 public:
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 OnRotationLockChanged(bool rotation_locked) 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 OnMaximizeModeStarted() override;
36 void OnMaximizeModeEnded() override; 36 void OnMaximizeModeEnded() override;
37 37
38 // TrayImageItem: 38 // TrayImageItem:
39 void DestroyTrayView() override; 39 void DestroyTrayView() override;
(...skipping 15 matching lines...) Expand all
55 // Removes TrayRotationLock as a ScreenOrientationController::Observer if 55 // Removes TrayRotationLock as a ScreenOrientationController::Observer if
56 // currently observing. 56 // currently observing.
57 void StopObservingRotation(); 57 void StopObservingRotation();
58 58
59 DISALLOW_COPY_AND_ASSIGN(TrayRotationLock); 59 DISALLOW_COPY_AND_ASSIGN(TrayRotationLock);
60 }; 60 };
61 61
62 } // namespace ash 62 } // namespace ash
63 63
64 #endif // ASH_SYSTEM_CHROMEOS_ROTATION_TRAY_ROTATION_LOCK_H_ 64 #endif // ASH_SYSTEM_CHROMEOS_ROTATION_TRAY_ROTATION_LOCK_H_
OLDNEW
« no previous file with comments | « ash/display/screen_orientation_controller_chromeos.cc ('k') | ash/system/chromeos/rotation/tray_rotation_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698