Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 1458203003: MacKeyboard: Don't generate keypress for non-printable char (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and use new ShutdownAndDestroyWidget() method Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2274 matching lines...) Expand 10 before | Expand all | Expand 10 after
2285 if (!hasMarkedText_) { 2285 if (!hasMarkedText_) {
2286 if (!textInserted && textToBeInserted_.length() == 1) { 2286 if (!textInserted && textToBeInserted_.length() == 1) {
2287 // If a single character was inserted, then we just send it as a keypress 2287 // If a single character was inserted, then we just send it as a keypress
2288 // event. 2288 // event.
2289 event.type = blink::WebInputEvent::Char; 2289 event.type = blink::WebInputEvent::Char;
2290 event.text[0] = textToBeInserted_[0]; 2290 event.text[0] = textToBeInserted_[0];
2291 event.text[1] = 0; 2291 event.text[1] = 0;
2292 event.skip_in_browser = true; 2292 event.skip_in_browser = true;
2293 widgetHost->ForwardKeyboardEvent(event); 2293 widgetHost->ForwardKeyboardEvent(event);
2294 } else if ((!textInserted || delayEventUntilAfterImeCompostion) && 2294 } else if ((!textInserted || delayEventUntilAfterImeCompostion) &&
2295 [[theEvent characters] length] > 0 && 2295 event.text[0] != '\0' &&
2296 (([theEvent modifierFlags] & kCtrlCmdKeyMask) || 2296 (([theEvent modifierFlags] & kCtrlCmdKeyMask) ||
2297 (hasEditCommands_ && editCommands_.empty()))) { 2297 (hasEditCommands_ && editCommands_.empty()))) {
2298 // We don't get insertText: calls if ctrl or cmd is down, or the key event 2298 // We don't get insertText: calls if ctrl or cmd is down, or the key event
2299 // generates an insert command. So synthesize a keypress event for these 2299 // generates an insert command. So synthesize a keypress event for these
2300 // cases, unless the key event generated any other command. 2300 // cases, unless the key event generated any other command.
2301 event.type = blink::WebInputEvent::Char; 2301 event.type = blink::WebInputEvent::Char;
2302 event.skip_in_browser = true; 2302 event.skip_in_browser = true;
2303 widgetHost->ForwardKeyboardEvent(event); 2303 widgetHost->ForwardKeyboardEvent(event);
2304 } 2304 }
2305 } 2305 }
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
3435 3435
3436 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3436 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3437 // regions that are not draggable. (See ControlRegionView in 3437 // regions that are not draggable. (See ControlRegionView in
3438 // native_app_window_cocoa.mm). This requires the render host view to be 3438 // native_app_window_cocoa.mm). This requires the render host view to be
3439 // draggable by default. 3439 // draggable by default.
3440 - (BOOL)mouseDownCanMoveWindow { 3440 - (BOOL)mouseDownCanMoveWindow {
3441 return YES; 3441 return YES;
3442 } 3442 }
3443 3443
3444 @end 3444 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698