Index: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm |
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm |
index 2ab43137c90eec2e8a2a4f3dd3c826f2a42eee9a..eb3b3af82f773b232bd282b77da1673b1404baf0 100644 |
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm |
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm |
@@ -6,6 +6,7 @@ |
#include <algorithm> |
+#include "base/debug/crash_logging.h" |
#include "base/mac/bundle_locations.h" |
#include "base/mac/foundation_util.h" |
#include "base/mac/mac_util.h" |
@@ -52,6 +53,7 @@ |
#include "chrome/browser/ui/tabs/tab_strip_model.h" |
#include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" |
#include "chrome/browser/ui/toolbar/app_menu_model.h" |
+#include "chrome/common/crash_keys.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/grit/chromium_strings.h" |
#include "chrome/grit/generated_resources.h" |
@@ -252,6 +254,19 @@ class NotificationBridge : public AppMenuIconController::Delegate { |
} |
- (void)viewDidLoad { |
+ base::debug::ScopedCrashKey nib_crash_key{ |
+ crash_keys::mac::kToolbarNibInfo, [&] { |
Robert Sesek
2017/02/15 20:20:18
I don't see any advantage of a lambda here. Can yo
Sidney San Martín
2017/02/15 22:45:19
Trying not to leak locals. What would you do inste
Sidney San Martín
2017/02/15 23:15:01
I didn't change this yet (because I'm trying to ke
Robert Sesek
2017/02/16 00:25:16
It's temporary code, so I don't feel strongly, but
|
+ auto nibPath = |
+ [self.nibBundle pathForResource:@"Toolbar" ofType:@"nib"]; |
+ auto closestPath = nibPath; |
+ auto fileManager = [NSFileManager defaultManager]; |
+ while (closestPath && ![fileManager fileExistsAtPath:closestPath]) { |
Robert Sesek
2017/02/15 20:20:18
I would use actual stat on the nib file so that we
Sidney San Martín
2017/02/15 23:15:01
Done, let me know if it makes sense.
|
+ closestPath = [closestPath stringByDeletingLastPathComponent]; |
+ } |
+ return [NSString |
+ stringWithFormat:@"nib: %@ closest: %@", nibPath, closestPath]; |
+ }().UTF8String}; |
+ |
// When linking and running on 10.10+, both -awakeFromNib and -viewDidLoad may |
// be called, don't initialize twice. |
if (locationBarView_) { |