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

Unified Diff: chrome/browser/cocoa/page_info_window_mac.mm

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.h ('k') | chrome/browser/cocoa/page_info_window_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/page_info_window_mac.mm
diff --git a/chrome/browser/cocoa/page_info_window_mac.mm b/chrome/browser/cocoa/page_info_window_mac.mm
index 8ca4c1b635611ea788600e61839bb397a08ffc42..e246c0ac46475ad4f5fbb56ff8b52bdf4dc31884 100644
--- a/chrome/browser/cocoa/page_info_window_mac.mm
+++ b/chrome/browser/cocoa/page_info_window_mac.mm
@@ -67,7 +67,6 @@ PageInfoWindowMac::PageInfoWindowMac(PageInfoWindowController* controller,
: controller_(controller),
model_(new PageInfoModel(profile, url, ssl, show_history, this)),
cert_id_(ssl.cert_id()) {
- Init();
}
PageInfoWindowMac::PageInfoWindowMac(PageInfoWindowController* controller,
@@ -75,7 +74,6 @@ PageInfoWindowMac::PageInfoWindowMac(PageInfoWindowController* controller,
: controller_(controller),
model_(model),
cert_id_(0) {
- Init();
}
// static
@@ -98,17 +96,6 @@ void PageInfoWindowMac::ShowPageInfo(gfx::NativeWindow parent,
page_info->Show();
}
-void PageInfoWindowMac::Init() {
- // Load the image refs.
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- good_image_.reset([rb.GetNSImageNamed(IDR_PAGEINFO_GOOD) retain]);
- DCHECK_GE(kImageSize, [good_image_ size].width);
- DCHECK_GE(kImageSize, [good_image_ size].height);
- bad_image_.reset([rb.GetNSImageNamed(IDR_PAGEINFO_BAD) retain]);
- DCHECK_GE(kImageSize, [bad_image_ size].width);
- DCHECK_GE(kImageSize, [bad_image_ size].height);
-}
-
PageInfoWindowMac::~PageInfoWindowMac() {
}
@@ -213,8 +200,7 @@ void PageInfoWindowMac::LayoutSections() {
scoped_nsobject<NSImageView> image_view(
[[NSImageView alloc] initWithFrame:image_view_rect]);
[image_view setImageFrameStyle:NSImageFrameNone];
- [image_view setImage:(info.state == PageInfoModel::SECTION_STATE_OK) ?
- good_image_.get() : bad_image_.get()];
+ [image_view setImage:model_->GetIconImage(info.icon_id)];
// Add the box to the list of new subviews.
[box addSubview:image_view.get()];
« no previous file with comments | « chrome/browser/cocoa/page_info_window_mac.h ('k') | chrome/browser/cocoa/page_info_window_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698