Commit 0b5f62f6 authored by rohitrao@chromium.org's avatar rohitrao@chromium.org

Adds items to the Window menu on Mac.

TEST=Open multiple windows, make sure the entries in the Window menu
match the titles of the currently selected tabs.

Review URL: http://codereview.chromium.org/100121

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14841 0039d316-1c4b-4281-b951-d872f2087c98
parent 671eb86d
......@@ -143,6 +143,8 @@ willPositionSheet:(NSWindow *)sheet
}
- (void)destroyBrowser {
[NSApp removeWindowsItem:[self window]];
// We need the window to go away now.
[self autorelease];
}
......@@ -423,6 +425,13 @@ willPositionSheet:(NSWindow *)sheet
#endif
newContents->DidBecomeSelected();
// Change the entry in the Window menu to match the title of the
// currently selected tab. This will create an entry if one does
// not already exist.
[NSApp changeWindowsItem:[self window]
title:base::SysUTF16ToNSString(newContents->GetTitle())
filename:NO];
if (BrowserList::GetLastActive() == browser_ &&
!browser_->tabstrip_model()->closing_all() &&
newContents->AsWebContents()) {
......@@ -439,6 +448,18 @@ willPositionSheet:(NSWindow *)sheet
#endif
}
- (void)tabChangedWithContents:(TabContents*)contents
atIndex:(NSInteger)index
loadingOnly:(BOOL)loading {
// Change the entry in the Window menu to match the new title of the tab,
// but only if this is the currently selected tab.
if (index == browser_->tabstrip_model()->selected_index()) {
[NSApp changeWindowsItem:[self window]
title:base::SysUTF16ToNSString(contents->GetTitle())
filename:NO];
}
}
@end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment