OLD | NEW |
1 // Copyright (c) 2010 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/gtk/infobar_gtk.h" | 5 #include "chrome/browser/gtk/infobar_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/gtk/browser_window_gtk.h" | 10 #include "chrome/browser/gtk/browser_window_gtk.h" |
11 #include "chrome/browser/gtk/custom_button.h" | 11 #include "chrome/browser/gtk/custom_button.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 gtk_widget_set_size_request(label, 0, -1); | 232 gtk_widget_set_size_request(label, 0, -1); |
233 gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END); | 233 gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END); |
234 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | 234 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
235 gtk_widget_modify_fg(label, GTK_STATE_NORMAL, >k_util::kGdkBlack); | 235 gtk_widget_modify_fg(label, GTK_STATE_NORMAL, >k_util::kGdkBlack); |
236 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); | 236 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); |
237 } | 237 } |
238 | 238 |
239 void InfoBar::GetTopColor(InfoBarDelegate::Type type, | 239 void InfoBar::GetTopColor(InfoBarDelegate::Type type, |
240 double* r, double* g, double *b) { | 240 double* r, double* g, double *b) { |
241 // These constants are copied from corresponding skia constants from | 241 // These constants are copied from corresponding skia constants from |
242 // browser/views/infobars/infobars.cc, and then changed into 0-1 ranged | 242 // browser/ui/views/infobars/infobars.cc, and then changed into 0-1 ranged |
243 // values for cairo. | 243 // values for cairo. |
244 switch (type) { | 244 switch (type) { |
245 case InfoBarDelegate::WARNING_TYPE: | 245 case InfoBarDelegate::WARNING_TYPE: |
246 *r = 255.0 / 255.0; | 246 *r = 255.0 / 255.0; |
247 *g = 242.0 / 255.0; | 247 *g = 242.0 / 255.0; |
248 *b = 183.0 / 255.0; | 248 *b = 183.0 / 255.0; |
249 break; | 249 break; |
250 case InfoBarDelegate::PAGE_ACTION_TYPE: | 250 case InfoBarDelegate::PAGE_ACTION_TYPE: |
251 *r = 218.0 / 255.0; | 251 *r = 218.0 / 255.0; |
252 *g = 231.0 / 255.0; | 252 *g = 231.0 / 255.0; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 444 |
445 InfoBar* AlertInfoBarDelegate::CreateInfoBar() { | 445 InfoBar* AlertInfoBarDelegate::CreateInfoBar() { |
446 return new AlertInfoBar(this); | 446 return new AlertInfoBar(this); |
447 } | 447 } |
448 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { | 448 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { |
449 return new LinkInfoBar(this); | 449 return new LinkInfoBar(this); |
450 } | 450 } |
451 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { | 451 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { |
452 return new ConfirmInfoBar(this); | 452 return new ConfirmInfoBar(this); |
453 } | 453 } |
OLD | NEW |