OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/infobars/infobar_background.h" | 5 #include "chrome/browser/ui/views/infobars/infobar_background.h" |
6 | 6 |
7 #include "chrome/browser/ui/infobar_container_delegate.h" | 7 #include "chrome/browser/ui/infobar_container_delegate.h" |
8 #include "chrome/browser/ui/views/infobars/infobar_view.h" | 8 #include "chrome/browser/ui/views/infobars/infobar_view.h" |
9 #include "components/infobars/core/infobar.h" | 9 #include "components/infobars/core/infobar.h" |
10 #include "third_party/skia/include/effects/SkGradientShader.h" | 10 #include "third_party/skia/include/effects/SkGradientShader.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 InfoBarView* infobar = static_cast<InfoBarView*>(view); | 40 InfoBarView* infobar = static_cast<InfoBarView*>(view); |
41 SkCanvas* canvas_skia = canvas->sk_canvas(); | 41 SkCanvas* canvas_skia = canvas->sk_canvas(); |
42 canvas_skia->drawPath(infobar->fill_path(), paint); | 42 canvas_skia->drawPath(infobar->fill_path(), paint); |
43 | 43 |
44 paint.setShader(NULL); | 44 paint.setShader(NULL); |
45 paint.setColor(SkColorSetA(separator_color_, | 45 paint.setColor(SkColorSetA(separator_color_, |
46 SkColorGetA(gradient_colors[0]))); | 46 SkColorGetA(gradient_colors[0]))); |
47 paint.setStyle(SkPaint::kStroke_Style); | 47 paint.setStyle(SkPaint::kStroke_Style); |
48 // Anti-alias the path so it doesn't look goofy when the edges are not at 45 | 48 // Anti-alias the path so it doesn't look goofy when the edges are not at 45 |
49 // degree angles, but don't anti-alias anything else, especially not the fill, | 49 // degree angles, but don't anti-alias anything else, especially not the |
50 // lest we get weird color bleeding problems. | 50 // fill, lest we get weird color bleeding problems. |
51 paint.setAntiAlias(true); | 51 paint.setAntiAlias(true); |
52 canvas_skia->drawPath(infobar->stroke_path(), paint); | 52 canvas_skia->drawPath(infobar->stroke_path(), paint); |
53 paint.setAntiAlias(false); | 53 paint.setAntiAlias(false); |
54 | 54 |
55 // Now draw the separator at the bottom. | 55 // Now draw the separator at the bottom. |
56 canvas->FillRect( | 56 canvas->FillRect( |
57 gfx::Rect(0, | 57 gfx::Rect(0, |
58 view->height() - InfoBarContainerDelegate::kSeparatorLineHeight, | 58 view->height() - InfoBarContainerDelegate::kSeparatorLineHeight, |
59 view->width(), InfoBarContainerDelegate::kSeparatorLineHeight), | 59 view->width(), InfoBarContainerDelegate::kSeparatorLineHeight), |
60 separator_color_); | 60 separator_color_); |
61 } | 61 } |
OLD | NEW |