| 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/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.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/fixed_sized_image_view.h" | 9 #include "ash/common/system/tray/fixed_sized_image_view.h" |
| 10 #include "ash/common/system/tray/system_tray_delegate.h" | 10 #include "ash/common/system/tray/system_tray_delegate.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_CAPS_LOCK_DARK) | 57 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_CAPS_LOCK_DARK) |
| 58 .ToImageSkia()); | 58 .ToImageSkia()); |
| 59 } | 59 } |
| 60 AddChildView(image); | 60 AddChildView(image); |
| 61 | 61 |
| 62 text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 62 text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 63 AddChildView(text_label_); | 63 AddChildView(text_label_); |
| 64 | 64 |
| 65 shortcut_label_->SetEnabled(false); | 65 shortcut_label_->SetEnabled(false); |
| 66 AddChildView(shortcut_label_); | 66 AddChildView(shortcut_label_); |
| 67 |
| 68 if (MaterialDesignController::IsSystemTrayMenuMaterial()) |
| 69 SetInkDropMode(InkDropHostView::InkDropMode::ON); |
| 67 } | 70 } |
| 68 | 71 |
| 69 ~CapsLockDefaultView() override {} | 72 ~CapsLockDefaultView() override {} |
| 70 | 73 |
| 71 // Updates the label text and the shortcut text. | 74 // Updates the label text and the shortcut text. |
| 72 void Update(bool caps_lock_enabled) { | 75 void Update(bool caps_lock_enabled) { |
| 73 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 76 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| 74 const int text_string_id = caps_lock_enabled | 77 const int text_string_id = caps_lock_enabled |
| 75 ? IDS_ASH_STATUS_TRAY_CAPS_LOCK_ENABLED | 78 ? IDS_ASH_STATUS_TRAY_CAPS_LOCK_ENABLED |
| 76 : IDS_ASH_STATUS_TRAY_CAPS_LOCK_DISABLED; | 79 : IDS_ASH_STATUS_TRAY_CAPS_LOCK_DISABLED; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 227 |
| 225 void TrayCapsLock::DestroyDefaultView() { | 228 void TrayCapsLock::DestroyDefaultView() { |
| 226 default_ = NULL; | 229 default_ = NULL; |
| 227 } | 230 } |
| 228 | 231 |
| 229 void TrayCapsLock::DestroyDetailedView() { | 232 void TrayCapsLock::DestroyDetailedView() { |
| 230 detailed_ = NULL; | 233 detailed_ = NULL; |
| 231 } | 234 } |
| 232 | 235 |
| 233 } // namespace ash | 236 } // namespace ash |
| OLD | NEW |