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 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 RenderWidgetHostViewMac* parent = | 2097 RenderWidgetHostViewMac* parent = |
2098 renderWidgetHostView_->fullscreen_parent_host_view(); | 2098 renderWidgetHostView_->fullscreen_parent_host_view(); |
2099 if (parent) | 2099 if (parent) |
2100 parent->cocoa_view()->suppressNextEscapeKeyUp_ = YES; | 2100 parent->cocoa_view()->suppressNextEscapeKeyUp_ = YES; |
2101 widgetHost->Shutdown(); | 2101 widgetHost->Shutdown(); |
2102 return; | 2102 return; |
2103 } | 2103 } |
2104 | 2104 |
2105 // If there are multiple widgets on the page (such as when there are | 2105 // If there are multiple widgets on the page (such as when there are |
2106 // out-of-process iframes), pick the one that should process this event. | 2106 // out-of-process iframes), pick the one that should process this event. |
2107 if (widgetHost->delegate()) { | 2107 if (widgetHost->delegate()) |
2108 RenderWidgetHostImpl* focusedHost = | 2108 widgetHost = widgetHost->delegate()->GetFocusedRenderWidgetHost(widgetHost); |
2109 widgetHost->delegate()->GetFocusedRenderWidgetHost(); | |
2110 if (focusedHost) | |
2111 widgetHost = focusedHost; | |
2112 } | |
2113 | 2109 |
2114 // Suppress the escape key up event if necessary. | 2110 // Suppress the escape key up event if necessary. |
2115 if (event.windowsKeyCode == ui::VKEY_ESCAPE && suppressNextEscapeKeyUp_) { | 2111 if (event.windowsKeyCode == ui::VKEY_ESCAPE && suppressNextEscapeKeyUp_) { |
2116 if (event.type == NativeWebKeyboardEvent::KeyUp) | 2112 if (event.type == NativeWebKeyboardEvent::KeyUp) |
2117 suppressNextEscapeKeyUp_ = NO; | 2113 suppressNextEscapeKeyUp_ = NO; |
2118 return; | 2114 return; |
2119 } | 2115 } |
2120 | 2116 |
2121 // Do not forward key up events unless preceded by a matching key down, | 2117 // Do not forward key up events unless preceded by a matching key down, |
2122 // otherwise we might get an event from releasing the return key in the | 2118 // 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 Loading... |
3443 | 3439 |
3444 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3440 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3445 // regions that are not draggable. (See ControlRegionView in | 3441 // regions that are not draggable. (See ControlRegionView in |
3446 // native_app_window_cocoa.mm). This requires the render host view to be | 3442 // native_app_window_cocoa.mm). This requires the render host view to be |
3447 // draggable by default. | 3443 // draggable by default. |
3448 - (BOOL)mouseDownCanMoveWindow { | 3444 - (BOOL)mouseDownCanMoveWindow { |
3449 return YES; | 3445 return YES; |
3450 } | 3446 } |
3451 | 3447 |
3452 @end | 3448 @end |
OLD | NEW |