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

Unified Diff: chrome/browser/upgrade_detector.cc

Issue 1676623002: Update upgrade app menu icons for MD/vectorization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reduce verbosity Created 4 years, 10 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 | « chrome/browser/upgrade_detector.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/upgrade_detector.cc
diff --git a/chrome/browser/upgrade_detector.cc b/chrome/browser/upgrade_detector.cc
index ab3a4cfaeb7c2191aaa85668e56a9608f3674510..23db83d8f6c2b38bd064ebe6a57d3268ec0ee0e8 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 @@ void UpgradeDetector::RegisterPrefs(PrefRegistrySimple* registry) {
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()
« no previous file with comments | « chrome/browser/upgrade_detector.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698