| Index: ash/system/tray/tray_details_view.cc
|
| diff --git a/ash/system/tray/tray_details_view.cc b/ash/system/tray/tray_details_view.cc
|
| index fee3c723c106d63cc1454d702929a9e98886fbf6..62837ceb1df4f23497bb182bac1429b383d3e04d 100644
|
| --- a/ash/system/tray/tray_details_view.cc
|
| +++ b/ash/system/tray/tray_details_view.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "ash/ash_view_ids.h"
|
| #include "ash/strings/grit/ash_strings.h"
|
| +#include "ash/system/tray/hover_highlight_view.h"
|
| #include "ash/system/tray/system_menu_button.h"
|
| #include "ash/system/tray/system_tray.h"
|
| #include "ash/system/tray/system_tray_item.h"
|
| @@ -20,9 +21,14 @@
|
| #include "ui/compositor/paint_context.h"
|
| #include "ui/compositor/paint_recorder.h"
|
| #include "ui/gfx/canvas.h"
|
| +#include "ui/gfx/image/image_skia.h"
|
| +#include "ui/gfx/paint_vector_icon.h"
|
| #include "ui/gfx/skia_paint_util.h"
|
| +#include "ui/gfx/vector_icon_types.h"
|
| +#include "ui/native_theme/native_theme.h"
|
| #include "ui/views/background.h"
|
| #include "ui/views/border.h"
|
| +#include "ui/views/controls/image_view.h"
|
| #include "ui/views/controls/label.h"
|
| #include "ui/views/controls/progress_bar.h"
|
| #include "ui/views/controls/scroll_view.h"
|
| @@ -303,6 +309,50 @@ void TrayDetailsView::CreateScrollableList() {
|
| box_layout_->SetFlexForView(scroller_, 1);
|
| }
|
|
|
| +HoverHighlightView* TrayDetailsView::AddScrollListItem(
|
| + const gfx::VectorIcon& icon,
|
| + const base::string16& text) {
|
| + HoverHighlightView* item = new HoverHighlightView(this);
|
| + if (icon.is_empty())
|
| + item->AddLabelRow(text);
|
| + else
|
| + item->AddIconAndLabel(gfx::CreateVectorIcon(icon, kMenuIconColor), text);
|
| + scroll_content_->AddChildView(item);
|
| + return item;
|
| +}
|
| +
|
| +HoverHighlightView* TrayDetailsView::AddScrollListCheckableItem(
|
| + const gfx::VectorIcon& icon,
|
| + const base::string16& text,
|
| + bool checked) {
|
| + HoverHighlightView* item = AddScrollListItem(icon, text);
|
| + TrayPopupUtils::InitializeAsCheckableRow(item, checked);
|
| + return item;
|
| +}
|
| +
|
| +TriView* TrayDetailsView::AddScrollListSubHeader(const gfx::VectorIcon& icon,
|
| + const base::string16& text) {
|
| + TriView* header = TrayPopupUtils::CreateSubHeaderRowView(icon.is_empty());
|
| + TrayPopupUtils::ConfigureAsStickyHeader(header);
|
| +
|
| + views::Label* label = TrayPopupUtils::CreateDefaultLabel();
|
| + label->SetText(text);
|
| + TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::SUB_HEADER);
|
| + style.SetupLabel(label);
|
| + header->AddView(TriView::Container::CENTER, label);
|
| +
|
| + if (!icon.is_empty()) {
|
| + views::ImageView* image_view = TrayPopupUtils::CreateMainImageView();
|
| + image_view->SetImage(gfx::CreateVectorIcon(
|
| + icon, GetNativeTheme()->GetSystemColor(
|
| + ui::NativeTheme::kColorId_ProminentButtonColor)));
|
| + header->AddView(TriView::Container::START, image_view);
|
| + }
|
| +
|
| + scroll_content_->AddChildView(header);
|
| + return header;
|
| +}
|
| +
|
| void TrayDetailsView::Reset() {
|
| RemoveAllChildViews(true);
|
| scroller_ = nullptr;
|
|
|