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/infobars/infobar.h" | |
8 #include "chrome/browser/ui/views/infobars/infobar_view.h" | 7 #include "chrome/browser/ui/views/infobars/infobar_view.h" |
| 8 #include "components/infobars/core/infobar.h" |
9 #include "third_party/skia/include/effects/SkGradientShader.h" | 9 #include "third_party/skia/include/effects/SkGradientShader.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
11 #include "ui/gfx/color_utils.h" | 11 #include "ui/gfx/color_utils.h" |
12 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
13 | 13 |
14 InfoBarBackground::InfoBarBackground(InfoBarDelegate::Type infobar_type) | 14 InfoBarBackground::InfoBarBackground(InfoBarDelegate::Type infobar_type) |
15 : separator_color_(SK_ColorBLACK), | 15 : separator_color_(SK_ColorBLACK), |
16 top_color_(InfoBar::GetTopColor(infobar_type)), | 16 top_color_(InfoBar::GetTopColor(infobar_type)), |
17 bottom_color_(InfoBar::GetBottomColor(infobar_type)) { | 17 bottom_color_(InfoBar::GetBottomColor(infobar_type)) { |
18 SetNativeControlColor( | 18 SetNativeControlColor( |
(...skipping 30 matching lines...) Expand all Loading... |
49 // lest we get weird color bleeding problems. | 49 // lest we get weird color bleeding problems. |
50 paint.setAntiAlias(true); | 50 paint.setAntiAlias(true); |
51 canvas_skia->drawPath(infobar->stroke_path(), paint); | 51 canvas_skia->drawPath(infobar->stroke_path(), paint); |
52 paint.setAntiAlias(false); | 52 paint.setAntiAlias(false); |
53 | 53 |
54 // Now draw the separator at the bottom. | 54 // Now draw the separator at the bottom. |
55 canvas->FillRect(gfx::Rect(0, view->height() - InfoBar::kSeparatorLineHeight, | 55 canvas->FillRect(gfx::Rect(0, view->height() - InfoBar::kSeparatorLineHeight, |
56 view->width(), InfoBar::kSeparatorLineHeight), | 56 view->width(), InfoBar::kSeparatorLineHeight), |
57 separator_color_); | 57 separator_color_); |
58 } | 58 } |
OLD | NEW |