| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ios/chrome/app/startup/setup_debugging.h" | 5 #include "ios/chrome/app/startup/setup_debugging.h" |
| 6 | 6 |
| 7 #include <objc/runtime.h> | 7 #include <objc/runtime.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Retained by the swizzle block. | 24 // Retained by the swizzle block. |
| 25 NSMutableSet* whiteList = [NSMutableSet set]; | 25 NSMutableSet* whiteList = [NSMutableSet set]; |
| 26 | 26 |
| 27 // TODO(crbug.com/720337): Add missing image. | 27 // TODO(crbug.com/720337): Add missing image. |
| 28 [whiteList addObject:@"card_close_button_pressed_incognito"]; | 28 [whiteList addObject:@"card_close_button_pressed_incognito"]; |
| 29 // TODO(crbug.com/720355): Add missing image. | 29 // TODO(crbug.com/720355): Add missing image. |
| 30 [whiteList addObject:@"find_close_pressed_incognito"]; | 30 [whiteList addObject:@"find_close_pressed_incognito"]; |
| 31 // TODO(crbug.com/720338): Add missing images. | 31 // TODO(crbug.com/720338): Add missing images. |
| 32 [whiteList addObject:@"glif-mic-to-dots-large_37"]; | 32 [whiteList addObject:@"glif-mic-to-dots-large_37"]; |
| 33 [whiteList addObject:@"glif-google-to-dots_28"]; | 33 [whiteList addObject:@"glif-google-to-dots_28"]; |
| 34 // TODO(crbug.com/721338): Add missing image. |
| 35 [whiteList addObject:@"voice_icon_keyboard_accessory"]; |
| 34 | 36 |
| 35 // The original implementation of [UIImage imageNamed:]. | 37 // The original implementation of [UIImage imageNamed:]. |
| 36 // Called by the new implementation. | 38 // Called by the new implementation. |
| 37 static IMP originalImp; | 39 static IMP originalImp; |
| 38 IMP* originalImpPtr = &originalImp; | 40 IMP* originalImpPtr = &originalImp; |
| 39 | 41 |
| 40 id swizzleBlock = ^(id self, NSString* imageName) { | 42 id swizzleBlock = ^(id self, NSString* imageName) { |
| 41 // Call the original [UIImage imageNamed:] method. | 43 // Call the original [UIImage imageNamed:] method. |
| 42 IMP imp = *originalImpPtr; | 44 IMP imp = *originalImpPtr; |
| 43 Class aClass = objc_getClass("UIImage"); | 45 Class aClass = objc_getClass("UIImage"); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 69 DCHECK(ObjcEvilDoers::ZombieEnable(true, 10000)); | 71 DCHECK(ObjcEvilDoers::ZombieEnable(true, 10000)); |
| 70 #endif | 72 #endif |
| 71 | 73 |
| 72 // Enable the detection of missing image assets. | 74 // Enable the detection of missing image assets. |
| 73 #ifndef NDEBUG | 75 #ifndef NDEBUG |
| 74 swizzleUIImageImageNamed(); | 76 swizzleUIImageImageNamed(); |
| 75 #endif | 77 #endif |
| 76 } | 78 } |
| 77 | 79 |
| 78 @end | 80 @end |
| OLD | NEW |