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 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" | 5 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "ash/system/tray/tray_item_more.h" | 9 #include "ash/system/tray/tray_item_more.h" |
10 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 10 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // DetailedView. This was chosen over ActionableView in order to reuse the | 22 // DetailedView. This was chosen over ActionableView in order to reuse the |
23 // layout and styling of labels and images. This allows RotationLockDefaultView | 23 // layout and styling of labels and images. This allows RotationLockDefaultView |
24 // to maintain the look of other system tray items without code duplication. | 24 // to maintain the look of other system tray items without code duplication. |
25 class RotationLockDefaultView : public TrayItemMore, | 25 class RotationLockDefaultView : public TrayItemMore, |
26 public ShellObserver { | 26 public ShellObserver { |
27 public: | 27 public: |
28 explicit RotationLockDefaultView(SystemTrayItem* owner); | 28 explicit RotationLockDefaultView(SystemTrayItem* owner); |
29 virtual ~RotationLockDefaultView(); | 29 virtual ~RotationLockDefaultView(); |
30 | 30 |
31 // ActionableView: | 31 // ActionableView: |
32 virtual bool PerformAction(const ui::Event& event) OVERRIDE; | 32 virtual bool PerformAction(const ui::Event& event) override; |
33 | 33 |
34 // ShellObserver: | 34 // ShellObserver: |
35 virtual void OnMaximizeModeStarted() OVERRIDE; | 35 virtual void OnMaximizeModeStarted() override; |
36 virtual void OnMaximizeModeEnded() OVERRIDE; | 36 virtual void OnMaximizeModeEnded() override; |
37 | 37 |
38 private: | 38 private: |
39 void UpdateImage(); | 39 void UpdateImage(); |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(RotationLockDefaultView); | 41 DISALLOW_COPY_AND_ASSIGN(RotationLockDefaultView); |
42 }; | 42 }; |
43 | 43 |
44 RotationLockDefaultView::RotationLockDefaultView(SystemTrayItem* owner) | 44 RotationLockDefaultView::RotationLockDefaultView(SystemTrayItem* owner) |
45 : TrayItemMore(owner, false) { | 45 : TrayItemMore(owner, false) { |
46 UpdateImage(); | 46 UpdateImage(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 bool TrayRotationLock::ShouldBeVisible() { | 137 bool TrayRotationLock::ShouldBeVisible() { |
138 MaximizeModeController* controller = Shell::GetInstance()-> | 138 MaximizeModeController* controller = Shell::GetInstance()-> |
139 maximize_mode_controller(); | 139 maximize_mode_controller(); |
140 return on_primary_display_ && | 140 return on_primary_display_ && |
141 controller->IsMaximizeModeWindowManagerEnabled() && | 141 controller->IsMaximizeModeWindowManagerEnabled() && |
142 controller->rotation_locked(); | 142 controller->rotation_locked(); |
143 } | 143 } |
144 | 144 |
145 } // namespace ash | 145 } // namespace ash |
OLD | NEW |