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

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

Issue 303723003: Lock Rotation on user settings changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/shell_observer.h" 8 #include "ash/shell_observer.h"
9 #include "ash/system/tray/tray_image_item.h" 9 #include "ash/system/tray/tray_image_item.h"
10 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
10 11
11 namespace ash { 12 namespace ash {
12 13
13 namespace tray { 14 namespace tray {
14 class RotationLockDefaultView; 15 class RotationLockDefaultView;
15 } // namespace tray 16 } // namespace tray
16 17
17 // TrayRotationLock is a provider of views for the SystemTray. Both a tray view 18 // TrayRotationLock is a provider of views for the SystemTray. Both a tray view
18 // and a default view are provided. Each view indicates the current state of 19 // and a default view are provided. Each view indicates the current state of
19 // the rotation lock for the display which it appears on. The default view can 20 // the rotation lock for the display which it appears on. The default view can
20 // be interacted with, it toggles the state of the rotation lock. 21 // be interacted with, it toggles the state of the rotation lock.
21 // TrayRotationLock is only available on the primary display. 22 // TrayRotationLock is only available on the primary display.
22 class ASH_EXPORT TrayRotationLock : public TrayImageItem, 23 class ASH_EXPORT TrayRotationLock : public TrayImageItem,
24 public MaximizeModeController::Observer,
23 public ShellObserver { 25 public ShellObserver {
24 public: 26 public:
25 explicit TrayRotationLock(SystemTray* system_tray); 27 explicit TrayRotationLock(SystemTray* system_tray);
26 virtual ~TrayRotationLock(); 28 virtual ~TrayRotationLock();
27 29
30 // MaximizeModeController::Observer:
31 virtual void OnRotationLockChanged() OVERRIDE;
32
28 // SystemTrayItem: 33 // SystemTrayItem:
29 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; 34 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
30 35
31 // ShellObserver: 36 // ShellObserver:
32 virtual void OnMaximizeModeStarted() OVERRIDE; 37 virtual void OnMaximizeModeStarted() OVERRIDE;
33 virtual void OnMaximizeModeEnded() OVERRIDE; 38 virtual void OnMaximizeModeEnded() OVERRIDE;
34 39
35 protected: 40 protected:
36 // TrayImageItem: 41 // TrayImageItem:
37 virtual bool GetInitialVisibility() OVERRIDE; 42 virtual bool GetInitialVisibility() OVERRIDE;
38 43
39 private: 44 private:
40 friend class TrayRotationLockTest; 45 friend class TrayRotationLockTest;
41 46
42 // True if this has been created by a SystemTray on the primary display. 47 // True if this has been created by a SystemTray on the primary display.
43 bool on_primary_display_; 48 bool on_primary_display_;
44 49
45 DISALLOW_COPY_AND_ASSIGN(TrayRotationLock); 50 DISALLOW_COPY_AND_ASSIGN(TrayRotationLock);
46 }; 51 };
47 52
48 } // namespace ash 53 } // namespace ash
49 54
50 #endif // ASH_SYSTEM_CHROMEOS_ROTATION_TRAY_ROTATION_LOCK_H_ 55 #endif // ASH_SYSTEM_CHROMEOS_ROTATION_TRAY_ROTATION_LOCK_H_
OLDNEW
« no previous file with comments | « no previous file | ash/system/chromeos/rotation/tray_rotation_lock.cc » ('j') | ash/system/chromeos/rotation/tray_rotation_lock.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698