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

Unified Diff: ash/common/system/tray/tray_image_item.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/tray/label_tray_view.cc ('k') | ash/common/system/tray/tray_item_more.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_image_item.cc
diff --git a/ash/common/system/tray/tray_image_item.cc b/ash/common/system/tray/tray_image_item.cc
index 3def7618719fc31ef3c3e271bb0b32773edf455d..776b38f1ce7688881741cc4f6e14bfad92f71a6f 100644
--- a/ash/common/system/tray/tray_image_item.cc
+++ b/ash/common/system/tray/tray_image_item.cc
@@ -10,11 +10,11 @@
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_item_view.h"
#include "ash/common/system/tray/tray_utils.h"
+#include "ash/resources/vector_icons/vector_icons.h"
#include "grit/ash_resources.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/paint_vector_icon.h"
-#include "ui/gfx/vector_icons_public.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/layout/box_layout.h"
@@ -22,34 +22,33 @@ 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) {
switch (resource_id) {
case IDR_AURA_UBER_TRAY_ACCESSIBILITY:
- return gfx::VectorIconId::SYSTEM_TRAY_ACCESSIBILITY;
+ return kSystemTrayAccessibilityIcon;
case IDR_AURA_UBER_TRAY_UPDATE:
- return gfx::VectorIconId::SYSTEM_TRAY_UPDATE;
+ return kSystemTrayUpdateIcon;
case IDR_AURA_UBER_TRAY_VOLUME_MUTE:
- return gfx::VectorIconId::SYSTEM_TRAY_VOLUME_MUTE;
+ return kSystemTrayVolumeMuteIcon;
#if defined(OS_CHROMEOS)
case IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED:
- return gfx::VectorIconId::SYSTEM_TRAY_ROTATION_LOCK_LOCKED;
+ return kSystemTrayRotationLockLockedIcon;
case IDR_AURA_UBER_TRAY_CAPS_LOCK:
- return gfx::VectorIconId::SYSTEM_TRAY_CAPS_LOCK;
+ return kSystemTrayCapsLockIcon;
case IDR_AURA_UBER_TRAY_TRACING:
// TODO(tdanderson): Update the icon used for tracing or remove it from
// the system tray. See crbug.com/625691.
- return gfx::VectorIconId::CODE;
+ return kSystemMenuTimerIcon;
#endif
default:
NOTREACHED();
break;
}
- return vector_id;
+ return gfx::kNoneIcon;
}
} // namespace
@@ -126,7 +125,7 @@ void TrayImageItem::UpdateImageOnImageView() {
if (MaterialDesignController::UseMaterialDesignSystemIcons()) {
tray_view_->image_view()->SetImage(gfx::CreateVectorIcon(
- ResourceIdToVectorIconId(resource_id_), kTrayIconSize, icon_color_));
+ ResourceIdToVectorIcon(resource_id_), kTrayIconSize, icon_color_));
} else {
tray_view_->image_view()->SetImage(ui::ResourceBundle::GetSharedInstance()
.GetImageNamed(resource_id_)
« no previous file with comments | « ash/common/system/tray/label_tray_view.cc ('k') | ash/common/system/tray/tray_item_more.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698