Chromium Code Reviews| Index: ash/common/system/tray/label_tray_view.cc |
| diff --git a/ash/common/system/tray/label_tray_view.cc b/ash/common/system/tray/label_tray_view.cc |
| index 39dc1349c3e054d14ffc95c2979f19fb6259978b..a8ffcbdd308ceaf62afb2116d7dd2b5572bd977c 100644 |
| --- a/ash/common/system/tray/label_tray_view.cc |
| +++ b/ash/common/system/tray/label_tray_view.cc |
| @@ -8,11 +8,11 @@ |
| #include "ash/common/system/tray/hover_highlight_view.h" |
| #include "ash/common/system/tray/tray_constants.h" |
| #include "ash/common/system/tray/view_click_listener.h" |
| +#include "ash/resources/vector_icons/vector_icons.h" |
| #include "grit/ash_resources.h" |
| #include "ui/base/resource/resource_bundle.h" |
| #include "ui/gfx/font.h" |
| #include "ui/gfx/paint_vector_icon.h" |
| -#include "ui/gfx/vector_icons_public.h" |
| #include "ui/views/border.h" |
| #include "ui/views/controls/label.h" |
| #include "ui/views/layout/fill_layout.h" |
| @@ -24,25 +24,24 @@ namespace { |
| // Maps a non-MD PNG resource id to its corresponding MD vector icon id. |
|
tdanderson
2016/09/07 22:36:13
nit: "to its corresponding MD vector icon id" -> m
Evan Stade
2016/09/07 22:41:51
Done.
|
| // TODO(tdanderson): Remove this once material design is enabled by |
| // default. See crbug.com/614453. |
| -gfx::VectorIconId ResourceIdToVectorIconId(int resource_id) { |
| - gfx::VectorIconId vector_id = gfx::VectorIconId::VECTOR_ICON_NONE; |
| +const gfx::VectorIcon& ResourceIdToVectorIcon(int resource_id) { |
| #if defined(OS_CHROMEOS) |
| switch (resource_id) { |
| case IDR_AURA_UBER_TRAY_ENTERPRISE: |
| - return gfx::VectorIconId::SYSTEM_MENU_BUSINESS; |
| + return kSystemMenuBusinessIcon; |
| case IDR_AURA_UBER_TRAY_BUBBLE_SESSION_LENGTH_LIMIT: |
| - return gfx::VectorIconId::SYSTEM_MENU_TIMER; |
| + return kSystemMenuTimerIcon; |
| case IDR_AURA_UBER_TRAY_CHILD_USER: |
| - return gfx::VectorIconId::SYSTEM_MENU_CHILD_USER; |
| + return kSystemMenuChildUserIcon; |
| case IDR_AURA_UBER_TRAY_SUPERVISED_USER: |
| - return gfx::VectorIconId::SYSTEM_MENU_SUPERVISED_USER; |
| + return kSystemMenuSupervisedUserIcon; |
| default: |
| NOTREACHED(); |
| break; |
| } |
| #endif // defined(OS_CHROMEOS) |
| - return vector_id; |
| + return gfx::kNoneIcon; |
| } |
| } // namespace |
| @@ -78,7 +77,7 @@ views::View* LabelTrayView::CreateChildView( |
| ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| gfx::ImageSkia icon = |
| MaterialDesignController::IsSystemTrayMenuMaterial() |
| - ? gfx::CreateVectorIcon(ResourceIdToVectorIconId(icon_resource_id_), |
| + ? gfx::CreateVectorIcon(ResourceIdToVectorIcon(icon_resource_id_), |
| kMenuIconColor) |
| : *rb.GetImageSkiaNamed(icon_resource_id_); |
| child->AddIconAndLabel(icon, message, false /* highlight */); |