mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-03 12:37:36 +01:00
243a9c26d7
- Delete include/cef_runnable.h (issue #1336). - Build the cef_unittests target using all Chromium headers. Add a USING_CHROMIUM_INCLUDES define and libcef_dll_wrapper_unittests target to support this. This change avoids compile errors due to the divergence of CEF and Chromium base/ header implementations. The libcef_dll_wrapper sources must now compile successfully with both CEF and Chromium base/ headers (issue #1632). - The onbeforeunload message specified via JavaScript is no longer passed to the client (see http://crbug.com/587940).
40 lines
1.3 KiB
Plaintext
40 lines
1.3 KiB
Plaintext
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
|
// reserved. Use of this source code is governed by a BSD-style license
|
|
// that can be found in the LICENSE file.
|
|
|
|
#import <AppKit/AppKit.h>
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#include "os_rendering_unittest_mac.h"
|
|
|
|
#include "ui/events/keycodes/keyboard_code_conversion_mac.h"
|
|
|
|
#include "include/cef_base.h"
|
|
|
|
namespace osr_unittests {
|
|
|
|
CefWindowHandle GetFakeView() {
|
|
NSScreen *mainScreen = [NSScreen mainScreen];
|
|
NSRect screenRect = [mainScreen visibleFrame];
|
|
NSView* fakeView = [[NSView alloc] initWithFrame: screenRect];
|
|
return fakeView;
|
|
}
|
|
|
|
void GetKeyEvent(CefKeyEvent& event, ui::KeyboardCode keyCode, int modifiers) {
|
|
unichar character;
|
|
unichar unmodified_character;
|
|
|
|
// TODO(port): translate modifiers from the input format to NSFlags
|
|
// MacKeyCodeForWindowsKeyCode takes a NSUinteger as flags.
|
|
int macKeyCode = ui::MacKeyCodeForWindowsKeyCode(keyCode,
|
|
modifiers,
|
|
&character,
|
|
&unmodified_character);
|
|
|
|
event.native_key_code = macKeyCode;
|
|
event.character = character;
|
|
event.unmodified_character = unmodified_character;
|
|
}
|
|
|
|
} // namespace osr_unittests
|