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 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <OpenGL/gl.h> | 8 #include <OpenGL/gl.h> |
9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
10 | 10 |
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2293 if (!hasMarkedText_) { | 2293 if (!hasMarkedText_) { |
2294 if (!textInserted && textToBeInserted_.length() == 1) { | 2294 if (!textInserted && textToBeInserted_.length() == 1) { |
2295 // If a single character was inserted, then we just send it as a keypress | 2295 // If a single character was inserted, then we just send it as a keypress |
2296 // event. | 2296 // event. |
2297 event.type = blink::WebInputEvent::Char; | 2297 event.type = blink::WebInputEvent::Char; |
2298 event.text[0] = textToBeInserted_[0]; | 2298 event.text[0] = textToBeInserted_[0]; |
2299 event.text[1] = 0; | 2299 event.text[1] = 0; |
2300 event.skip_in_browser = true; | 2300 event.skip_in_browser = true; |
2301 widgetHost->ForwardKeyboardEvent(event); | 2301 widgetHost->ForwardKeyboardEvent(event); |
2302 } else if ((!textInserted || delayEventUntilAfterImeCompostion) && | 2302 } else if ((!textInserted || delayEventUntilAfterImeCompostion) && |
2303 [[theEvent characters] length] > 0 && | 2303 event.text[0] != '\0' && |
dtapuska
2015/12/10 20:50:12
Can we use [[event text] length] > 0 ?
chongz
2015/12/11 06:38:46
Probably not because event.text is a WebUChar arra
| |
2304 (([theEvent modifierFlags] & kCtrlCmdKeyMask) || | 2304 (([theEvent modifierFlags] & kCtrlCmdKeyMask) || |
2305 (hasEditCommands_ && editCommands_.empty()))) { | 2305 (hasEditCommands_ && editCommands_.empty()))) { |
2306 // We don't get insertText: calls if ctrl or cmd is down, or the key event | 2306 // We don't get insertText: calls if ctrl or cmd is down, or the key event |
2307 // generates an insert command. So synthesize a keypress event for these | 2307 // generates an insert command. So synthesize a keypress event for these |
2308 // cases, unless the key event generated any other command. | 2308 // cases, unless the key event generated any other command. |
2309 event.type = blink::WebInputEvent::Char; | 2309 event.type = blink::WebInputEvent::Char; |
2310 event.skip_in_browser = true; | 2310 event.skip_in_browser = true; |
2311 widgetHost->ForwardKeyboardEvent(event); | 2311 widgetHost->ForwardKeyboardEvent(event); |
2312 } | 2312 } |
2313 } | 2313 } |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3445 | 3445 |
3446 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3446 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3447 // regions that are not draggable. (See ControlRegionView in | 3447 // regions that are not draggable. (See ControlRegionView in |
3448 // native_app_window_cocoa.mm). This requires the render host view to be | 3448 // native_app_window_cocoa.mm). This requires the render host view to be |
3449 // draggable by default. | 3449 // draggable by default. |
3450 - (BOOL)mouseDownCanMoveWindow { | 3450 - (BOOL)mouseDownCanMoveWindow { |
3451 return YES; | 3451 return YES; |
3452 } | 3452 } |
3453 | 3453 |
3454 @end | 3454 @end |
OLD | NEW |