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

Unified Diff: chrome/browser/ui/views/toolbar/app_menu_button.cc

Issue 1966643002: Integrate new MD update menu icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates based on feedback. Created 4 years, 6 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/ui/views/toolbar/app_menu_button.h ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/app_menu_button.cc
diff --git a/chrome/browser/ui/views/toolbar/app_menu_button.cc b/chrome/browser/ui/views/toolbar/app_menu_button.cc
index 9db62bc1d38cccf88dee9237922739e7215db784..5e0aa5469f3c4f345119071084b644d992b0c138 100644
--- a/chrome/browser/ui/views/toolbar/app_menu_button.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu_button.cc
@@ -11,6 +11,7 @@
#include "base/time/time.h"
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_otr_state.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/toolbar/app_menu_model.h"
#include "chrome/browser/ui/views/extensions/browser_action_drag_data.h"
@@ -50,10 +51,12 @@ AppMenuButton::AppMenuButton(ToolbarView* toolbar_view)
AppMenuButton::~AppMenuButton() {}
-void AppMenuButton::SetSeverity(AppMenuIconPainter::Severity severity,
+void AppMenuButton::SetSeverity(AppMenuBadgeController::BadgeType type,
+ AppMenuIconPainter::Severity severity,
bool animate) {
if (ui::MaterialDesignController::IsModeMaterial()) {
severity_ = severity;
+ type_ = type;
UpdateIcon();
return;
}
@@ -133,7 +136,9 @@ void AppMenuButton::ScheduleAppMenuIconPaint() {
}
void AppMenuButton::UpdateIcon() {
+ using BadgeType = AppMenuBadgeController::BadgeType;
DCHECK(ui::MaterialDesignController::IsModeMaterial());
+ gfx::VectorIconId icon_id = gfx::VectorIconId::BROWSER_TOOLS;
SkColor color = gfx::kPlaceholderColor;
switch (severity_) {
case AppMenuIconPainter::SEVERITY_NONE:
@@ -151,8 +156,17 @@ void AppMenuButton::UpdateIcon() {
break;
}
+ if (severity_ != AppMenuIconPainter::SEVERITY_NONE) {
Evan Stade 2016/06/03 19:31:26 why this check? Wouldn't type_ be NONE in this cas
kylix_rd 2016/06/03 19:50:43 The code was assuming that if the severity_ is NON
+ if (type_ == BadgeType::GLOBAL_ERROR)
+ icon_id = gfx::VectorIconId::UPDATE_MENU_FAILED;
+ else if (type_ == BadgeType::INCOMPATIBILITY_WARNING)
+ icon_id = gfx::VectorIconId::UPDATE_MENU_SEVERITY_WARNING;
+ else
+ icon_id = gfx::VectorIconId::UPDATE_MENU_SEVERITY_LOW_MEDIUM_HIGH;
+ }
+
SetImage(views::Button::STATE_NORMAL,
- gfx::CreateVectorIcon(gfx::VectorIconId::BROWSER_TOOLS, color));
+ gfx::CreateVectorIcon(icon_id, 16, color));
}
void AppMenuButton::SetTrailingMargin(int margin) {
« no previous file with comments | « chrome/browser/ui/views/toolbar/app_menu_button.h ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698