|
Lines 113-118
@interface WKView ()
Source/WebKit2/UIProcess/API/mac/WKView.mm_sec1
|
| 113 |
- (float)_deviceScaleFactor; |
113 |
- (float)_deviceScaleFactor; |
| 114 |
- (void)_setDrawingAreaSize:(NSSize)size; |
114 |
- (void)_setDrawingAreaSize:(NSSize)size; |
| 115 |
- (void)_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState; |
115 |
- (void)_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState; |
|
|
116 |
- (void)_disableComplexTextInputIfNecessary; |
| 116 |
@end |
117 |
@end |
| 117 |
|
118 |
|
| 118 |
@interface WKViewData : NSObject { |
119 |
@interface WKViewData : NSObject { |
|
Lines 1240-1245
- (BOOL)performKeyEquivalent:(NSEvent *)
Source/WebKit2/UIProcess/API/mac/WKView.mm_sec2
|
| 1240 |
|
1241 |
|
| 1241 |
BOOL eventWasSentToWebCore = (_data->_keyDownEventBeingResent == event); |
1242 |
BOOL eventWasSentToWebCore = (_data->_keyDownEventBeingResent == event); |
| 1242 |
|
1243 |
|
|
|
1244 |
if (!eventWasSentToWebCore) |
| 1245 |
[self _disableComplexTextInputIfNecessary]; |
| 1246 |
|
| 1243 |
// Pass key combos through WebCore if there is a key binding available for |
1247 |
// Pass key combos through WebCore if there is a key binding available for |
| 1244 |
// this event. This lets web pages have a crack at intercepting key-modified keypresses. |
1248 |
// this event. This lets web pages have a crack at intercepting key-modified keypresses. |
| 1245 |
// But don't do it if we have already handled the event. |
1249 |
// But don't do it if we have already handled the event. |
|
Lines 1257-1262
- (void)keyUp:(NSEvent *)theEvent
Source/WebKit2/UIProcess/API/mac/WKView.mm_sec3
|
| 1257 |
_data->_page->handleKeyboardEvent(NativeWebKeyboardEvent(theEvent, self)); |
1261 |
_data->_page->handleKeyboardEvent(NativeWebKeyboardEvent(theEvent, self)); |
| 1258 |
} |
1262 |
} |
| 1259 |
|
1263 |
|
|
|
1264 |
- (void)_disableComplexTextInputIfNecessary |
| 1265 |
{ |
| 1266 |
if (!_data->_pluginComplexTextInputIdentifier) |
| 1267 |
return; |
| 1268 |
|
| 1269 |
if (_data->_pluginComplexTextInputState != PluginComplexTextInputEnabled) |
| 1270 |
return; |
| 1271 |
|
| 1272 |
// Check if the text input window has been dismissed. |
| 1273 |
if (![[WKTextInputWindowController sharedTextInputWindowController] hasMarkedText]) |
| 1274 |
[self _setPluginComplexTextInputState:PluginComplexTextInputDisabled]; |
| 1275 |
} |
| 1276 |
|
| 1260 |
- (BOOL)_handlePluginComplexTextInputKeyDown:(NSEvent *)event |
1277 |
- (BOOL)_handlePluginComplexTextInputKeyDown:(NSEvent *)event |
| 1261 |
{ |
1278 |
{ |
| 1262 |
ASSERT(_data->_pluginComplexTextInputIdentifier); |
1279 |
ASSERT(_data->_pluginComplexTextInputIdentifier); |
|
Lines 1282-1287
- (BOOL)_tryHandlePluginComplexTextInput
Source/WebKit2/UIProcess/API/mac/WKView.mm_sec4
|
| 1282 |
if (!_data->_pluginComplexTextInputIdentifier || _data->_pluginComplexTextInputState == PluginComplexTextInputDisabled) |
1299 |
if (!_data->_pluginComplexTextInputIdentifier || _data->_pluginComplexTextInputState == PluginComplexTextInputDisabled) |
| 1283 |
return NO; |
1300 |
return NO; |
| 1284 |
|
1301 |
|
|
|
1302 |
// Check if the text input window has been dismissed and let the plug-in process know. |
| 1303 |
// This is only valid with the updated Cocoa text input spec. |
| 1304 |
[self _disableComplexTextInputIfNecessary]; |
| 1305 |
|
| 1285 |
// Try feeding the keyboard event directly to the plug-in. |
1306 |
// Try feeding the keyboard event directly to the plug-in. |
| 1286 |
return [self _handlePluginComplexTextInputKeyDown:event]; |
1307 |
return [self _handlePluginComplexTextInputKeyDown:event]; |
| 1287 |
} |
1308 |
} |
|
Lines 2119-2126
- (void)_setUserInterfaceItemState:(NSSt
Source/WebKit2/UIProcess/API/mac/WKView.mm_sec5
|
| 2119 |
|
2140 |
|
| 2120 |
- (BOOL)_tryPostProcessPluginComplexTextInputKeyDown:(NSEvent *)event |
2141 |
- (BOOL)_tryPostProcessPluginComplexTextInputKeyDown:(NSEvent *)event |
| 2121 |
{ |
2142 |
{ |
| 2122 |
// FIXME: Implement. |
2143 |
if (!_data->_pluginComplexTextInputIdentifier || _data->_pluginComplexTextInputState == PluginComplexTextInputDisabled) |
| 2123 |
return NO; |
2144 |
return NO; |
|
|
2145 |
|
| 2146 |
// In the legacy text input model, the event has already been sent to the input method. |
| 2147 |
if (_data->_pluginComplexTextInputState == PluginComplexTextInputEnabledLegacy) |
| 2148 |
return NO; |
| 2149 |
|
| 2150 |
return [self _handlePluginComplexTextInputKeyDown:event]; |
| 2124 |
} |
2151 |
} |
| 2125 |
|
2152 |
|
| 2126 |
- (void)_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled |
2153 |
- (void)_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled |
|
Lines 2390-2396
- (void)_pluginFocusOrWindowFocusChanged
Source/WebKit2/UIProcess/API/mac/WKView.mm_sec6
|
| 2390 |
[NSApp updateWindows]; |
2417 |
[NSApp updateWindows]; |
| 2391 |
} |
2418 |
} |
| 2392 |
|
2419 |
|
| 2393 |
- (void)_setPluginComplexTextInputState:(WebKit::PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier |
2420 |
- (void)_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier |
| 2394 |
{ |
2421 |
{ |
| 2395 |
if (pluginComplexTextInputIdentifier != _data->_pluginComplexTextInputIdentifier) { |
2422 |
if (pluginComplexTextInputIdentifier != _data->_pluginComplexTextInputIdentifier) { |
| 2396 |
// We're asked to update the state for a plug-in that doesn't have focus. |
2423 |
// We're asked to update the state for a plug-in that doesn't have focus. |