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

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

Issue 1477253002: Use a single views::MenuConfig instance for each platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add menu_config_android 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 4412a3307d381601d0d8374b9a86c7b294a72ceb..80a63af1e1109ae2febefccfbacbce18595dd855 100644
--- a/ui/views/controls/menu/menu_scroll_view_container.cc
+++ b/ui/views/controls/menu/menu_scroll_view_container.cc
@@ -41,9 +41,8 @@ class MenuScrollButton : public View {
}
gfx::Size GetPreferredSize() const override {
- return gfx::Size(
- host_->GetMenuItem()->GetMenuConfig().scroll_arrow_height * 2 - 1,
- pref_height_);
+ return gfx::Size(MenuConfig::instance().scroll_arrow_height * 2 - 1,
+ pref_height_);
}
bool CanDrop(const OSExchangeData& data) override {
@@ -71,7 +70,7 @@ class MenuScrollButton : public View {
}
void OnPaint(gfx::Canvas* canvas) override {
- const MenuConfig& config = host_->GetMenuItem()->GetMenuConfig();
+ const MenuConfig& config = MenuConfig::instance();
// The background.
gfx::Rect item_bounds(0, 0, width(), height());
@@ -250,7 +249,7 @@ void MenuScrollViewContainer::OnPaintBackground(gfx::Canvas* canvas) {
gfx::Rect bounds(0, 0, width(), height());
NativeTheme::ExtraParams extra;
- const MenuConfig& menu_config = content_view_->GetMenuItem()->GetMenuConfig();
+ const MenuConfig& menu_config = MenuConfig::instance();
extra.menu_background.corner_radius = menu_config.corner_radius;
GetNativeTheme()->Paint(canvas->sk_canvas(),
NativeTheme::kMenuPopupBackground, NativeTheme::kNormal, bounds, extra);
@@ -280,8 +279,7 @@ void MenuScrollViewContainer::CreateDefaultBorder() {
DCHECK_EQ(arrow_, BubbleBorder::NONE);
bubble_border_ = nullptr;
- const MenuConfig& menu_config =
- content_view_->GetMenuItem()->GetMenuConfig();
+ const MenuConfig& menu_config = MenuConfig::instance();
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