| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 | 8 |
| 9 #include "app/l10n_util_mac.h" | 9 #include "app/l10n_util_mac.h" |
| 10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 // command key is down, ignore the command key, but process any other modifiers. | 926 // command key is down, ignore the command key, but process any other modifiers. |
| 927 - (void)commandDispatchUsingKeyModifiers:(id)sender { | 927 - (void)commandDispatchUsingKeyModifiers:(id)sender { |
| 928 DCHECK(sender); | 928 DCHECK(sender); |
| 929 // See comment above for why we do this. | 929 // See comment above for why we do this. |
| 930 BrowserWindowController* targetController = self; | 930 BrowserWindowController* targetController = self; |
| 931 if ([sender respondsToSelector:@selector(window)]) | 931 if ([sender respondsToSelector:@selector(window)]) |
| 932 targetController = [[sender window] windowController]; | 932 targetController = [[sender window] windowController]; |
| 933 DCHECK([targetController isKindOfClass:[BrowserWindowController class]]); | 933 DCHECK([targetController isKindOfClass:[BrowserWindowController class]]); |
| 934 NSInteger command = [sender tag]; | 934 NSInteger command = [sender tag]; |
| 935 NSUInteger modifierFlags = [[NSApp currentEvent] modifierFlags]; | 935 NSUInteger modifierFlags = [[NSApp currentEvent] modifierFlags]; |
| 936 if ((command == IDC_RELOAD) && (modifierFlags & NSShiftKeyMask)) { | 936 if ((command == IDC_RELOAD) && |
| 937 (modifierFlags & (NSShiftKeyMask | NSControlKeyMask))) { |
| 937 command = IDC_RELOAD_IGNORING_CACHE; | 938 command = IDC_RELOAD_IGNORING_CACHE; |
| 938 // Mask off shift so it isn't interpreted as affecting the disposition | 939 // Mask off Shift and Control so they don't affect the disposition below. |
| 939 // below. | 940 modifierFlags &= ~(NSShiftKeyMask | NSControlKeyMask); |
| 940 modifierFlags &= ~NSShiftKeyMask; | |
| 941 } | 941 } |
| 942 if (![[sender window] isMainWindow]) { | 942 if (![[sender window] isMainWindow]) { |
| 943 // Remove the command key from the flags, it means "keep the window in | 943 // Remove the command key from the flags, it means "keep the window in |
| 944 // the background" in this case. | 944 // the background" in this case. |
| 945 modifierFlags &= ~NSCommandKeyMask; | 945 modifierFlags &= ~NSCommandKeyMask; |
| 946 } | 946 } |
| 947 WindowOpenDisposition disposition = | 947 WindowOpenDisposition disposition = |
| 948 event_utils::WindowOpenDispositionFromNSEventWithFlags( | 948 event_utils::WindowOpenDispositionFromNSEventWithFlags( |
| 949 [NSApp currentEvent], modifierFlags); | 949 [NSApp currentEvent], modifierFlags); |
| 950 switch (command) { | 950 switch (command) { |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 | 1865 |
| 1866 - (BOOL)supportsBookmarkBar { | 1866 - (BOOL)supportsBookmarkBar { |
| 1867 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 1867 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 1868 } | 1868 } |
| 1869 | 1869 |
| 1870 - (BOOL)isNormalWindow { | 1870 - (BOOL)isNormalWindow { |
| 1871 return browser_->type() == Browser::TYPE_NORMAL; | 1871 return browser_->type() == Browser::TYPE_NORMAL; |
| 1872 } | 1872 } |
| 1873 | 1873 |
| 1874 @end // @implementation BrowserWindowController(WindowType) | 1874 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |