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

Unified Diff: ui/views/controls/menu/menu_separator_win.cc

Issue 1454583002: Change Views menus to consistently use GetNativeTheme for theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get menu config from item Created 5 years, 1 month 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/views/controls/menu/menu_scroll_view_container.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_separator_win.cc
diff --git a/ui/views/controls/menu/menu_separator_win.cc b/ui/views/controls/menu/menu_separator_win.cc
index ebbb38c882a587f354773fe8c517085fca794bd8..182cc2b3294aa403bc06057e2673943270a433ad 100644
--- a/ui/views/controls/menu/menu_separator_win.cc
+++ b/ui/views/controls/menu/menu_separator_win.cc
@@ -13,22 +13,19 @@
#include "ui/gfx/win/dpi.h"
#include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_aura.h"
-#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/controls/menu/menu_item_view.h"
namespace views {
void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
- const MenuConfig& config = parent_menu_item_->GetMenuConfig();
-
- if (config.native_theme == ui::NativeThemeAura::instance()) {
+ ui::NativeTheme* native_theme = GetNativeTheme();
+ if (native_theme == ui::NativeThemeAura::instance()) {
OnPaintAura(canvas);
return;
}
gfx::Rect separator_bounds = GetPaintBounds();
-
// Hack to get the separator to display correctly on Windows where we may
// have fractional scales. We move the separator 1 pixel down to ensure that
// it falls within the clipping rect which is scaled up.
@@ -39,7 +36,7 @@ void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
separator_bounds.set_y(1);
ui::NativeTheme::ExtraParams extra;
- config.native_theme->Paint(
+ native_theme->Paint(
canvas->sk_canvas(), ui::NativeTheme::kMenuPopupSeparator,
ui::NativeTheme::kNormal, separator_bounds, extra);
}
« no previous file with comments | « ui/views/controls/menu/menu_scroll_view_container.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698