| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_browser_application_mac.h" | 5 #import "chrome/browser/chrome_browser_application_mac.h" |
| 6 | 6 |
| 7 #include <AvailabilityMacros.h> | 7 #include <AvailabilityMacros.h> |
| 8 #include <objc/objc-exception.h> | 8 #include <objc/objc-exception.h> |
| 9 | 9 |
| 10 #import "base/auto_reset.h" | 10 #import "base/auto_reset.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 - (BOOL)isHandlingSendEvent { | 345 - (BOOL)isHandlingSendEvent { |
| 346 return handlingSendEvent_; | 346 return handlingSendEvent_; |
| 347 } | 347 } |
| 348 | 348 |
| 349 - (void)setHandlingSendEvent:(BOOL)handlingSendEvent { | 349 - (void)setHandlingSendEvent:(BOOL)handlingSendEvent { |
| 350 handlingSendEvent_ = handlingSendEvent; | 350 handlingSendEvent_ = handlingSendEvent; |
| 351 } | 351 } |
| 352 | 352 |
| 353 - (void)sendEvent:(NSEvent*)event { | 353 - (void)sendEvent:(NSEvent*)event { |
| 354 base::debug::ScopedCrashKey crash_key( |
| 355 crash_keys::mac::kNSEvent, base::SysNSStringToUTF8([event description])); |
| 356 |
| 354 base::mac::CallWithEHFrame(^{ | 357 base::mac::CallWithEHFrame(^{ |
| 355 switch (event.type) { | 358 switch (event.type) { |
| 356 case NSLeftMouseDown: | 359 case NSLeftMouseDown: |
| 357 case NSRightMouseDown: { | 360 case NSRightMouseDown: { |
| 358 // In kiosk mode, we want to prevent context menus from appearing, | 361 // In kiosk mode, we want to prevent context menus from appearing, |
| 359 // so simply discard menu-generating events instead of passing them | 362 // so simply discard menu-generating events instead of passing them |
| 360 // along. | 363 // along. |
| 361 bool kioskMode = base::CommandLine::ForCurrentProcess()->HasSwitch( | 364 bool kioskMode = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 362 switches::kKioskMode); | 365 switches::kKioskMode); |
| 363 bool ctrlDown = [event modifierFlags] & NSControlKeyMask; | 366 bool ctrlDown = [event modifierFlags] & NSControlKeyMask; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 389 - (void)_cycleWindowsReversed:(BOOL)arg1 { | 392 - (void)_cycleWindowsReversed:(BOOL)arg1 { |
| 390 base::AutoReset<BOOL> pin(&cyclingWindows_, YES); | 393 base::AutoReset<BOOL> pin(&cyclingWindows_, YES); |
| 391 [super _cycleWindowsReversed:arg1]; | 394 [super _cycleWindowsReversed:arg1]; |
| 392 } | 395 } |
| 393 | 396 |
| 394 - (BOOL)isCyclingWindows { | 397 - (BOOL)isCyclingWindows { |
| 395 return cyclingWindows_; | 398 return cyclingWindows_; |
| 396 } | 399 } |
| 397 | 400 |
| 398 @end | 401 @end |
| OLD | NEW |