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

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

Issue 1923023002: [Mac] Pressing unsupported key should not generate keyevents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2094 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 // http://crbug.com/383558. 2105 // http://crbug.com/383558.
2106 if (EventIsReservedBySystem(theEvent)) 2106 if (EventIsReservedBySystem(theEvent))
2107 return; 2107 return;
2108 2108
2109 DCHECK([theEvent type] != NSKeyDown || 2109 DCHECK([theEvent type] != NSKeyDown ||
2110 !equiv == !([theEvent modifierFlags] & NSCommandKeyMask)); 2110 !equiv == !([theEvent modifierFlags] & NSCommandKeyMask));
2111 2111
2112 if ([theEvent type] == NSFlagsChanged) { 2112 if ([theEvent type] == NSFlagsChanged) {
2113 // Ignore NSFlagsChanged events from the NumLock and Fn keys as 2113 // Ignore NSFlagsChanged events from the NumLock and Fn keys as
2114 // Safari does in -[WebHTMLView flagsChanged:] (of "WebHTMLView.mm"). 2114 // Safari does in -[WebHTMLView flagsChanged:] (of "WebHTMLView.mm").
2115 // Also ignore unsupported |keyCode| (255) generated by Convert, NonConvert
2116 // and KanaMode from JIS PC keyboard.
2115 int keyCode = [theEvent keyCode]; 2117 int keyCode = [theEvent keyCode];
2116 if (!keyCode || keyCode == 10 || keyCode == 63) 2118 if (!keyCode || keyCode == 10 || keyCode == 63 || keyCode == 255)
2117 return; 2119 return;
2118 } 2120 }
2119 2121
2120 // Don't cancel child popups; the key events are probably what's triggering 2122 // Don't cancel child popups; the key events are probably what's triggering
2121 // the popup in the first place. 2123 // the popup in the first place.
2122 2124
2123 RenderWidgetHostImpl* widgetHost = renderWidgetHostView_->render_widget_host_; 2125 RenderWidgetHostImpl* widgetHost = renderWidgetHostView_->render_widget_host_;
2124 DCHECK(widgetHost); 2126 DCHECK(widgetHost);
2125 2127
2126 NativeWebKeyboardEvent event(theEvent); 2128 NativeWebKeyboardEvent event(theEvent);
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
3439 3441
3440 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3442 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3441 // regions that are not draggable. (See ControlRegionView in 3443 // regions that are not draggable. (See ControlRegionView in
3442 // native_app_window_cocoa.mm). This requires the render host view to be 3444 // native_app_window_cocoa.mm). This requires the render host view to be
3443 // draggable by default. 3445 // draggable by default.
3444 - (BOOL)mouseDownCanMoveWindow { 3446 - (BOOL)mouseDownCanMoveWindow {
3445 return YES; 3447 return YES;
3446 } 3448 }
3447 3449
3448 @end 3450 @end
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698