summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authortkent <tkent@chromium.org>2015-10-22 18:40:30 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-23 01:42:06 +0000
commit12a2855d605f20e3e7803e4e6ffad259201e204c (patch)
treed7d1a9eabf0844c56d210cbeca3715550ad380d0 /ui
parent420365ec7a110b90ed4b0d47e5db5c409ade176a (diff)
downloadchromium_src-12a2855d605f20e3e7803e4e6ffad259201e204c.zip
chromium_src-12a2855d605f20e3e7803e4e6ffad259201e204c.tar.gz
chromium_src-12a2855d605f20e3e7803e4e6ffad259201e204c.tar.bz2
native_theme: Support variable size of menulist arrow.
Blink specifies the fixed arrowSize, and pass it to native_theme. This CL is a preparation to fix crbug.com/432795, and has no behavior changes yet. BUG=432795 Review URL: https://codereview.chromium.org/1414343004 Cr-Commit-Position: refs/heads/master@{#355702}
Diffstat (limited to 'ui')
-rw-r--r--ui/native_theme/native_theme.h1
-rw-r--r--ui/native_theme/native_theme_base.cc10
2 files changed, 5 insertions, 6 deletions
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 8ae7efe..d08f904 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -135,6 +135,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
bool has_border_radius;
int arrow_x;
int arrow_y;
+ int arrow_size;
SkColor background_color;
int classic_state; // Used on Windows when uxtheme is not available.
};
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index b0ea085..7911826 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -774,14 +774,12 @@ void NativeThemeBase::PaintMenuList(
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kFill_Style);
- static const int kArrowWidth = 6;
- static const int kArrowHeight = 6;
-
+ int arrow_size = menu_list.arrow_size;
gfx::Rect arrow(
menu_list.arrow_x,
- menu_list.arrow_y - (kArrowHeight / 2),
- kArrowWidth,
- kArrowHeight);
+ menu_list.arrow_y - (arrow_size / 2),
+ arrow_size,
+ arrow_size);
// Constrain to the paint rect.
arrow.Intersect(rect);