Update upgrade app menu icons for MD/vectorization.
BUG=559407
TEST=chrome --simulate-critical-update --top-chrome-md=material
Review URL: https://codereview.chromium.org/1676623002
Cr-Commit-Position: refs/heads/master@{#374179}
diff --git a/chrome/browser/upgrade_detector.cc b/chrome/browser/upgrade_detector.cc
index ab3a4cf..23db83d 100644
--- a/chrome/browser/upgrade_detector.cc
+++ b/chrome/browser/upgrade_detector.cc
@@ -14,6 +14,9 @@
#include "components/prefs/pref_registry_simple.h"
#include "content/public/browser/notification_service.h"
#include "grit/theme_resources.h"
+#include "ui/gfx/color_palette.h"
+#include "ui/gfx/paint_vector_icon.h"
+#include "ui/gfx/vector_icons_public.h"
// How long to wait between checks for whether the user has been idle.
static const int kIdleRepeatingTimerWait = 10; // Minutes (seconds if testing).
@@ -36,23 +39,27 @@
registry->RegisterBooleanPref(prefs::kAttemptedToEnableAutoupdate, false);
}
-int UpgradeDetector::GetIconResourceID() {
+gfx::Image UpgradeDetector::GetIcon() {
+ SkColor color = gfx::kPlaceholderColor;
switch (upgrade_notification_stage_) {
case UPGRADE_ANNOYANCE_NONE:
- return 0;
+ return gfx::Image();
case UPGRADE_ANNOYANCE_LOW:
- return IDR_UPDATE_MENU_SEVERITY_LOW;
+ color = gfx::kGoogleGreen700;
+ break;
case UPGRADE_ANNOYANCE_ELEVATED:
- return IDR_UPDATE_MENU_SEVERITY_MEDIUM;
+ color = gfx::kGoogleYellow700;
+ break;
case UPGRADE_ANNOYANCE_HIGH:
- return IDR_UPDATE_MENU_SEVERITY_HIGH;
case UPGRADE_ANNOYANCE_SEVERE:
- return IDR_UPDATE_MENU_SEVERITY_HIGH;
case UPGRADE_ANNOYANCE_CRITICAL:
- return IDR_UPDATE_MENU_SEVERITY_HIGH;
+ color = gfx::kGoogleRed700;
+ break;
}
- NOTREACHED();
- return 0;
+ DCHECK_NE(gfx::kPlaceholderColor, color);
+
+ return gfx::Image(
+ gfx::CreateVectorIcon(gfx::VectorIconId::UPGRADE_MENU_ITEM, 16, color));
}
UpgradeDetector::UpgradeDetector()