OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/shelf/overflow_button.h" | 5 #include "ash/shelf/overflow_button.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
9 #include "ash/shelf/shelf_widget.h" | 9 #include "ash/shelf/shelf_widget.h" |
10 #include "grit/ash_resources.h" | 10 #include "grit/ash_resources.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 } else { | 65 } else { |
66 rect.set_origin(gfx::Point( | 66 rect.set_origin(gfx::Point( |
67 bounds.x() + kBackgroundOffset - 1, | 67 bounds.x() + kBackgroundOffset - 1, |
68 bounds.y() + ((bounds.height() - kButtonHoverSize) / 2) - 1)); | 68 bounds.y() + ((bounds.height() - kButtonHoverSize) / 2) - 1)); |
69 } | 69 } |
70 | 70 |
71 SkPaint paint; | 71 SkPaint paint; |
72 paint.setAntiAlias(true); | 72 paint.setAntiAlias(true); |
73 paint.setStyle(SkPaint::kFill_Style); | 73 paint.setStyle(SkPaint::kFill_Style); |
74 paint.setColor(SkColorSetARGB( | 74 paint.setColor( |
75 kButtonHoverAlpha * hover_animation_->GetCurrentValue(), | 75 SkColorSetA(SK_ColorBLACK, |
76 0, 0, 0)); | 76 hover_animation().CurrentValueBetween(0, kButtonHoverAlpha))); |
77 | 77 |
78 const SkScalar radius = SkIntToScalar(kButtonCornerRadius); | 78 const SkScalar radius = SkIntToScalar(kButtonCornerRadius); |
79 SkPath path; | 79 SkPath path; |
80 path.addRoundRect(gfx::RectToSkRect(rect), radius, radius); | 80 path.addRoundRect(gfx::RectToSkRect(rect), radius, radius); |
81 canvas->DrawPath(path, paint); | 81 canvas->DrawPath(path, paint); |
82 } | 82 } |
83 | 83 |
84 void OverflowButton::OnPaint(gfx::Canvas* canvas) { | 84 void OverflowButton::OnPaint(gfx::Canvas* canvas) { |
85 ShelfLayoutManager* layout_manager = | 85 ShelfLayoutManager* layout_manager = |
86 ShelfLayoutManager::ForShelf(GetWidget()->GetNativeView()); | 86 ShelfLayoutManager::ForShelf(GetWidget()->GetNativeView()); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 image = bottom_image_; | 141 image = bottom_image_; |
142 break; | 142 break; |
143 } | 143 } |
144 | 144 |
145 canvas->DrawImageInt(*image, | 145 canvas->DrawImageInt(*image, |
146 bounds.x() + ((bounds.width() - image->width()) / 2), | 146 bounds.x() + ((bounds.width() - image->width()) / 2), |
147 bounds.y() + ((bounds.height() - image->height()) / 2)); | 147 bounds.y() + ((bounds.height() - image->height()) / 2)); |
148 } | 148 } |
149 | 149 |
150 } // namespace ash | 150 } // namespace ash |
OLD | NEW |