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 30 matching lines...) Expand all Loading... |
41 public: | 41 public: |
42 CapsLockDefaultView() | 42 CapsLockDefaultView() |
43 : text_label_(new views::Label), shortcut_label_(new views::Label) { | 43 : text_label_(new views::Label), shortcut_label_(new views::Label) { |
44 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 44 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
45 kTrayPopupPaddingHorizontal, 0, | 45 kTrayPopupPaddingHorizontal, 0, |
46 kTrayPopupPaddingBetweenItems)); | 46 kTrayPopupPaddingBetweenItems)); |
47 | 47 |
48 FixedSizedImageView* image = | 48 FixedSizedImageView* image = |
49 new FixedSizedImageView(0, GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT)); | 49 new FixedSizedImageView(0, GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT)); |
50 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { | 50 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { |
51 image->SetImage(CreateVectorIcon(gfx::VectorIconId::SYSTEM_MENU_CAPS_LOCK, | 51 image->SetImage(gfx::CreateVectorIcon( |
52 kMenuIconSize, kMenuIconColor)); | 52 gfx::VectorIconId::SYSTEM_MENU_CAPS_LOCK, kMenuIconColor)); |
53 } else { | 53 } else { |
54 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 54 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
55 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_CAPS_LOCK_DARK) | 55 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_CAPS_LOCK_DARK) |
56 .ToImageSkia()); | 56 .ToImageSkia()); |
57 } | 57 } |
58 AddChildView(image); | 58 AddChildView(image); |
59 | 59 |
60 text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 60 text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
61 AddChildView(text_label_); | 61 AddChildView(text_label_); |
62 | 62 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 void TrayCapsLock::DestroyDefaultView() { | 223 void TrayCapsLock::DestroyDefaultView() { |
224 default_ = NULL; | 224 default_ = NULL; |
225 } | 225 } |
226 | 226 |
227 void TrayCapsLock::DestroyDetailedView() { | 227 void TrayCapsLock::DestroyDetailedView() { |
228 detailed_ = NULL; | 228 detailed_ = NULL; |
229 } | 229 } |
230 | 230 |
231 } // namespace ash | 231 } // namespace ash |
OLD | NEW |