| 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 22 matching lines...) Expand all Loading... |
| 33 chromeos::input_method::InputMethodManager::Get(); | 33 chromeos::input_method::InputMethodManager::Get(); |
| 34 return (ime && ime->GetImeKeyboard()) | 34 return (ime && ime->GetImeKeyboard()) |
| 35 ? ime->GetImeKeyboard()->CapsLockIsEnabled() | 35 ? ime->GetImeKeyboard()->CapsLockIsEnabled() |
| 36 : false; | 36 : false; |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 | 39 |
| 40 class CapsLockDefaultView : public ActionableView { | 40 class CapsLockDefaultView : public ActionableView { |
| 41 public: | 41 public: |
| 42 CapsLockDefaultView() | 42 CapsLockDefaultView() |
| 43 : text_label_(new views::Label), shortcut_label_(new views::Label) { | 43 : ActionableView(nullptr), |
| 44 text_label_(new views::Label), |
| 45 shortcut_label_(new views::Label) { |
| 44 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 46 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
| 45 kTrayPopupPaddingHorizontal, 0, | 47 kTrayPopupPaddingHorizontal, 0, |
| 46 kTrayPopupPaddingBetweenItems)); | 48 kTrayPopupPaddingBetweenItems)); |
| 47 | 49 |
| 48 FixedSizedImageView* image = | 50 FixedSizedImageView* image = |
| 49 new FixedSizedImageView(0, GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT)); | 51 new FixedSizedImageView(0, GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT)); |
| 50 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { | 52 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { |
| 51 image->SetImage( | 53 image->SetImage( |
| 52 gfx::CreateVectorIcon(kSystemMenuCapsLockIcon, kMenuIconColor)); | 54 gfx::CreateVectorIcon(kSystemMenuCapsLockIcon, kMenuIconColor)); |
| 53 } else { | 55 } else { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 224 |
| 223 void TrayCapsLock::DestroyDefaultView() { | 225 void TrayCapsLock::DestroyDefaultView() { |
| 224 default_ = NULL; | 226 default_ = NULL; |
| 225 } | 227 } |
| 226 | 228 |
| 227 void TrayCapsLock::DestroyDetailedView() { | 229 void TrayCapsLock::DestroyDetailedView() { |
| 228 detailed_ = NULL; | 230 detailed_ = NULL; |
| 229 } | 231 } |
| 230 | 232 |
| 231 } // namespace ash | 233 } // namespace ash |
| OLD | NEW |