Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm |
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
index 9ad67b9fb8c781684f130528a948488e5681b892..16f5cd565e28ab51ac514469045342c8d78720dc 100644 |
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
@@ -203,24 +203,10 @@ void BrowserWindowCocoa::UpdateTitleBar() { |
NSString* newTitle = |
base::SysUTF16ToNSString(browser_->GetWindowTitleForCurrentTab()); |
- // Work around Cocoa bug: if a window changes title during the tracking of the |
- // Window menu it doesn't display well and the constant re-sorting of the list |
- // makes it difficult for the user to pick the desired window. Delay window |
- // title updates until the default run-loop mode. |
- |
- if (pending_window_title_.get()) |
- [[NSRunLoop currentRunLoop] |
- cancelPerformSelector:@selector(setTitle:) |
- target:window() |
- argument:pending_window_title_.get()]; |
- |
- pending_window_title_.reset([newTitle copy]); |
- [[NSRunLoop currentRunLoop] |
- performSelector:@selector(setTitle:) |
- target:window() |
- argument:newTitle |
- order:0 |
- modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]]; |
+ pending_window_title_.reset( |
+ [BrowserWindowUtils scheduleReplaceOldTitle:pending_window_title_.get() |
+ withNewTitle:newTitle |
+ forWindow:window()]); |
} |
void BrowserWindowCocoa::BookmarkBarStateChanged( |