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

Unified Diff: ui/native_theme/common_theme.cc

Issue 1661673004: Enables hot-tracking for overflow extension buttons in the app menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restores hot-tracking of extension buttons in app menu with MD (win build) 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
Index: ui/native_theme/common_theme.cc
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
index 2c1dd9af988de3fa65de27555c1be98a2f432d9d..50dba800b87ff4840377132389951c9632db42eb 100644
--- a/ui/native_theme/common_theme.cc
+++ b/ui/native_theme/common_theme.cc
@@ -460,9 +460,11 @@ void CommonThemePaintMenuBackground(SkCanvas* canvas, const gfx::Rect& rect) {
canvas->drawRect(gfx::RectToSkRect(rect), paint);
}
-void CommonThemePaintMenuItemBackground(SkCanvas* canvas,
- NativeTheme::State state,
- const gfx::Rect& rect) {
+void CommonThemePaintMenuItemBackground(
+ SkCanvas* canvas,
+ NativeTheme::State state,
+ const gfx::Rect& rect,
+ const NativeTheme::MenuItemExtraParams& menu_item) {
SkPaint paint;
switch (state) {
case NativeTheme::kNormal:
@@ -478,6 +480,11 @@ void CommonThemePaintMenuItemBackground(SkCanvas* canvas,
NOTREACHED() << "Invalid state " << state;
break;
}
+ if (menu_item.corner_radius > 0) {
+ const SkScalar radius = SkIntToScalar(menu_item.corner_radius);
+ canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint);
+ return;
+ }
canvas->drawRect(gfx::RectToSkRect(rect), paint);
}

Powered by Google App Engine
This is Rietveld 408576698