Chromium Code Reviews| Index: ash/frame/default_header_painter.cc |
| diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc |
| index 0819d4dffd25f082a06c1712312d55e2005f9075..0073f836adcc5a1b074fc98a3be2a1568033e3c5 100644 |
| --- a/ash/frame/default_header_painter.cc |
| +++ b/ash/frame/default_header_painter.cc |
| @@ -36,7 +36,7 @@ const SkColor kHeaderContentSeparatorColor = SkColorSetRGB(150, 150, 152); |
| const SkColor kHeaderContentSeparatorInactiveColor = |
| SkColorSetRGB(180, 180, 182); |
| // The color of the frame. |
|
pkotwicz
2014/10/16 23:21:22
Nit: The default color of the frame.
|
| -const SkColor kFrameColor = SkColorSetRGB(242, 242, 242); |
| +const SkColor kDefaultFrameColor = SkColorSetRGB(242, 242, 242); |
| // The alpha of the inactive frame. |
| const SkAlpha kInactiveFrameAlpha = 204; |
| // Duration of crossfade animation for activating and deactivating frame. |
| @@ -79,6 +79,8 @@ DefaultHeaderPainter::DefaultHeaderPainter() |
| view_(NULL), |
| left_header_view_(NULL), |
| left_view_x_inset_(HeaderPainterUtil::GetDefaultLeftViewXInset()), |
| + active_frame_color_(kDefaultFrameColor), |
| + inactive_frame_color_(kDefaultFrameColor), |
| caption_button_container_(NULL), |
| height_(0), |
| mode_(MODE_INACTIVE), |
| @@ -164,7 +166,7 @@ void DefaultHeaderPainter::PaintHeader(gfx::Canvas* canvas, Mode mode) { |
| SkPaint paint; |
| int active_alpha = activation_animation_->CurrentValueBetween(0, 255); |
| paint.setColor(color_utils::AlphaBlend( |
| - kFrameColor, GetInactiveFrameColor(), active_alpha)); |
| + active_frame_color_, GetInactiveFrameColor(), active_alpha)); |
| TileRoundRect(canvas, paint, GetLocalBounds(), corner_radius); |
| @@ -217,6 +219,12 @@ void DefaultHeaderPainter::UpdateLeftViewXInset(int left_view_x_inset) { |
| } |
| } |
| +void DefaultHeaderPainter::SetFrameColors(SkColor active_frame_color, |
| + SkColor inactive_frame_color) { |
| + active_frame_color_ = active_frame_color; |
| + inactive_frame_color_ = inactive_frame_color; |
| +} |
| + |
| void DefaultHeaderPainter::UpdateLeftHeaderView(views::View* left_header_view) { |
| left_header_view_ = left_header_view; |
| } |
| @@ -333,7 +341,7 @@ gfx::Rect DefaultHeaderPainter::GetTitleBounds() const { |
| } |
| SkColor DefaultHeaderPainter::GetInactiveFrameColor() const { |
| - SkColor color = kFrameColor; |
| + SkColor color = inactive_frame_color_; |
| if (!frame_->IsMaximized() && !frame_->IsFullscreen()) { |
| color = SkColorSetARGB(kInactiveFrameAlpha, |
| SkColorGetR(color), |