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

Unified Diff: ui/native_theme/native_theme_base.cc

Issue 2655553003: Native themes: Add menu separator part (Closed)
Patch Set: Created 3 years, 11 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/native_theme_base.cc
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index ddf2128cbd446991458e4fe61cf35b84b6de1161..a545f0e80df4383593d9e444609d68c4118ec937 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -184,6 +184,9 @@ void NativeThemeBase::Paint(SkCanvas* canvas,
case kMenuPopupBackground:
PaintMenuPopupBackground(canvas, rect.size(), extra.menu_background);
break;
+ case kMenuPopupSeparator:
+ PaintMenuSeparator(canvas, state, rect, extra.menu_separator);
+ break;
case kMenuItemBackground:
PaintMenuItemBackground(canvas, state, rect, extra.menu_item);
break;
@@ -774,6 +777,16 @@ void NativeThemeBase::PaintMenuItemBackground(
// By default don't draw anything over the normal background.
}
+void NativeThemeBase::PaintMenuSeparator(
+ SkCanvas* canvas,
+ State state,
+ const gfx::Rect& rect,
+ const MenuSeparatorExtraParams& menu_separator) const {
sky 2017/01/25 21:57:22 Why is there rect and menu_separator.paint_rect? A
Tom (Use chromium acct) 2017/01/25 22:25:44 rect is the region the paint context is clipped to
+ SkPaint paint;
+ paint.setColor(GetSystemColor(ui::NativeTheme::kColorId_MenuSeparatorColor));
+ canvas->drawRect(gfx::RectToSkRect(*menu_separator.paint_rect), paint);
+}
+
void NativeThemeBase::PaintSliderTrack(SkCanvas* canvas,
State state,
const gfx::Rect& rect,

Powered by Google App Engine
This is Rietveld 408576698