Fix keyboard shortcut handling on Windows (issue #615) and Mac (issue #618).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@675 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-06-07 17:38:12 +00:00
parent f74e3f4bc9
commit a9449d612c
5 changed files with 77 additions and 35 deletions

View File

@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/web_contents_view.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "ui/gfx/rect.h"
@@ -124,3 +125,10 @@ void CefBrowserHostImpl::PlatformSizeTo(int width, int height) {
CefWindowHandle CefBrowserHostImpl::PlatformGetWindowHandle() {
return window_info_.view;
}
void CefBrowserHostImpl::PlatformHandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
// Give the top level menu equivalents a chance to handle the event.
if ([event.os_event type] == NSKeyDown)
[[NSApp mainMenu] performKeyEquivalent:event.os_event];
}