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

Unified Diff: ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm

Issue 2602903002: Factor iOS native image loading into a utility function. (Closed)
Patch Set: Fixed BUILD files. Created 4 years 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
Index: ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm
index 6b9072a3a96d42f683c4b431bef560c9af884802..d38f324559bd354b401f9c109068192123fed8d9 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm
@@ -18,7 +18,6 @@
#import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoFontLoader.h"
#import "ios/third_party/material_text_accessibility_ios/src/src/MDFTextAccessibility.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
#include "url/gurl.h"
@@ -136,9 +135,7 @@ CGFloat tabSwitcherLocalSessionCellTopBarHeight() {
// Shadow view.
_shadow.reset([[UIImageView alloc] initWithFrame:CGRectZero]);
[_shadow setTranslatesAutoresizingMaskIntoConstraints:NO];
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- gfx::Image shadow = rb.GetNativeImageNamed(IDR_IOS_TOOLBAR_SHADOW);
- [_shadow setImage:shadow.ToUIImage()];
+ [_shadow setImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)];
[[self containerView] addSubview:_shadow];
// Constraints on the Top bar, snapshot view, and shadow view.
@@ -226,10 +223,7 @@ CGFloat tabSwitcherLocalSessionCellTopBarHeight() {
if (tab.favicon) {
[_favicon setImage:tab.favicon];
} else {
- // No favicon is available, use placeholder instead.
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- [_favicon
- setImage:rb.GetNativeImageNamed(IDR_IOS_OMNIBOX_HTTP).ToUIImage()];
+ [_favicon setImage:NativeImage(IDR_IOS_OMNIBOX_HTTP)];
}
CGSize snapshotSize = cellSize;

Powered by Google App Engine
This is Rietveld 408576698