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

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

Issue 1514693006: Revert of Use a single views::MenuConfig instance for each platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase revert on https://codereview.chromium.org/1504743003 Created 5 years 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_item_view.cc ('k') | ui/views/controls/menu/menu_separator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_scroll_view_container.cc
diff --git a/ui/views/controls/menu/menu_scroll_view_container.cc b/ui/views/controls/menu/menu_scroll_view_container.cc
index 80a63af1e1109ae2febefccfbacbce18595dd855..4412a3307d381601d0d8374b9a86c7b294a72ceb 100644
--- a/ui/views/controls/menu/menu_scroll_view_container.cc
+++ b/ui/views/controls/menu/menu_scroll_view_container.cc
@@ -41,8 +41,9 @@ class MenuScrollButton : public View {
}
gfx::Size GetPreferredSize() const override {
- return gfx::Size(MenuConfig::instance().scroll_arrow_height * 2 - 1,
- pref_height_);
+ return gfx::Size(
+ host_->GetMenuItem()->GetMenuConfig().scroll_arrow_height * 2 - 1,
+ pref_height_);
}
bool CanDrop(const OSExchangeData& data) override {
@@ -70,7 +71,7 @@ class MenuScrollButton : public View {
}
void OnPaint(gfx::Canvas* canvas) override {
- const MenuConfig& config = MenuConfig::instance();
+ const MenuConfig& config = host_->GetMenuItem()->GetMenuConfig();
// The background.
gfx::Rect item_bounds(0, 0, width(), height());
@@ -249,7 +250,7 @@ void MenuScrollViewContainer::OnPaintBackground(gfx::Canvas* canvas) {
gfx::Rect bounds(0, 0, width(), height());
NativeTheme::ExtraParams extra;
- const MenuConfig& menu_config = MenuConfig::instance();
+ const MenuConfig& menu_config = content_view_->GetMenuItem()->GetMenuConfig();
extra.menu_background.corner_radius = menu_config.corner_radius;
GetNativeTheme()->Paint(canvas->sk_canvas(),
NativeTheme::kMenuPopupBackground, NativeTheme::kNormal, bounds, extra);
@@ -279,7 +280,8 @@ void MenuScrollViewContainer::CreateDefaultBorder() {
DCHECK_EQ(arrow_, BubbleBorder::NONE);
bubble_border_ = nullptr;
- const MenuConfig& menu_config = MenuConfig::instance();
+ const MenuConfig& menu_config =
+ content_view_->GetMenuItem()->GetMenuConfig();
int padding = menu_config.use_outer_border && menu_config.corner_radius > 0
? kBorderPaddingDueToRoundedCorners
« no previous file with comments | « ui/views/controls/menu/menu_item_view.cc ('k') | ui/views/controls/menu/menu_separator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698