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

Unified Diff: ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.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/omnibox/omnibox_text_field_ios.mm
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
index e67c3ab36619a5c57976d7c493a639e1a0e5568a..f95f24fed48ca37c2d3efcc69804b7a632a5e02b 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
@@ -28,7 +28,6 @@
#include "skia/ext/skia_utils_ios.h"
#include "third_party/google_toolbox_for_mac/src/iPhone/GTMFadeTruncatingLabel.h"
#include "ui/base/l10n/l10n_util_mac.h"
-#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/image/image.h"
#import "ui/gfx/ios/NSString+CrStringDrawing.h"
@@ -408,9 +407,7 @@ NSString* const kOmniboxFadeAnimationKey = @"OmniboxFadeAnimation";
// For iPhone, the left view is only updated when not in editing mode (i.e.
// the text field is not first responder).
} else if (_leftViewImageId && (IsIPadIdiom() || ![self isFirstResponder])) {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- gfx::Image defaultImage = rb.GetNativeImageNamed(_leftViewImageId);
- UIImage* image = [defaultImage.ToUIImage()
+ UIImage* image = [NativeImage(_leftViewImageId)
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIImageView* imageView =
[[[UIImageView alloc] initWithImage:image] autorelease];

Powered by Google App Engine
This is Rietveld 408576698