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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 7065054: Removed the code that checks the tab number. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 7 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
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 4ad09d55711964434f4886c5bf2c34ed2bedbbbf..3803c8ad611cf1cd6342a9c349243646de69c1bd 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -359,24 +359,18 @@ void RecordLastRunAppBundlePath() {
return nil;
}
-// If the window has tabs, make "close window" be cmd-shift-w, otherwise leave
-// it as the normal cmd-w. Capitalization of the key equivalent affects whether
-// the shift modifer is used.
-- (void)adjustCloseWindowMenuItemKeyEquivalent:(BOOL)inHaveTabs {
- [closeWindowMenuItem_ setKeyEquivalent:(inHaveTabs ? @"W" : @"w")];
+// Make "close window" be cmd-shift-w.
+// Capitalization of the key equivalent affects whether the shift modifer is
Robert Sesek 2011/06/03 15:46:51 Rewrap this comment to the previous line.
+// used.
+- (void)adjustCloseWindowMenuItemKeyEquivalent {
+ [closeWindowMenuItem_ setKeyEquivalent:@"W"];
[closeWindowMenuItem_ setKeyEquivalentModifierMask:NSCommandKeyMask];
}
-// If the window has tabs, make "close tab" take over cmd-w, otherwise it
-// shouldn't have any key-equivalent because it should be disabled.
-- (void)adjustCloseTabMenuItemKeyEquivalent:(BOOL)hasTabs {
- if (hasTabs) {
- [closeTabMenuItem_ setKeyEquivalent:@"w"];
- [closeTabMenuItem_ setKeyEquivalentModifierMask:NSCommandKeyMask];
- } else {
- [closeTabMenuItem_ setKeyEquivalent:@""];
- [closeTabMenuItem_ setKeyEquivalentModifierMask:0];
- }
+// Make "close tab" be cmd-w.
+- (void)adjustCloseTabMenuItemKeyEquivalent {
+ [closeTabMenuItem_ setKeyEquivalent:@"w"];
+ [closeTabMenuItem_ setKeyEquivalentModifierMask:NSCommandKeyMask];
}
// Explicitly remove any command-key equivalents from the close tab/window
@@ -399,10 +393,9 @@ void RecordLastRunAppBundlePath() {
// so just use our main browser window if there is one.
tabController = [self mainWindowTabController];
}
- BOOL windowWithMultipleTabs =
- (tabController && [tabController numberOfTabs] > 1);
- [self adjustCloseWindowMenuItemKeyEquivalent:windowWithMultipleTabs];
- [self adjustCloseTabMenuItemKeyEquivalent:windowWithMultipleTabs];
+
+ [self adjustCloseWindowMenuItemKeyEquivalent];
+ [self adjustCloseTabMenuItemKeyEquivalent];
}
// Fix up the "close tab/close window" command-key equivalents. We do this

Powered by Google App Engine
This is Rietveld 408576698