OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 case PageInfoModel::SECTION_STATE_ERROR: | 233 case PageInfoModel::SECTION_STATE_ERROR: |
234 pixbuf = rb.GetPixbufNamed(IDR_PAGEINFO_BAD); | 234 pixbuf = rb.GetPixbufNamed(IDR_PAGEINFO_BAD); |
235 break; | 235 break; |
236 default: | 236 default: |
237 NOTREACHED(); | 237 NOTREACHED(); |
238 } | 238 } |
239 GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf); | 239 GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf); |
240 gtk_box_pack_start(GTK_BOX(section_box), image, FALSE, FALSE, | 240 gtk_box_pack_start(GTK_BOX(section_box), image, FALSE, FALSE, |
241 gtk_util::kControlSpacing); | 241 gtk_util::kControlSpacing); |
242 gtk_misc_set_alignment(GTK_MISC(image), 0, 0); | 242 gtk_misc_set_alignment(GTK_MISC(image), 0, 0); |
| 243 } else if (section.type == PageInfoModel::SECTION_INFO_FIRST_VISIT) { |
| 244 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 245 GdkPixbuf* pixbuf = section.state == PageInfoModel::SECTION_STATE_OK ? |
| 246 rb.GetPixbufNamed(IDR_PAGEINFO_INFO) : |
| 247 rb.GetPixbufNamed(IDR_PAGEINFO_WARNING_MAJOR); |
| 248 GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf); |
| 249 gtk_box_pack_start(GTK_BOX(section_box), image, FALSE, FALSE, |
| 250 gtk_util::kControlSpacing); |
| 251 gtk_misc_set_alignment(GTK_MISC(image), 0, 0); |
243 } | 252 } |
244 | 253 |
245 GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); | 254 GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); |
246 gtk_box_pack_start(GTK_BOX(section_box), vbox, TRUE, TRUE, 0); | 255 gtk_box_pack_start(GTK_BOX(section_box), vbox, TRUE, TRUE, 0); |
247 | 256 |
248 if (!section.headline.empty()) { | 257 if (!section.headline.empty()) { |
249 GtkWidget* label = gtk_label_new(UTF16ToUTF8(section.headline).c_str()); | 258 GtkWidget* label = gtk_label_new(UTF16ToUTF8(section.headline).c_str()); |
250 labels_.push_back(label); | 259 labels_.push_back(label); |
251 PangoAttrList* attributes = pango_attr_list_new(); | 260 PangoAttrList* attributes = pango_attr_list_new(); |
252 pango_attr_list_insert(attributes, | 261 pango_attr_list_insert(attributes, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 314 |
306 void ShowPageInfoBubble(gfx::NativeWindow parent, | 315 void ShowPageInfoBubble(gfx::NativeWindow parent, |
307 Profile* profile, | 316 Profile* profile, |
308 const GURL& url, | 317 const GURL& url, |
309 const NavigationEntry::SSLStatus& ssl, | 318 const NavigationEntry::SSLStatus& ssl, |
310 bool show_history) { | 319 bool show_history) { |
311 new PageInfoBubbleGtk(parent, profile, url, ssl, show_history); | 320 new PageInfoBubbleGtk(parent, profile, url, ssl, show_history); |
312 } | 321 } |
313 | 322 |
314 } // namespace browser | 323 } // namespace browser |
OLD | NEW |