| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/cocoa/browser_window_command_handler.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_command_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/mac/foundation_util.h" | 8 #import "base/mac/foundation_util.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #import "chrome/browser/app_controller_mac.h" | 10 #import "chrome/browser/app_controller_mac.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 // This code is reachable e.g. if the user mashes the back button, queuing | 258 // This code is reachable e.g. if the user mashes the back button, queuing |
| 259 // up a bunch of events before the button's enabled state is updated: | 259 // up a bunch of events before the button's enabled state is updated: |
| 260 // http://crbug.com/63254 | 260 // http://crbug.com/63254 |
| 261 return; | 261 return; |
| 262 } | 262 } |
| 263 | 263 |
| 264 NSInteger command = [sender tag]; | 264 NSInteger command = [sender tag]; |
| 265 NSUInteger modifierFlags = [[NSApp currentEvent] modifierFlags]; | 265 NSUInteger modifierFlags = [[NSApp currentEvent] modifierFlags]; |
| 266 if ((command == IDC_RELOAD) && | 266 if ((command == IDC_RELOAD) && |
| 267 (modifierFlags & (NSShiftKeyMask | NSControlKeyMask))) { | 267 (modifierFlags & (NSShiftKeyMask | NSControlKeyMask))) { |
| 268 command = IDC_RELOAD_IGNORING_CACHE; | 268 command = IDC_RELOAD_BYPASSING_CACHE; |
| 269 // Mask off Shift and Control so they don't affect the disposition below. | 269 // Mask off Shift and Control so they don't affect the disposition below. |
| 270 modifierFlags &= ~(NSShiftKeyMask | NSControlKeyMask); | 270 modifierFlags &= ~(NSShiftKeyMask | NSControlKeyMask); |
| 271 } | 271 } |
| 272 if (![[sender window] isMainWindow]) { | 272 if (![[sender window] isMainWindow]) { |
| 273 // Remove the command key from the flags, it means "keep the window in | 273 // Remove the command key from the flags, it means "keep the window in |
| 274 // the background" in this case. | 274 // the background" in this case. |
| 275 modifierFlags &= ~NSCommandKeyMask; | 275 modifierFlags &= ~NSCommandKeyMask; |
| 276 } | 276 } |
| 277 chrome::ExecuteCommandWithDisposition( | 277 chrome::ExecuteCommandWithDisposition( |
| 278 FindBrowserForSender(sender, window), command, | 278 FindBrowserForSender(sender, window), command, |
| 279 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], | 279 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], |
| 280 modifierFlags)); | 280 modifierFlags)); |
| 281 } | 281 } |
| 282 | 282 |
| 283 @end | 283 @end |
| OLD | NEW |