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/tray/tray_item_more.h" | 5 #include "ash/common/system/tray/tray_item_more.h" |
6 | 6 |
7 #include "ash/common/system/tray/system_tray_item.h" | 7 #include "ash/common/system/tray/system_tray_item.h" |
8 #include "ash/common/system/tray/tray_constants.h" | 8 #include "ash/common/system/tray/tray_constants.h" |
9 #include "ash/common/system/tray/tray_popup_item_style.h" | 9 #include "ash/common/system/tray/tray_popup_item_style.h" |
10 #include "ash/common/system/tray/tray_popup_utils.h" | 10 #include "ash/common/system/tray/tray_popup_utils.h" |
11 #include "ash/common/system/tray/tri_view.h" | 11 #include "ash/common/system/tray/tri_view.h" |
12 #include "ash/resources/vector_icons/vector_icons.h" | |
13 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
14 #include "ui/accessibility/ax_node_data.h" | 13 #include "ui/accessibility/ax_node_data.h" |
15 #include "ui/gfx/image/image.h" | 14 #include "ui/gfx/image/image.h" |
16 #include "ui/gfx/paint_vector_icon.h" | |
17 #include "ui/views/controls/image_view.h" | 15 #include "ui/views/controls/image_view.h" |
18 #include "ui/views/controls/label.h" | 16 #include "ui/views/controls/label.h" |
19 #include "ui/views/layout/fill_layout.h" | 17 #include "ui/views/layout/fill_layout.h" |
20 | 18 |
21 namespace ash { | 19 namespace ash { |
22 | 20 |
23 TrayItemMore::TrayItemMore(SystemTrayItem* owner) | 21 TrayItemMore::TrayItemMore(SystemTrayItem* owner) |
24 : ActionableView(owner, TrayPopupInkDropStyle::FILL_BOUNDS), | 22 : ActionableView(owner, TrayPopupInkDropStyle::FILL_BOUNDS), |
25 tri_view_(TrayPopupUtils::CreateDefaultRowView()), | 23 tri_view_(TrayPopupUtils::CreateDefaultRowView()), |
26 icon_(TrayPopupUtils::CreateMainImageView()), | 24 icon_(TrayPopupUtils::CreateMainImageView()), |
27 label_(TrayPopupUtils::CreateDefaultLabel()), | 25 label_(TrayPopupUtils::CreateDefaultLabel()), |
28 more_(TrayPopupUtils::CreateMoreImageView()) { | 26 more_(TrayPopupUtils::CreateMoreImageView()) { |
29 AddChildView(tri_view_); | 27 AddChildView(tri_view_); |
30 SetLayoutManager(new views::FillLayout); | 28 SetLayoutManager(new views::FillLayout); |
31 | 29 |
32 more_->SetImage( | |
33 gfx::CreateVectorIcon(kSystemMenuArrowRightIcon, kMenuIconColor)); | |
34 | |
35 tri_view_->AddView(TriView::Container::START, icon_); | 30 tri_view_->AddView(TriView::Container::START, icon_); |
36 tri_view_->AddView(TriView::Container::CENTER, label_); | 31 tri_view_->AddView(TriView::Container::CENTER, label_); |
37 tri_view_->AddView(TriView::Container::END, more_); | 32 tri_view_->AddView(TriView::Container::END, more_); |
38 | 33 |
39 SetInkDropMode(InkDropHostView::InkDropMode::ON); | 34 SetInkDropMode(InkDropHostView::InkDropMode::ON); |
40 } | 35 } |
41 | 36 |
42 TrayItemMore::~TrayItemMore() {} | 37 TrayItemMore::~TrayItemMore() {} |
43 | 38 |
44 void TrayItemMore::SetLabel(const base::string16& label) { | 39 void TrayItemMore::SetLabel(const base::string16& label) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 tri_view_->SetContainerVisible(TriView::Container::END, enabled()); | 84 tri_view_->SetContainerVisible(TriView::Container::END, enabled()); |
90 UpdateStyle(); | 85 UpdateStyle(); |
91 } | 86 } |
92 | 87 |
93 void TrayItemMore::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 88 void TrayItemMore::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
94 ActionableView::OnNativeThemeChanged(theme); | 89 ActionableView::OnNativeThemeChanged(theme); |
95 UpdateStyle(); | 90 UpdateStyle(); |
96 } | 91 } |
97 | 92 |
98 } // namespace ash | 93 } // namespace ash |
OLD | NEW |