Chromium Code Reviews| Index: ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java |
| diff --git a/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java b/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java |
| index 014192a55761ddf6912c2fca3641c807671bbfde..16d6b9b11303ce02e994d9cb7d2c7c3bff25bc79 100644 |
| --- a/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java |
| +++ b/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java |
| @@ -15,14 +15,18 @@ class DropdownDividerDrawable extends Drawable { |
| private Paint mPaint; |
| private Rect mDividerRect; |
| + // Paints canvas with |mBackgroundColor|, if |mBackgroundColor| is not 0. |
|
Theresa
2016/12/08 18:26:20
This should go as a JavaDoc on the constructor.
|
| + private int mBackgroundColor; |
| - public DropdownDividerDrawable() { |
| + public DropdownDividerDrawable(int backgroundColor) { |
| mPaint = new Paint(); |
| mDividerRect = new Rect(); |
| + mBackgroundColor = backgroundColor; |
| } |
| @Override |
| public void draw(Canvas canvas) { |
| + if (mBackgroundColor != 0) canvas.drawColor(mBackgroundColor); |
| canvas.drawRect(mDividerRect, mPaint); |
| } |
| @@ -35,7 +39,7 @@ class DropdownDividerDrawable extends Drawable { |
| mDividerRect.set(0, 0, mDividerRect.right, height); |
| } |
| - public void setColor(int color) { |
| + public void setDividerColor(int color) { |
| mPaint.setColor(color); |
| } |