| 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 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 return sum; | 47 return sum; |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool InfoBarContainerGtk::ContainsInfobars() const { | 50 bool InfoBarContainerGtk::ContainsInfobars() const { |
| 51 return !infobars_gtk_.empty(); | 51 return !infobars_gtk_.empty(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void InfoBarContainerGtk::PlatformSpecificAddInfoBar(InfoBar* infobar, | 54 void InfoBarContainerGtk::PlatformSpecificAddInfoBar(InfoBar* infobar, |
| 55 size_t position) { | 55 size_t position) { |
| 56 InfoBarGtk* infobar_gtk = static_cast<InfoBarGtk*>(infobar); | 56 InfoBarGtk* infobar_gtk = static_cast<InfoBarGtk*>(infobar); |
| 57 infobar_gtk->InitWidgets(); |
| 57 infobars_gtk_.insert(infobars_gtk_.begin() + position, infobar_gtk); | 58 infobars_gtk_.insert(infobars_gtk_.begin() + position, infobar_gtk); |
| 58 | 59 |
| 59 if (infobars_gtk_.back() == infobar_gtk) { | 60 if (infobars_gtk_.back() == infobar_gtk) { |
| 60 gtk_box_pack_start(GTK_BOX(widget()), infobar_gtk->widget(), | 61 gtk_box_pack_start(GTK_BOX(widget()), infobar_gtk->widget(), |
| 61 FALSE, FALSE, 0); | 62 FALSE, FALSE, 0); |
| 62 } else { | 63 } else { |
| 63 // Clear out our container and then repack it to make sure everything is in | 64 // Clear out our container and then repack it to make sure everything is in |
| 64 // the right order. | 65 // the right order. |
| 65 gtk_util::RemoveAllChildren(widget()); | 66 gtk_util::RemoveAllChildren(widget()); |
| 66 | 67 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 SkCanvas& canvas = *canvas_paint.sk_canvas(); | 188 SkCanvas& canvas = *canvas_paint.sk_canvas(); |
| 188 | 189 |
| 189 canvas.drawPath(path, paint); | 190 canvas.drawPath(path, paint); |
| 190 | 191 |
| 191 paint.setShader(NULL); | 192 paint.setShader(NULL); |
| 192 paint.setColor(SkColorSetA(gfx::GdkColorToSkColor(source->GetBorderColor()), | 193 paint.setColor(SkColorSetA(gfx::GdkColorToSkColor(source->GetBorderColor()), |
| 193 SkColorGetA(grad_colors[0]))); | 194 SkColorGetA(grad_colors[0]))); |
| 194 paint.setStyle(SkPaint::kStroke_Style); | 195 paint.setStyle(SkPaint::kStroke_Style); |
| 195 canvas.drawPath(path, paint); | 196 canvas.drawPath(path, paint); |
| 196 } | 197 } |
| OLD | NEW |