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 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2304 if (!hasMarkedText_) { | 2304 if (!hasMarkedText_) { |
2305 if (!textInserted && textToBeInserted_.length() == 1) { | 2305 if (!textInserted && textToBeInserted_.length() == 1) { |
2306 // If a single character was inserted, then we just send it as a keypress | 2306 // If a single character was inserted, then we just send it as a keypress |
2307 // event. | 2307 // event. |
2308 event.type = blink::WebInputEvent::Char; | 2308 event.type = blink::WebInputEvent::Char; |
2309 event.text[0] = textToBeInserted_[0]; | 2309 event.text[0] = textToBeInserted_[0]; |
2310 event.text[1] = 0; | 2310 event.text[1] = 0; |
2311 event.skip_in_browser = true; | 2311 event.skip_in_browser = true; |
2312 widgetHost->ForwardKeyboardEvent(event); | 2312 widgetHost->ForwardKeyboardEvent(event); |
2313 } else if ((!textInserted || delayEventUntilAfterImeCompostion) && | 2313 } else if ((!textInserted || delayEventUntilAfterImeCompostion) && |
2314 event.text[0] != '\0' && | 2314 [[theEvent characters] length] > 0 && |
2315 (([theEvent modifierFlags] & kCtrlCmdKeyMask) || | 2315 (([theEvent modifierFlags] & kCtrlCmdKeyMask) || |
2316 (hasEditCommands_ && editCommands_.empty()))) { | 2316 (hasEditCommands_ && editCommands_.empty()))) { |
2317 // We don't get insertText: calls if ctrl or cmd is down, or the key event | 2317 // We don't get insertText: calls if ctrl or cmd is down, or the key event |
2318 // generates an insert command. So synthesize a keypress event for these | 2318 // generates an insert command. So synthesize a keypress event for these |
2319 // cases, unless the key event generated any other command. | 2319 // cases, unless the key event generated any other command. |
2320 event.type = blink::WebInputEvent::Char; | 2320 event.type = blink::WebInputEvent::Char; |
2321 event.skip_in_browser = true; | 2321 event.skip_in_browser = true; |
2322 widgetHost->ForwardKeyboardEvent(event); | 2322 widgetHost->ForwardKeyboardEvent(event); |
2323 } | 2323 } |
2324 } | 2324 } |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3454 | 3454 |
3455 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3455 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3456 // regions that are not draggable. (See ControlRegionView in | 3456 // regions that are not draggable. (See ControlRegionView in |
3457 // native_app_window_cocoa.mm). This requires the render host view to be | 3457 // native_app_window_cocoa.mm). This requires the render host view to be |
3458 // draggable by default. | 3458 // draggable by default. |
3459 - (BOOL)mouseDownCanMoveWindow { | 3459 - (BOOL)mouseDownCanMoveWindow { |
3460 return YES; | 3460 return YES; |
3461 } | 3461 } |
3462 | 3462 |
3463 @end | 3463 @end |
OLD | NEW |