Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4423)

Unified Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 100121: Adds items to the Window menu on Mac. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 14763)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -143,6 +143,8 @@
}
- (void)destroyBrowser {
+ [NSApp removeWindowsItem:[self window]];
+
// We need the window to go away now.
[self autorelease];
}
@@ -423,6 +425,13 @@
#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 @@
#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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698