summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-24 01:41:09 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-24 01:41:09 +0000
commit2ae019738a63bd7fa3f226e81ef2530edf50d1dc (patch)
tree34626cac9af0021c520d074ad320fc753c2ca0ac
parentd471d0f2e1307cc3207bb06fb116b1df4d07e97b (diff)
downloadchromium_src-2ae019738a63bd7fa3f226e81ef2530edf50d1dc.zip
chromium_src-2ae019738a63bd7fa3f226e81ef2530edf50d1dc.tar.gz
chromium_src-2ae019738a63bd7fa3f226e81ef2530edf50d1dc.tar.bz2
aura: Update scrollbar theme.
BUG=105894 TEST=manual TBR=sky Review URL: https://chromiumcodereview.appspot.com/9837072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128647 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/gfx/gfx_resources.grd50
-rw-r--r--ui/gfx/native_theme_aura.cc228
-rw-r--r--ui/gfx/native_theme_base.cc14
-rw-r--r--ui/gfx/native_theme_base.h8
-rw-r--r--ui/gfx/resources/chromeos_scroll_arrow_down.pngbin1129 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_arrow_down_h.pngbin1135 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_arrow_down_p.pngbin1192 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_arrow_up.pngbin1119 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_arrow_up_h.pngbin1128 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_arrow_up_p.pngbin1171 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_background.pngbin1012 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_background_border_down.pngbin1008 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_background_border_up.pngbin1008 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_thumb.pngbin1131 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_thumb_h.pngbin1147 -> 0 bytes
-rw-r--r--ui/gfx/resources/chromeos_scroll_thumb_p.pngbin1103 -> 0 bytes
16 files changed, 171 insertions, 129 deletions
diff --git a/ui/gfx/gfx_resources.grd b/ui/gfx/gfx_resources.grd
index aa9be6a..f74a710 100644
--- a/ui/gfx/gfx_resources.grd
+++ b/ui/gfx/gfx_resources.grd
@@ -50,23 +50,39 @@
<include name="IDR_PROGRESS_BORDER_LEFT" file="resources\linux-progress-border-left.png" type="BINDATA" />
<include name="IDR_PROGRESS_BORDER_RIGHT" file="resources\linux-progress-border-right.png" type="BINDATA" />
<include name="IDR_PROGRESS_VALUE" file="resources\linux-progress-value.png" type="BINDATA" />
- </if>
-
- <!-- Images used by ChromeOS. -->
- <!-- TODO(jamescook): Replace Linux images with Aura-specific ones. -->
- <if expr="pp_ifdef('chromeos') or pp_ifdef('use_aura')">
- <include name="IDR_SCROLL_ARROW_DOWN" file="resources\chromeos_scroll_arrow_down.png" type="BINDATA" />
- <include name="IDR_SCROLL_ARROW_DOWN_H" file="resources\chromeos_scroll_arrow_down_h.png" type="BINDATA" />
- <include name="IDR_SCROLL_ARROW_DOWN_P" file="resources\chromeos_scroll_arrow_down_p.png" type="BINDATA" />
- <include name="IDR_SCROLL_ARROW_UP" file="resources\chromeos_scroll_arrow_up.png" type="BINDATA" />
- <include name="IDR_SCROLL_ARROW_UP_H" file="resources\chromeos_scroll_arrow_up_h.png" type="BINDATA" />
- <include name="IDR_SCROLL_ARROW_UP_P" file="resources\chromeos_scroll_arrow_up_p.png" type="BINDATA" />
- <include name="IDR_SCROLL_BACKGROUND" file="resources\chromeos_scroll_background.png" type="BINDATA" />
- <include name="IDR_SCROLL_BACKGROUND_BORDER_UP" file="resources\chromeos_scroll_background_border_up.png" type="BINDATA" />
- <include name="IDR_SCROLL_BACKGROUND_BORDER_DOWN" file="resources\chromeos_scroll_background_border_down.png" type="BINDATA" />
- <include name="IDR_SCROLL_THUMB" file="resources\chromeos_scroll_thumb.png" type="BINDATA" />
- <include name="IDR_SCROLL_THUMB_H" file="resources\chromeos_scroll_thumb_h.png" type="BINDATA" />
- <include name="IDR_SCROLL_THUMB_P" file="resources\chromeos_scroll_thumb_p.png" type="BINDATA" />
+
+ <include name="IDR_SCROLL_BASE_CORNER" file="resources\aura_scrollbar_base_normal_edge.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_CORNER_H" file="resources\aura_scrollbar_base_hot_edge.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_HORIZONTAL_CENTER" file="resources\aura_scrollbar_base_horizontal_normal_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_HORIZONTAL_CENTER_H" file="resources\aura_scrollbar_base_horizontal_hot_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_HORIZONTAL_LEFT" file="resources\aura_scrollbar_base_horizontal_normal_left.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_HORIZONTAL_LEFT_H" file="resources\aura_scrollbar_base_horizontal_hot_left.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_HORIZONTAL_RIGHT" file="resources\aura_scrollbar_base_horizontal_normal_right.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_HORIZONTAL_RIGHT_H" file="resources\aura_scrollbar_base_horizontal_hot_right.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_VERTICAL_BOTTOM" file="resources\aura_scrollbar_base_vertical_normal_bottom.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_VERTICAL_BOTTOM_H" file="resources\aura_scrollbar_base_vertical_hot_bottom.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_VERTICAL_CENTER" file="resources\aura_scrollbar_base_vertical_normal_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_VERTICAL_CENTER_H" file="resources\aura_scrollbar_base_vertical_hot_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_VERTICAL_TOP" file="resources\aura_scrollbar_base_vertical_normal_top.png" type="BINDATA" />
+ <include name="IDR_SCROLL_BASE_VERTICAL_TOP_H" file="resources\aura_scrollbar_base_vertical_hot_top.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_HORIZONTAL_CENTER" file="resources\aura_scrollbar_thumb_horizontal_normal_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_HORIZONTAL_CENTER_H" file="resources\aura_scrollbar_thumb_horizontal_hot_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_HORIZONTAL_CENTER_P" file="resources\aura_scrollbar_thumb_horizontal_pressed_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_HORIZONTAL_LEFT" file="resources\aura_scrollbar_thumb_horizontal_normal_left.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_HORIZONTAL_LEFT_H" file="resources\aura_scrollbar_thumb_horizontal_hot_left.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_HORIZONTAL_LEFT_P" file="resources\aura_scrollbar_thumb_horizontal_pressed_left.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_HORIZONTAL_RIGHT" file="resources\aura_scrollbar_thumb_horizontal_normal_right.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_HORIZONTAL_RIGHT_H" file="resources\aura_scrollbar_thumb_horizontal_hot_right.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_HORIZONTAL_RIGHT_P" file="resources\aura_scrollbar_thumb_horizontal_pressed_right.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_VERTICAL_BOTTOM" file="resources\aura_scrollbar_thumb_vertical_normal_bottom.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_VERTICAL_BOTTOM_H" file="resources\aura_scrollbar_thumb_vertical_hot_bottom.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_VERTICAL_BOTTOM_P" file="resources\aura_scrollbar_thumb_vertical_pressed_bottom.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_VERTICAL_CENTER" file="resources\aura_scrollbar_thumb_vertical_normal_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_VERTICAL_CENTER_H" file="resources\aura_scrollbar_thumb_vertical_hot_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_VERTICAL_CENTER_P" file="resources\aura_scrollbar_thumb_vertical_pressed_center.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_VERTICAL_TOP" file="resources\aura_scrollbar_thumb_vertical_normal_top.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_VERTICAL_TOP_H" file="resources\aura_scrollbar_thumb_vertical_hot_top.png" type="BINDATA" />
+ <include name="IDR_SCROLL_THUMB_VERTICAL_TOP_P" file="resources\aura_scrollbar_thumb_vertical_pressed_top.png" type="BINDATA" />
</if>
</includes>
</release>
diff --git a/ui/gfx/native_theme_aura.cc b/ui/gfx/native_theme_aura.cc
index 8cc284c..0ae70d8 100644
--- a/ui/gfx/native_theme_aura.cc
+++ b/ui/gfx/native_theme_aura.cc
@@ -59,6 +59,8 @@ const NativeThemeAura* NativeThemeAura::instance() {
}
NativeThemeAura::NativeThemeAura() {
+ // We don't draw scrollbar buttons.
+ set_scrollbar_button_length(0);
}
NativeThemeAura::~NativeThemeAura() {
@@ -131,127 +133,145 @@ void NativeThemeAura::PaintScrollbarTrack(
const gfx::Rect& rect) const {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
if (part == kScrollbarVerticalTrack) {
- SkBitmap* background = rb.GetBitmapNamed(IDR_SCROLL_BACKGROUND);
- SkBitmap* border_up = rb.GetBitmapNamed(IDR_SCROLL_BACKGROUND_BORDER_UP);
- SkBitmap* border_down =
- rb.GetBitmapNamed(IDR_SCROLL_BACKGROUND_BORDER_DOWN);
- // Draw track background.
- DrawBitmapInt(
- canvas, *background,
- 0, 0, background->width(), 1,
- rect.x(), rect.y(), rect.width(), rect.height());
- // Draw up button lower border.
- canvas->drawBitmap(*border_up, extra_params.track_x, extra_params.track_y);
- // Draw down button upper border.
- canvas->drawBitmap(
- *border_down,
- extra_params.track_x,
- extra_params.track_y + extra_params.track_height - border_down->height()
- );
+ int center_offset = 0;
+ int center_height = rect.height();
+
+ if (rect.y() == extra_params.track_y) {
+ // TODO(derat): Honor |state| instead of only using the highlighted images
+ // after updating WebKit so we can draw the entire track in one go instead
+ // of as two separate pieces: otherwise, only the portion of the scrollbar
+ // that the mouse is over gets the highlighted state.
+ SkBitmap* top = rb.GetBitmapNamed(IDR_SCROLL_BASE_VERTICAL_TOP_H);
+ DrawTiledImage(canvas, *top,
+ 0, 0, 1.0, 1.0,
+ rect.x(), rect.y(), top->width(), top->height());
+ center_offset += top->height();
+ center_height -= top->height();
+ }
+
+ if (rect.y() + rect.height() ==
+ extra_params.track_y + extra_params.track_height) {
+ SkBitmap* bottom = rb.GetBitmapNamed(IDR_SCROLL_BASE_VERTICAL_BOTTOM_H);
+ DrawTiledImage(canvas, *bottom,
+ 0, 0, 1.0, 1.0,
+ rect.x(), rect.y() + rect.height() - bottom->height(),
+ bottom->width(), bottom->height());
+ center_height -= bottom->height();
+ }
+
+ if (center_height > 0) {
+ SkBitmap* center = rb.GetBitmapNamed(IDR_SCROLL_BASE_VERTICAL_CENTER_H);
+ DrawTiledImage(canvas, *center,
+ 0, 0, 1.0, 1.0,
+ rect.x(), rect.y() + center_offset,
+ center->width(), center_height);
+ }
} else {
- SkBitmap* background =
- GetHorizontalBitmapNamed(IDR_SCROLL_BACKGROUND);
- SkBitmap* border_left =
- GetHorizontalBitmapNamed(IDR_SCROLL_BACKGROUND_BORDER_UP);
- SkBitmap* border_right =
- GetHorizontalBitmapNamed(IDR_SCROLL_BACKGROUND_BORDER_DOWN);
- // Draw track background.
- DrawBitmapInt(
- canvas, *background,
- 0, 0, 1, background->height(),
- rect.x(), rect.y(), rect.width(), rect.height());
- // Draw left button right border.
- canvas->drawBitmap(*border_left,extra_params.track_x, extra_params.track_y);
- // Draw right button left border.
- canvas->drawBitmap(
- *border_right,
- extra_params.track_x + extra_params.track_width - border_right->width(),
- extra_params.track_y);
+ int center_offset = 0;
+ int center_width = rect.width();
+
+ if (rect.x() == extra_params.track_x) {
+ SkBitmap* left = rb.GetBitmapNamed(IDR_SCROLL_BASE_HORIZONTAL_LEFT_H);
+ DrawTiledImage(canvas, *left,
+ 0, 0, 1.0, 1.0,
+ rect.x(), rect.y(), left->width(), left->height());
+ center_offset += left->width();
+ center_width -= left->width();
+ }
+
+ if (rect.x() + rect.width() ==
+ extra_params.track_x + extra_params.track_width) {
+ SkBitmap* right = rb.GetBitmapNamed(IDR_SCROLL_BASE_HORIZONTAL_RIGHT_H);
+ DrawTiledImage(canvas, *right,
+ 0, 0, 1.0, 1.0,
+ rect.x() + rect.width() - right->width(), rect.y(),
+ right->width(), right->height());
+ center_width -= right->width();
+ }
+
+ if (center_width > 0) {
+ SkBitmap* center = rb.GetBitmapNamed(IDR_SCROLL_BASE_HORIZONTAL_CENTER_H);
+ DrawTiledImage(canvas, *center,
+ 0, 0, 1.0, 1.0,
+ rect.x() + center_offset, rect.y(),
+ center_width, center->height());
+ }
}
}
void NativeThemeAura::PaintArrowButton(SkCanvas* canvas,
const gfx::Rect& rect, Part part, State state) const {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- int resource_id =
- (part == kScrollbarUpArrow || part == kScrollbarLeftArrow) ?
- IDR_SCROLL_ARROW_UP : IDR_SCROLL_ARROW_DOWN;
- if (state == kHovered)
- resource_id++;
- else if (state == kPressed)
- resource_id += 2;
- SkBitmap* bitmap;
- if (part == kScrollbarUpArrow || part == kScrollbarDownArrow)
- bitmap = rb.GetBitmapNamed(resource_id);
- else
- bitmap = GetHorizontalBitmapNamed(resource_id);
- DrawBitmapInt(canvas, *bitmap,
- 0, 0, bitmap->width(), bitmap->height(),
- rect.x(), rect.y(), rect.width(), rect.height());
+ DCHECK(rect.IsEmpty());
}
void NativeThemeAura::PaintScrollbarThumb(SkCanvas* canvas,
Part part, State state, const gfx::Rect& rect) const {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- int resource_id = IDR_SCROLL_THUMB;
- if (state == kHovered)
- resource_id++;
- else if (state == kPressed)
- resource_id += 2;
if (part == kScrollbarVerticalThumb) {
- SkBitmap* bitmap = rb.GetBitmapNamed(resource_id);
- // Top
- DrawBitmapInt(
- canvas, *bitmap,
- 0, 1, bitmap->width(), 5,
- rect.x(), rect.y(), rect.width(), 5);
- // Middle
- DrawBitmapInt(
- canvas, *bitmap,
- 0, 7, bitmap->width(), 1,
- rect.x(), rect.y() + 5, rect.width(), rect.height() - 10);
- // Bottom
- DrawBitmapInt(
- canvas, *bitmap,
- 0, 8, bitmap->width(), 5,
- rect.x(), rect.y() + rect.height() - 5, rect.width(), 5);
- } else {
- SkBitmap* bitmap = GetHorizontalBitmapNamed(resource_id);
- // Left
- DrawBitmapInt(
- canvas, *bitmap,
- 1, 0, 5, bitmap->height(),
- rect.x(), rect.y(), 5, rect.height());
- // Middle
- DrawBitmapInt(
- canvas, *bitmap,
- 7, 0, 1, bitmap->height(),
- rect.x() + 5, rect.y(), rect.width() - 10, rect.height());
- // Right
- DrawBitmapInt(
- canvas, *bitmap,
- 8, 0, 5, bitmap->height(),
- rect.x() + rect.width() - 5, rect.y(), 5, rect.height());
- }
-}
+ int top_resource_id =
+ state == kHovered ? IDR_SCROLL_THUMB_VERTICAL_TOP_H :
+ state == kPressed ? IDR_SCROLL_THUMB_VERTICAL_TOP_P :
+ IDR_SCROLL_THUMB_VERTICAL_TOP;
+ SkBitmap* top = rb.GetBitmapNamed(top_resource_id);
+ DrawTiledImage(canvas, *top,
+ 0, 0, 1.0, 1.0,
+ rect.x(), rect.y(), top->width(), top->height());
-SkBitmap* NativeThemeAura::GetHorizontalBitmapNamed(int resource_id) const {
- SkImageMap::const_iterator found = horizontal_bitmaps_.find(resource_id);
- if (found != horizontal_bitmaps_.end())
- return found->second;
+ int bottom_resource_id =
+ state == kHovered ? IDR_SCROLL_THUMB_VERTICAL_BOTTOM_H :
+ state == kPressed ? IDR_SCROLL_THUMB_VERTICAL_BOTTOM_P :
+ IDR_SCROLL_THUMB_VERTICAL_BOTTOM;
+ SkBitmap* bottom = rb.GetBitmapNamed(bottom_resource_id);
+ DrawTiledImage(canvas, *bottom,
+ 0, 0, 1.0, 1.0,
+ rect.x(), rect.y() + rect.height() - bottom->height(),
+ bottom->width(), bottom->height());
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- SkBitmap* vertical_bitmap = rb.GetBitmapNamed(resource_id);
+ if (rect.height() > top->height() + bottom->height()) {
+ int center_resource_id =
+ state == kHovered ? IDR_SCROLL_THUMB_VERTICAL_CENTER_H :
+ state == kPressed ? IDR_SCROLL_THUMB_VERTICAL_CENTER_P :
+ IDR_SCROLL_THUMB_VERTICAL_CENTER;
+ SkBitmap* center = rb.GetBitmapNamed(center_resource_id);
+ DrawTiledImage(canvas, *center,
+ 0, 0, 1.0, 1.0,
+ rect.x(), rect.y() + top->height(),
+ center->width(),
+ rect.height() - top->height() - bottom->height());
+ }
+ } else {
+ int left_resource_id =
+ state == kHovered ? IDR_SCROLL_THUMB_HORIZONTAL_LEFT_H :
+ state == kPressed ? IDR_SCROLL_THUMB_HORIZONTAL_LEFT_P :
+ IDR_SCROLL_THUMB_HORIZONTAL_LEFT;
+ SkBitmap* left = rb.GetBitmapNamed(left_resource_id);
+ DrawTiledImage(canvas, *left,
+ 0, 0, 1.0, 1.0,
+ rect.x(), rect.y(), left->width(), left->height());
- if (vertical_bitmap) {
- SkBitmap transposed_bitmap =
- SkBitmapOperations::CreateTransposedBtmap(*vertical_bitmap);
- SkBitmap* horizontal_bitmap = new SkBitmap(transposed_bitmap);
+ int right_resource_id =
+ state == kHovered ? IDR_SCROLL_THUMB_HORIZONTAL_RIGHT_H :
+ state == kPressed ? IDR_SCROLL_THUMB_HORIZONTAL_RIGHT_P :
+ IDR_SCROLL_THUMB_HORIZONTAL_RIGHT;
+ SkBitmap* right = rb.GetBitmapNamed(right_resource_id);
+ DrawTiledImage(canvas, *right,
+ 0, 0, 1.0, 1.0,
+ rect.x() + rect.width() - right->width(), rect.y(),
+ right->width(), right->height());
- horizontal_bitmaps_[resource_id] = horizontal_bitmap;
- return horizontal_bitmap;
+ if (rect.width() > left->width() + right->width()) {
+ int center_resource_id =
+ state == kHovered ? IDR_SCROLL_THUMB_HORIZONTAL_CENTER_H :
+ state == kPressed ? IDR_SCROLL_THUMB_HORIZONTAL_CENTER_P :
+ IDR_SCROLL_THUMB_HORIZONTAL_CENTER;
+ SkBitmap* center = rb.GetBitmapNamed(center_resource_id);
+ DrawTiledImage(canvas, *center,
+ 0, 0, 1.0, 1.0,
+ rect.x() + left->width(), rect.y(),
+ rect.width() - left->width() - right->width(),
+ center->height());
+ }
}
- return NULL;
}
} // namespace gfx
diff --git a/ui/gfx/native_theme_base.cc b/ui/gfx/native_theme_base.cc
index 8e5871b..e786dee 100644
--- a/ui/gfx/native_theme_base.cc
+++ b/ui/gfx/native_theme_base.cc
@@ -33,6 +33,9 @@ const SkColor kSliderThumbBorderDarkGrey =
const SkColor kMenuPopupBackgroundColor = SkColorSetRGB(210, 225, 246);
+const unsigned int kDefaultScrollbarWidth = 15;
+const unsigned int kDefaultScrollbarButtonLength = 14;
+
// Get lightness adjusted color.
SkColor BrightenColor(const color_utils::HSL& hsl, SkAlpha alpha,
double lightness_amount) {
@@ -50,9 +53,6 @@ SkColor BrightenColor(const color_utils::HSL& hsl, SkAlpha alpha,
namespace gfx {
-unsigned int NativeThemeBase::button_length_ = 14;
-unsigned int NativeThemeBase::scrollbar_width_ = 15;
-
gfx::Size NativeThemeBase::GetPartSize(Part part,
State state,
const ExtraParams& extra) const {
@@ -83,10 +83,10 @@ gfx::Size NativeThemeBase::GetPartSize(Part part,
return gfx::Size(kCheckboxAndRadioWidth, kCheckboxAndRadioHeight);
case kScrollbarDownArrow:
case kScrollbarUpArrow:
- return gfx::Size(scrollbar_width_, button_length_);
+ return gfx::Size(scrollbar_width_, scrollbar_button_length_);
case kScrollbarLeftArrow:
case kScrollbarRightArrow:
- return gfx::Size(button_length_, scrollbar_width_);
+ return gfx::Size(scrollbar_button_length_, scrollbar_width_);
case kScrollbarHorizontalThumb:
// This matches Firefox on Linux.
return gfx::Size(2 * scrollbar_width_, scrollbar_width_);
@@ -204,7 +204,9 @@ void NativeThemeBase::Paint(SkCanvas* canvas,
}
}
-NativeThemeBase::NativeThemeBase() {
+NativeThemeBase::NativeThemeBase()
+ : scrollbar_width_(kDefaultScrollbarWidth),
+ scrollbar_button_length_(kDefaultScrollbarButtonLength) {
}
NativeThemeBase::~NativeThemeBase() {
diff --git a/ui/gfx/native_theme_base.h b/ui/gfx/native_theme_base.h
index 9624708..562f934 100644
--- a/ui/gfx/native_theme_base.h
+++ b/ui/gfx/native_theme_base.h
@@ -116,6 +116,10 @@ class NativeThemeBase : public NativeTheme {
const ProgressBarExtraParams& progress_bar) const;
protected:
+ void set_scrollbar_button_length(unsigned int length) {
+ scrollbar_button_length_ = length;
+ }
+
bool IntersectsClipRectInt(SkCanvas* canvas,
int x, int y, int w, int h) const;
@@ -152,8 +156,8 @@ class NativeThemeBase : public NativeTheme {
SkScalar max) const;
SkColor OutlineColor(SkScalar* hsv1, SkScalar* hsv2) const;
- static unsigned int scrollbar_width_;
- static unsigned int button_length_;
+ unsigned int scrollbar_width_;
+ unsigned int scrollbar_button_length_;
DISALLOW_COPY_AND_ASSIGN(NativeThemeBase);
};
diff --git a/ui/gfx/resources/chromeos_scroll_arrow_down.png b/ui/gfx/resources/chromeos_scroll_arrow_down.png
deleted file mode 100644
index 5897226..0000000
--- a/ui/gfx/resources/chromeos_scroll_arrow_down.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_arrow_down_h.png b/ui/gfx/resources/chromeos_scroll_arrow_down_h.png
deleted file mode 100644
index 9e0f17f..0000000
--- a/ui/gfx/resources/chromeos_scroll_arrow_down_h.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_arrow_down_p.png b/ui/gfx/resources/chromeos_scroll_arrow_down_p.png
deleted file mode 100644
index 94514aa..0000000
--- a/ui/gfx/resources/chromeos_scroll_arrow_down_p.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_arrow_up.png b/ui/gfx/resources/chromeos_scroll_arrow_up.png
deleted file mode 100644
index d032b6f..0000000
--- a/ui/gfx/resources/chromeos_scroll_arrow_up.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_arrow_up_h.png b/ui/gfx/resources/chromeos_scroll_arrow_up_h.png
deleted file mode 100644
index ddfc04e..0000000
--- a/ui/gfx/resources/chromeos_scroll_arrow_up_h.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_arrow_up_p.png b/ui/gfx/resources/chromeos_scroll_arrow_up_p.png
deleted file mode 100644
index e9daee1..0000000
--- a/ui/gfx/resources/chromeos_scroll_arrow_up_p.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_background.png b/ui/gfx/resources/chromeos_scroll_background.png
deleted file mode 100644
index 6746928..0000000
--- a/ui/gfx/resources/chromeos_scroll_background.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_background_border_down.png b/ui/gfx/resources/chromeos_scroll_background_border_down.png
deleted file mode 100644
index 3182b7b..0000000
--- a/ui/gfx/resources/chromeos_scroll_background_border_down.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_background_border_up.png b/ui/gfx/resources/chromeos_scroll_background_border_up.png
deleted file mode 100644
index 0c8b086..0000000
--- a/ui/gfx/resources/chromeos_scroll_background_border_up.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_thumb.png b/ui/gfx/resources/chromeos_scroll_thumb.png
deleted file mode 100644
index 7c175c5..0000000
--- a/ui/gfx/resources/chromeos_scroll_thumb.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_thumb_h.png b/ui/gfx/resources/chromeos_scroll_thumb_h.png
deleted file mode 100644
index 26a131d..0000000
--- a/ui/gfx/resources/chromeos_scroll_thumb_h.png
+++ /dev/null
Binary files differ
diff --git a/ui/gfx/resources/chromeos_scroll_thumb_p.png b/ui/gfx/resources/chromeos_scroll_thumb_p.png
deleted file mode 100644
index 69dd751..0000000
--- a/ui/gfx/resources/chromeos_scroll_thumb_p.png
+++ /dev/null
Binary files differ