Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Unified Diff: ash/common/system/tray/label_tray_view.cc

Issue 2316183003: Move a bunch of ash-only vector icons to ash/. (Closed)
Patch Set: drop the "id". Just "icon". It's cleaner. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/system/chromeos/tray_caps_lock.cc ('k') | ash/common/system/tray/tray_image_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bb93c5c027ae421809b3502ea96f75c1b423d671 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"
@@ -21,28 +21,27 @@ namespace ash {
namespace {
-// Maps a non-MD PNG resource id to its corresponding MD vector icon id.
+// Maps a non-MD PNG resource id to its corresponding MD vector icon.
// 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 */);
« no previous file with comments | « ash/common/system/chromeos/tray_caps_lock.cc ('k') | ash/common/system/tray/tray_image_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698