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

Unified Diff: ui/native_theme/native_theme_base.cc

Issue 2655553003: Native themes: Add menu separator part (Closed)
Patch Set: item->separator 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
« no previous file with comments | « ui/native_theme/native_theme_base.h ('k') | ui/native_theme/native_theme_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ec5b30a6800a35197a7f5210787cb732e70118e2..b9718490f9ad7cd4682fdab5b9e879ec0bd902ba 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -186,6 +186,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;
@@ -776,6 +779,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 {
+ 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,
« no previous file with comments | « ui/native_theme/native_theme_base.h ('k') | ui/native_theme/native_theme_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698