| 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/display/screen_orientation_controller_chromeos.h" | 7 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
| 10 #include "ash/system/tray/tray_item_more.h" | 10 #include "ash/system/tray/tray_item_more.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 102 } |
| 103 | 103 |
| 104 TrayRotationLock::~TrayRotationLock() { | 104 TrayRotationLock::~TrayRotationLock() { |
| 105 StopObservingShell(); | 105 StopObservingShell(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void TrayRotationLock::OnRotationLockChanged(bool rotation_locked) { | 108 void TrayRotationLock::OnRotationLockChanged(bool rotation_locked) { |
| 109 tray_view()->SetVisible(ShouldBeVisible()); | 109 tray_view()->SetVisible(ShouldBeVisible()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 views::View* TrayRotationLock::CreateDefaultView(user::LoginStatus status) { | 112 views::View* TrayRotationLock::CreateDefaultView(LoginStatus status) { |
| 113 if (OnPrimaryDisplay()) | 113 if (OnPrimaryDisplay()) |
| 114 return new tray::RotationLockDefaultView(this); | 114 return new tray::RotationLockDefaultView(this); |
| 115 return NULL; | 115 return NULL; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void TrayRotationLock::OnMaximizeModeStarted() { | 118 void TrayRotationLock::OnMaximizeModeStarted() { |
| 119 tray_view()->SetVisible( | 119 tray_view()->SetVisible( |
| 120 Shell::GetInstance()->screen_orientation_controller()->rotation_locked()); | 120 Shell::GetInstance()->screen_orientation_controller()->rotation_locked()); |
| 121 Shell::GetInstance()->screen_orientation_controller()->AddObserver(this); | 121 Shell::GetInstance()->screen_orientation_controller()->AddObserver(this); |
| 122 observing_rotation_ = true; | 122 observing_rotation_ = true; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 void TrayRotationLock::StopObservingShell() { | 167 void TrayRotationLock::StopObservingShell() { |
| 168 if (!observing_shell_) | 168 if (!observing_shell_) |
| 169 return; | 169 return; |
| 170 Shell::GetInstance()->RemoveShellObserver(this); | 170 Shell::GetInstance()->RemoveShellObserver(this); |
| 171 observing_shell_ = false; | 171 observing_shell_ = false; |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace ash | 174 } // namespace ash |
| OLD | NEW |