OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/screen_security/screen_tray_item.h" | 5 #include "ash/common/system/chromeos/screen_security/screen_tray_item.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/shelf/wm_shelf_util.h" | 8 #include "ash/common/shelf/wm_shelf_util.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/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
| 11 #include "ash/resources/vector_icons/vector_icons.h" |
11 #include "grit/ash_resources.h" | 12 #include "grit/ash_resources.h" |
12 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
13 #include "ui/gfx/paint_vector_icon.h" | 14 #include "ui/gfx/paint_vector_icon.h" |
14 #include "ui/gfx/vector_icons_public.h" | |
15 #include "ui/message_center/message_center.h" | 15 #include "ui/message_center/message_center.h" |
16 #include "ui/views/controls/label.h" | 16 #include "ui/views/controls/label.h" |
17 #include "ui/views/layout/box_layout.h" | 17 #include "ui/views/layout/box_layout.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 const int kStopButtonRightPadding = 18; | 20 const int kStopButtonRightPadding = 18; |
21 } // namespace | 21 } // namespace |
22 | 22 |
23 namespace ash { | 23 namespace ash { |
24 namespace tray { | 24 namespace tray { |
25 | 25 |
26 // ScreenTrayView implementations. | 26 // ScreenTrayView implementations. |
27 ScreenTrayView::ScreenTrayView(ScreenTrayItem* screen_tray_item) | 27 ScreenTrayView::ScreenTrayView(ScreenTrayItem* screen_tray_item) |
28 : TrayItemView(screen_tray_item), screen_tray_item_(screen_tray_item) { | 28 : TrayItemView(screen_tray_item), screen_tray_item_(screen_tray_item) { |
29 CreateImageView(); | 29 CreateImageView(); |
30 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { | 30 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { |
31 image_view()->SetImage(gfx::CreateVectorIcon( | 31 image_view()->SetImage( |
32 gfx::VectorIconId::SYSTEM_TRAY_SCREEN_SHARE, kTrayIconColor)); | 32 gfx::CreateVectorIcon(kSystemTrayScreenShareIcon, kTrayIconColor)); |
33 } else { | 33 } else { |
34 image_view()->SetImage(ui::ResourceBundle::GetSharedInstance() | 34 image_view()->SetImage(ui::ResourceBundle::GetSharedInstance() |
35 .GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE) | 35 .GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE) |
36 .ToImageSkia()); | 36 .ToImageSkia()); |
37 } | 37 } |
38 Update(); | 38 Update(); |
39 } | 39 } |
40 | 40 |
41 ScreenTrayView::~ScreenTrayView() {} | 41 ScreenTrayView::~ScreenTrayView() {} |
42 | 42 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 void ScreenStatusView::CreateItems() { | 89 void ScreenStatusView::CreateItems() { |
90 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); | 90 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); |
91 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 91 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
92 kTrayPopupPaddingHorizontal, 0, | 92 kTrayPopupPaddingHorizontal, 0, |
93 kTrayPopupPaddingBetweenItems)); | 93 kTrayPopupPaddingBetweenItems)); |
94 | 94 |
95 icon_ = new FixedSizedImageView(0, GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT)); | 95 icon_ = new FixedSizedImageView(0, GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT)); |
96 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { | 96 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { |
97 icon_->SetImage(gfx::CreateVectorIcon( | 97 icon_->SetImage( |
98 gfx::VectorIconId::SYSTEM_MENU_SCREEN_SHARE, kMenuIconColor)); | 98 gfx::CreateVectorIcon(kSystemMenuScreenShareIcon, kMenuIconColor)); |
99 } else { | 99 } else { |
100 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 100 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
101 icon_->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK) | 101 icon_->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK) |
102 .ToImageSkia()); | 102 .ToImageSkia()); |
103 } | 103 } |
104 AddChildView(icon_); | 104 AddChildView(icon_); |
105 | 105 |
106 label_ = new views::Label; | 106 label_ = new views::Label; |
107 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 107 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
108 label_->SetMultiLine(true); | 108 label_->SetMultiLine(true); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 // Center the item dependent on the orientation of the shelf. | 202 // Center the item dependent on the orientation of the shelf. |
203 views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment) | 203 views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment) |
204 ? views::BoxLayout::kHorizontal | 204 ? views::BoxLayout::kHorizontal |
205 : views::BoxLayout::kVertical; | 205 : views::BoxLayout::kVertical; |
206 tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); | 206 tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); |
207 tray_view_->Layout(); | 207 tray_view_->Layout(); |
208 } | 208 } |
209 | 209 |
210 } // namespace ash | 210 } // namespace ash |
OLD | NEW |