Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4158)

Unified Diff: chrome/browser/gtk/page_info_bubble_gtk.cc

Issue 3560004: Refactor the code for loading icons into the PageInfoModel. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: cleanup Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/page_info_window_mac_unittest.mm ('k') | chrome/browser/gtk/page_info_window_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/page_info_bubble_gtk.cc
diff --git a/chrome/browser/gtk/page_info_bubble_gtk.cc b/chrome/browser/gtk/page_info_bubble_gtk.cc
index 0417d79356b3aa33f3e61882a8f2783167fb6a00..031afb6519bd186ff49ed24173fd0b7de4f89e8b 100644
--- a/chrome/browser/gtk/page_info_bubble_gtk.cc
+++ b/chrome/browser/gtk/page_info_bubble_gtk.cc
@@ -7,7 +7,6 @@
#include "build/build_config.h"
#include "app/l10n_util.h"
-#include "app/resource_bundle.h"
#include "base/i18n/rtl.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_list.h"
@@ -28,7 +27,6 @@
#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
-#include "grit/theme_resources.h"
class Profile;
@@ -215,36 +213,8 @@ GtkWidget* PageInfoBubbleGtk::CreateSection(
const PageInfoModel::SectionInfo& section) {
GtkWidget* section_box = gtk_hbox_new(FALSE, 0);
- if (section.type == PageInfoModel::SECTION_INFO_IDENTITY ||
- section.type == PageInfoModel::SECTION_INFO_CONNECTION) {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- GdkPixbuf* pixbuf = NULL;
- switch (section.state) {
- case PageInfoModel::SECTION_STATE_OK:
- pixbuf = rb.GetPixbufNamed(IDR_PAGEINFO_GOOD);
- break;
- case PageInfoModel::SECTION_STATE_WARNING_MINOR:
- DCHECK(section.type == PageInfoModel::SECTION_INFO_CONNECTION);
- pixbuf = rb.GetPixbufNamed(IDR_PAGEINFO_WARNING_MINOR);
- break;
- case PageInfoModel::SECTION_STATE_WARNING_MAJOR:
- pixbuf = rb.GetPixbufNamed(IDR_PAGEINFO_WARNING_MAJOR);
- break;
- case PageInfoModel::SECTION_STATE_ERROR:
- pixbuf = rb.GetPixbufNamed(IDR_PAGEINFO_BAD);
- break;
- default:
- NOTREACHED();
- }
- GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf);
- gtk_box_pack_start(GTK_BOX(section_box), image, FALSE, FALSE,
- gtk_util::kControlSpacing);
- gtk_misc_set_alignment(GTK_MISC(image), 0, 0);
- } else if (section.type == PageInfoModel::SECTION_INFO_FIRST_VISIT) {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- GdkPixbuf* pixbuf = section.state == PageInfoModel::SECTION_STATE_OK ?
- rb.GetPixbufNamed(IDR_PAGEINFO_INFO) :
- rb.GetPixbufNamed(IDR_PAGEINFO_WARNING_MAJOR);
+ GdkPixbuf* pixbuf = model_.GetIconImage(section.icon_id);
+ if (pixbuf) {
GtkWidget* image = gtk_image_new_from_pixbuf(pixbuf);
gtk_box_pack_start(GTK_BOX(section_box), image, FALSE, FALSE,
gtk_util::kControlSpacing);
« no previous file with comments | « chrome/browser/cocoa/page_info_window_mac_unittest.mm ('k') | chrome/browser/gtk/page_info_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698