Chromium Code Reviews| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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. | 434 // TODO(shess): Squirrel away some info to direct debugging. |
| 435 // Current hypothesis is that it's a keyboard accelerator. | 435 // Current hypothesis is that it's a keyboard accelerator. |
| 436 // http://crbug.com/154483 | 436 // http://crbug.com/154483 |
| 437 static NSString* const kSendEventKey = @"sendevent"; | 437 static NSString* const kSendEventKey = @"sendevent"; |
| 438 base::mac::ScopedCrashKey key(kSendEventKey, [event description]); | 438 // For NSEventType 28, recursive -description causes a crash. |
| 439 // Not much to be done, that type is undocumented. | |
| 440 NSString* value = [event type] == 28 ? @"type=28" : [event description]; | |
| 441 base::mac::ScopedCrashKey key(kSendEventKey, value); | |
|
Scott Hess - ex-Googler
2012/10/16 21:56:32
Why not haz magic constant? Because I couldn't th
Nico
2012/10/16 22:23:30
kTwentyEight, duh.
| |
| 439 | 442 |
| 440 base::mac::ScopedSendingEvent sendingEventScoper; | 443 base::mac::ScopedSendingEvent sendingEventScoper; |
| 441 for (id<CrApplicationEventHookProtocol> handler in eventHooks_.get()) { | 444 for (id<CrApplicationEventHookProtocol> handler in eventHooks_.get()) { |
| 442 [handler hookForEvent:event]; | 445 [handler hookForEvent:event]; |
| 443 } | 446 } |
| 444 [super sendEvent:event]; | 447 [super sendEvent:event]; |
| 445 } | 448 } |
| 446 | 449 |
| 447 // NSExceptions which are caught by the event loop are logged here. | 450 // NSExceptions which are caught by the event loop are logged here. |
| 448 // NSException uses setjmp/longjmp, which can be very bad for C++, so | 451 // NSException uses setjmp/longjmp, which can be very bad for C++, so |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 std::vector<NSWindow*>::iterator window_iterator = | 584 std::vector<NSWindow*>::iterator window_iterator = |
| 582 std::find(previousKeyWindows_.begin(), | 585 std::find(previousKeyWindows_.begin(), |
| 583 previousKeyWindows_.end(), | 586 previousKeyWindows_.end(), |
| 584 window); | 587 window); |
| 585 if (window_iterator != previousKeyWindows_.end()) { | 588 if (window_iterator != previousKeyWindows_.end()) { |
| 586 previousKeyWindows_.erase(window_iterator); | 589 previousKeyWindows_.erase(window_iterator); |
| 587 } | 590 } |
| 588 } | 591 } |
| 589 | 592 |
| 590 @end | 593 @end |
| OLD | NEW |