OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gtk/infobars/infobar_container_gtk.h" | 5 #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "chrome/browser/api/infobars/infobar_delegate.h" | 12 #include "chrome/browser/api/infobars/infobar_delegate.h" |
13 #include "chrome/browser/platform_util.h" | 13 #include "chrome/browser/platform_util.h" |
14 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.h" |
15 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 15 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
16 #include "chrome/browser/ui/gtk/gtk_util.h" | 16 #include "chrome/browser/ui/gtk/gtk_util.h" |
17 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" | 17 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" |
18 #include "third_party/skia/include/effects/SkGradientShader.h" | 18 #include "third_party/skia/include/effects/SkGradientShader.h" |
19 #include "ui/base/gtk/gtk_compat.h" | 19 #include "ui/base/gtk/gtk_compat.h" |
20 #include "ui/gfx/canvas_skia_paint.h" | 20 #include "ui/gfx/canvas_skia_paint.h" |
21 #include "ui/gfx/color_utils.h" | 21 #include "ui/gfx/color_utils.h" |
22 #include "ui/gfx/rect.h" | 22 #include "ui/gfx/rect.h" |
23 #include "ui/gfx/skia_utils_gtk.h" | 23 #include "ui/gfx/skia_utils_gtk.h" |
24 | 24 |
25 InfoBarContainerGtk::InfoBarContainerGtk( | 25 InfoBarContainerGtk::InfoBarContainerGtk( |
26 InfoBarContainer::Delegate* delegate, | 26 InfoBarContainer::Delegate* delegate, |
27 chrome::search::SearchModel* search_model, | 27 chrome::search::SearchModel* search_model, |
| 28 const InstantModel* instant_model, |
28 Profile* profile) | 29 Profile* profile) |
29 : InfoBarContainer(delegate, search_model), | 30 : InfoBarContainer(delegate, search_model, instant_model), |
30 profile_(profile), | 31 profile_(profile), |
31 container_(gtk_vbox_new(FALSE, 0)) { | 32 container_(gtk_vbox_new(FALSE, 0)) { |
32 gtk_widget_show(widget()); | 33 gtk_widget_show(widget()); |
33 } | 34 } |
34 | 35 |
35 InfoBarContainerGtk::~InfoBarContainerGtk() { | 36 InfoBarContainerGtk::~InfoBarContainerGtk() { |
36 RemoveAllInfoBarsForDestruction(); | 37 RemoveAllInfoBarsForDestruction(); |
37 container_.Destroy(); | 38 container_.Destroy(); |
38 } | 39 } |
39 | 40 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 SkCanvas& canvas = *canvas_paint.sk_canvas(); | 189 SkCanvas& canvas = *canvas_paint.sk_canvas(); |
189 | 190 |
190 canvas.drawPath(path, paint); | 191 canvas.drawPath(path, paint); |
191 | 192 |
192 paint.setShader(NULL); | 193 paint.setShader(NULL); |
193 paint.setColor(SkColorSetA(gfx::GdkColorToSkColor(source->GetBorderColor()), | 194 paint.setColor(SkColorSetA(gfx::GdkColorToSkColor(source->GetBorderColor()), |
194 SkColorGetA(grad_colors[0]))); | 195 SkColorGetA(grad_colors[0]))); |
195 paint.setStyle(SkPaint::kStroke_Style); | 196 paint.setStyle(SkPaint::kStroke_Style); |
196 canvas.drawPath(path, paint); | 197 canvas.drawPath(path, paint); |
197 } | 198 } |
OLD | NEW |