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

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

Issue 1505723005: Null-check GetView before using it in GetFocusedRenderWidgetHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop the event instead of giving to main frame. 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 <utility> 10 #include <utility>
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 if (parent) 2102 if (parent)
2103 parent->cocoa_view()->suppressNextEscapeKeyUp_ = YES; 2103 parent->cocoa_view()->suppressNextEscapeKeyUp_ = YES;
2104 widgetHost->Shutdown(); 2104 widgetHost->Shutdown();
2105 return; 2105 return;
2106 } 2106 }
2107 2107
2108 // If there are multiple widgets on the page (such as when there are 2108 // If there are multiple widgets on the page (such as when there are
2109 // out-of-process iframes), pick the one that should process this event. 2109 // out-of-process iframes), pick the one that should process this event.
2110 if (widgetHost->delegate()) 2110 if (widgetHost->delegate())
2111 widgetHost = widgetHost->delegate()->GetFocusedRenderWidgetHost(widgetHost); 2111 widgetHost = widgetHost->delegate()->GetFocusedRenderWidgetHost(widgetHost);
2112 if (!widgetHost)
2113 return;
2112 2114
2113 // Suppress the escape key up event if necessary. 2115 // Suppress the escape key up event if necessary.
2114 if (event.windowsKeyCode == ui::VKEY_ESCAPE && suppressNextEscapeKeyUp_) { 2116 if (event.windowsKeyCode == ui::VKEY_ESCAPE && suppressNextEscapeKeyUp_) {
2115 if (event.type == NativeWebKeyboardEvent::KeyUp) 2117 if (event.type == NativeWebKeyboardEvent::KeyUp)
2116 suppressNextEscapeKeyUp_ = NO; 2118 suppressNextEscapeKeyUp_ = NO;
2117 return; 2119 return;
2118 } 2120 }
2119 2121
2120 // Do not forward key up events unless preceded by a matching key down, 2122 // Do not forward key up events unless preceded by a matching key down,
2121 // otherwise we might get an event from releasing the return key in the 2123 // otherwise we might get an event from releasing the return key in the
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after
3442 3444
3443 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3445 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3444 // regions that are not draggable. (See ControlRegionView in 3446 // regions that are not draggable. (See ControlRegionView in
3445 // native_app_window_cocoa.mm). This requires the render host view to be 3447 // native_app_window_cocoa.mm). This requires the render host view to be
3446 // draggable by default. 3448 // draggable by default.
3447 - (BOOL)mouseDownCanMoveWindow { 3449 - (BOOL)mouseDownCanMoveWindow {
3448 return YES; 3450 return YES;
3449 } 3451 }
3450 3452
3451 @end 3453 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698