| 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/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/system/tray/system_tray.h" | 8 #include "ash/common/system/tray/system_tray.h" |
| 9 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
| 10 #include "ash/common/system/tray/tray_item_more.h" | 10 #include "ash/common/system/tray/tray_item_more.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 base::string16 label = l10n_util::GetStringUTF16( | 98 base::string16 label = l10n_util::GetStringUTF16( |
| 99 rotation_locked ? IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED | 99 rotation_locked ? IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED |
| 100 : IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO); | 100 : IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO); |
| 101 SetLabel(label); | 101 SetLabel(label); |
| 102 SetAccessibleName(label); | 102 SetAccessibleName(label); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace tray | 105 } // namespace tray |
| 106 | 106 |
| 107 TrayRotationLock::TrayRotationLock(SystemTray* system_tray) | 107 TrayRotationLock::TrayRotationLock(SystemTray* system_tray) |
| 108 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED), | 108 : TrayImageItem(system_tray, |
| 109 IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED, |
| 110 UMA_ROTATION_LOCK), |
| 109 observing_rotation_(false), | 111 observing_rotation_(false), |
| 110 observing_shell_(true) { | 112 observing_shell_(true) { |
| 111 WmShell::Get()->AddShellObserver(this); | 113 WmShell::Get()->AddShellObserver(this); |
| 112 } | 114 } |
| 113 | 115 |
| 114 TrayRotationLock::~TrayRotationLock() { | 116 TrayRotationLock::~TrayRotationLock() { |
| 115 StopObservingShell(); | 117 StopObservingShell(); |
| 116 } | 118 } |
| 117 | 119 |
| 118 void TrayRotationLock::OnRotationLockChanged(bool rotation_locked) { | 120 void TrayRotationLock::OnRotationLockChanged(bool rotation_locked) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 177 } |
| 176 | 178 |
| 177 void TrayRotationLock::StopObservingShell() { | 179 void TrayRotationLock::StopObservingShell() { |
| 178 if (!observing_shell_) | 180 if (!observing_shell_) |
| 179 return; | 181 return; |
| 180 WmShell::Get()->RemoveShellObserver(this); | 182 WmShell::Get()->RemoveShellObserver(this); |
| 181 observing_shell_ = false; | 183 observing_shell_ = false; |
| 182 } | 184 } |
| 183 | 185 |
| 184 } // namespace ash | 186 } // namespace ash |
| OLD | NEW |