| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/system/chromeos/tray_caps_lock.h" | 5 #include "ash/common/system/chromeos/tray_caps_lock.h" |
| 6 | 6 |
| 7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
| 8 #include "ash/common/system/tray/actionable_view.h" | 8 #include "ash/common/system/tray/actionable_view.h" |
| 9 #include "ash/common/system/tray/system_tray_delegate.h" | 9 #include "ash/common/system/tray/system_tray_delegate.h" |
| 10 #include "ash/common/system/tray/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (tray_view()) | 165 if (tray_view()) |
| 166 tray_view()->SetVisible(caps_lock_enabled_); | 166 tray_view()->SetVisible(caps_lock_enabled_); |
| 167 | 167 |
| 168 if (default_) { | 168 if (default_) { |
| 169 default_->Update(caps_lock_enabled_); | 169 default_->Update(caps_lock_enabled_); |
| 170 } else { | 170 } else { |
| 171 if (caps_lock_enabled_) { | 171 if (caps_lock_enabled_) { |
| 172 if (!message_shown_) { | 172 if (!message_shown_) { |
| 173 WmShell::Get()->RecordUserMetricsAction( | 173 WmShell::Get()->RecordUserMetricsAction( |
| 174 UMA_STATUS_AREA_CAPS_LOCK_POPUP); | 174 UMA_STATUS_AREA_CAPS_LOCK_POPUP); |
| 175 PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false); | 175 ShowDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false); |
| 176 message_shown_ = true; | 176 message_shown_ = true; |
| 177 } | 177 } |
| 178 } else if (detailed_) { | 178 } else if (detailed_) { |
| 179 detailed_->GetWidget()->Close(); | 179 detailed_->GetWidget()->Close(); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 bool TrayCapsLock::GetInitialVisibility() { | 184 bool TrayCapsLock::GetInitialVisibility() { |
| 185 return CapsLockIsEnabled(); | 185 return CapsLockIsEnabled(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 224 |
| 225 void TrayCapsLock::DestroyDefaultView() { | 225 void TrayCapsLock::DestroyDefaultView() { |
| 226 default_ = nullptr; | 226 default_ = nullptr; |
| 227 } | 227 } |
| 228 | 228 |
| 229 void TrayCapsLock::DestroyDetailedView() { | 229 void TrayCapsLock::DestroyDetailedView() { |
| 230 detailed_ = nullptr; | 230 detailed_ = nullptr; |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace ash | 233 } // namespace ash |
| OLD | NEW |