Use class extension to avoid type conversion

This commit is contained in:
Cheng Zhao 2016-06-19 20:16:19 +09:00
parent 754c4654d4
commit d3bf400d56

View file

@ -10,6 +10,10 @@
#include "content/public/browser/native_web_keyboard_event.h"
#include "ui/events/keycodes/keyboard_codes.h"
@interface NSWindow (EventDispatchingWindow)
- (void)redispatchKeyEvent:(NSEvent*)event;
@end
namespace atom {
void CommonWebContentsDelegate::HandleKeyboardEvent(
@ -24,7 +28,7 @@ void CommonWebContentsDelegate::HandleKeyboardEvent(
ExitFullscreenModeForTab(source);
if (event.os_event.window)
[(EventDispatchingWindow*)event.os_event.window redispatchKeyEvent:event.os_event];
[event.os_event.window redispatchKeyEvent:event.os_event];
}
} // namespace atom