Chromium Code Reviews| Index: chrome/browser/chrome_browser_main_mac.mm |
| diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm |
| index 11d7ff43ffe2eca372f1ea0df596b93a7693d278..813ea4da772f0b8aa555c7c3600ffe86d9ad2adf 100644 |
| --- a/chrome/browser/chrome_browser_main_mac.mm |
| +++ b/chrome/browser/chrome_browser_main_mac.mm |
| @@ -13,6 +13,7 @@ |
| #import "base/mac/foundation_util.h" |
| #include "base/mac/mac_util.h" |
| #include "base/mac/scoped_nsobject.h" |
| +#include "base/mac/sdk_forward_declarations.h" |
| #include "base/path_service.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| #import "chrome/browser/app_controller_mac.h" |
| @@ -149,7 +150,10 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { |
| bundle:base::mac::FrameworkBundle()]); |
| // TODO(viettrungluu): crbug.com/20504 - This currently leaks, so if you |
| // change this, you'll probably need to change the Valgrind suppression. |
| - [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; |
| + NSArray* top_level_objects = nil; |
| + [nib instantiateWithOwner:NSApp topLevelObjects:&top_level_objects]; |
| + for (NSObject* object : top_level_objects) |
|
Mark Mentovai
2016/07/01 21:50:39
Convenience function to instantiate the nib and re
Nico
2016/07/01 21:53:56
I agree :-)
I think it'd be even nicer if the Fil
|
| + [object retain]; |
| // Make sure the app controller has been created. |
| DCHECK([NSApp delegate]); |