| 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/common/system/tray/tray_item_more.h" | 7 #include "ash/common/system/tray/tray_item_more.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/display/screen_orientation_controller_chromeos.h" | 9 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 .ToImageSkia()); | 89 .ToImageSkia()); |
| 90 label = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO); | 90 label = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO); |
| 91 SetLabel(label); | 91 SetLabel(label); |
| 92 SetAccessibleName(label); | 92 SetAccessibleName(label); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace tray | 96 } // namespace tray |
| 97 | 97 |
| 98 TrayRotationLock::TrayRotationLock(SystemTray* system_tray) | 98 TrayRotationLock::TrayRotationLock(SystemTray* system_tray) |
| 99 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED), | 99 : TrayImageItem(system_tray, |
| 100 IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED, |
| 101 UMA_ROTATION_LOCK), |
| 100 observing_rotation_(false), | 102 observing_rotation_(false), |
| 101 observing_shell_(true) { | 103 observing_shell_(true) { |
| 102 WmShell::Get()->AddShellObserver(this); | 104 WmShell::Get()->AddShellObserver(this); |
| 103 } | 105 } |
| 104 | 106 |
| 105 TrayRotationLock::~TrayRotationLock() { | 107 TrayRotationLock::~TrayRotationLock() { |
| 106 StopObservingShell(); | 108 StopObservingShell(); |
| 107 } | 109 } |
| 108 | 110 |
| 109 void TrayRotationLock::OnRotationLockChanged(bool rotation_locked) { | 111 void TrayRotationLock::OnRotationLockChanged(bool rotation_locked) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 168 } |
| 167 | 169 |
| 168 void TrayRotationLock::StopObservingShell() { | 170 void TrayRotationLock::StopObservingShell() { |
| 169 if (!observing_shell_) | 171 if (!observing_shell_) |
| 170 return; | 172 return; |
| 171 WmShell::Get()->RemoveShellObserver(this); | 173 WmShell::Get()->RemoveShellObserver(this); |
| 172 observing_shell_ = false; | 174 observing_shell_ = false; |
| 173 } | 175 } |
| 174 | 176 |
| 175 } // namespace ash | 177 } // namespace ash |
| OLD | NEW |