| 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 #import "base/auto_reset.h" | 7 #import "base/auto_reset.h" |
| 8 #import "base/logging.h" | 8 #import "base/logging.h" |
| 9 #include "base/mac/crash_logging.h" | 9 #include "base/mac/crash_logging.h" |
| 10 #import "base/mac/scoped_nsexception_enabler.h" | 10 #import "base/mac/scoped_nsexception_enabler.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 424 |
| 425 - (BOOL)isHandlingSendEvent { | 425 - (BOOL)isHandlingSendEvent { |
| 426 return handlingSendEvent_; | 426 return handlingSendEvent_; |
| 427 } | 427 } |
| 428 | 428 |
| 429 - (void)setHandlingSendEvent:(BOOL)handlingSendEvent { | 429 - (void)setHandlingSendEvent:(BOOL)handlingSendEvent { |
| 430 handlingSendEvent_ = handlingSendEvent; | 430 handlingSendEvent_ = handlingSendEvent; |
| 431 } | 431 } |
| 432 | 432 |
| 433 - (void)sendEvent:(NSEvent*)event { | 433 - (void)sendEvent:(NSEvent*)event { |
| 434 // TODO(shess): Squirrel away some info to direct debugging. |
| 435 // Current hypothesis is that it's a keyboard accelerator. |
| 436 // http://crbug.com/154483 |
| 437 static NSString* const kSendEventKey = @"sendevent"; |
| 438 base::mac::ScopedCrashKey key(kSendEventKey, [event description]); |
| 439 |
| 434 base::mac::ScopedSendingEvent sendingEventScoper; | 440 base::mac::ScopedSendingEvent sendingEventScoper; |
| 435 for (id<CrApplicationEventHookProtocol> handler in eventHooks_.get()) { | 441 for (id<CrApplicationEventHookProtocol> handler in eventHooks_.get()) { |
| 436 [handler hookForEvent:event]; | 442 [handler hookForEvent:event]; |
| 437 } | 443 } |
| 438 [super sendEvent:event]; | 444 [super sendEvent:event]; |
| 439 } | 445 } |
| 440 | 446 |
| 441 // NSExceptions which are caught by the event loop are logged here. | 447 // NSExceptions which are caught by the event loop are logged here. |
| 442 // NSException uses setjmp/longjmp, which can be very bad for C++, so | 448 // NSException uses setjmp/longjmp, which can be very bad for C++, so |
| 443 // we attempt to track and report them. | 449 // we attempt to track and report them. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 std::vector<NSWindow*>::iterator window_iterator = | 581 std::vector<NSWindow*>::iterator window_iterator = |
| 576 std::find(previousKeyWindows_.begin(), | 582 std::find(previousKeyWindows_.begin(), |
| 577 previousKeyWindows_.end(), | 583 previousKeyWindows_.end(), |
| 578 window); | 584 window); |
| 579 if (window_iterator != previousKeyWindows_.end()) { | 585 if (window_iterator != previousKeyWindows_.end()) { |
| 580 previousKeyWindows_.erase(window_iterator); | 586 previousKeyWindows_.erase(window_iterator); |
| 581 } | 587 } |
| 582 } | 588 } |
| 583 | 589 |
| 584 @end | 590 @end |
| OLD | NEW |