Chromium Code Reviews| 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 26 matching lines...) Expand all Loading... | |
| 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(); |
| 47 SetVisible(Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled()); | 47 SetVisible(Shell::GetInstance()->maximize_mode_controller()-> |
| 48 IsMaximizeModeWindowManagerEnabled()); | |
|
flackr
2014/05/29 16:10:06
nit: Indent 4 more to show wrapped from above line
jonross
2014/05/29 17:40:00
Done.
| |
| 48 Shell::GetInstance()->AddShellObserver(this); | 49 Shell::GetInstance()->AddShellObserver(this); |
| 49 } | 50 } |
| 50 | 51 |
| 51 RotationLockDefaultView::~RotationLockDefaultView() { | 52 RotationLockDefaultView::~RotationLockDefaultView() { |
| 52 Shell::GetInstance()->RemoveShellObserver(this); | 53 Shell::GetInstance()->RemoveShellObserver(this); |
| 53 } | 54 } |
| 54 | 55 |
| 55 bool RotationLockDefaultView::PerformAction(const ui::Event& event) { | 56 bool RotationLockDefaultView::PerformAction(const ui::Event& event) { |
| 56 MaximizeModeController* maximize_mode_controller = Shell::GetInstance()-> | 57 MaximizeModeController* maximize_mode_controller = Shell::GetInstance()-> |
| 57 maximize_mode_controller(); | 58 maximize_mode_controller(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 void TrayRotationLock::OnMaximizeModeStarted() { | 125 void TrayRotationLock::OnMaximizeModeStarted() { |
| 125 tray_view()->SetVisible( | 126 tray_view()->SetVisible( |
| 126 Shell::GetInstance()->maximize_mode_controller()->rotation_locked()); | 127 Shell::GetInstance()->maximize_mode_controller()->rotation_locked()); |
| 127 } | 128 } |
| 128 | 129 |
| 129 void TrayRotationLock::OnMaximizeModeEnded() { | 130 void TrayRotationLock::OnMaximizeModeEnded() { |
| 130 tray_view()->SetVisible(false); | 131 tray_view()->SetVisible(false); |
| 131 } | 132 } |
| 132 | 133 |
| 133 bool TrayRotationLock::GetInitialVisibility() { | 134 bool TrayRotationLock::GetInitialVisibility() { |
| 135 MaximizeModeController* controller = Shell::GetInstance()-> | |
| 136 maximize_mode_controller(); | |
| 134 return on_primary_display_ && | 137 return on_primary_display_ && |
| 135 Shell::GetInstance()->IsMaximizeModeWindowManagerEnabled() && | 138 controller->IsMaximizeModeWindowManagerEnabled() && |
| 136 Shell::GetInstance()->maximize_mode_controller()->rotation_locked(); | 139 controller->rotation_locked(); |
| 137 } | 140 } |
| 138 | 141 |
| 139 } // namespace ash | 142 } // namespace ash |
| OLD | NEW |