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

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

Issue 1407173005: Revert of OOPIF: Route keyboard events to focused frame in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus-page
Patch Set: Created 5 years, 1 month 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 10
(...skipping 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 event.windowsKeyCode == ui::VKEY_ESCAPE && 2146 event.windowsKeyCode == ui::VKEY_ESCAPE &&
2147 renderWidgetHostView_->pepper_fullscreen_window()) { 2147 renderWidgetHostView_->pepper_fullscreen_window()) {
2148 RenderWidgetHostViewMac* parent = 2148 RenderWidgetHostViewMac* parent =
2149 renderWidgetHostView_->fullscreen_parent_host_view(); 2149 renderWidgetHostView_->fullscreen_parent_host_view();
2150 if (parent) 2150 if (parent)
2151 parent->cocoa_view()->suppressNextEscapeKeyUp_ = YES; 2151 parent->cocoa_view()->suppressNextEscapeKeyUp_ = YES;
2152 widgetHost->Shutdown(); 2152 widgetHost->Shutdown();
2153 return; 2153 return;
2154 } 2154 }
2155 2155
2156 // If there are multiple widgets on the page (such as when there are
2157 // out-of-process iframes), pick the one that should process this event.
2158 if (widgetHost->delegate()) {
2159 RenderWidgetHostImpl* focusedHost =
2160 widgetHost->delegate()->GetFocusedRenderWidgetHost();
2161 if (focusedHost)
2162 widgetHost = focusedHost;
2163 }
2164
2165 // Suppress the escape key up event if necessary. 2156 // Suppress the escape key up event if necessary.
2166 if (event.windowsKeyCode == ui::VKEY_ESCAPE && suppressNextEscapeKeyUp_) { 2157 if (event.windowsKeyCode == ui::VKEY_ESCAPE && suppressNextEscapeKeyUp_) {
2167 if (event.type == NativeWebKeyboardEvent::KeyUp) 2158 if (event.type == NativeWebKeyboardEvent::KeyUp)
2168 suppressNextEscapeKeyUp_ = NO; 2159 suppressNextEscapeKeyUp_ = NO;
2169 return; 2160 return;
2170 } 2161 }
2171 2162
2172 // Do not forward key up events unless preceded by a matching key down, 2163 // Do not forward key up events unless preceded by a matching key down,
2173 // otherwise we might get an event from releasing the return key in the 2164 // otherwise we might get an event from releasing the return key in the
2174 // omnibox (http://crbug.com/338736). 2165 // omnibox (http://crbug.com/338736).
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
3494 3485
3495 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3486 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3496 // regions that are not draggable. (See ControlRegionView in 3487 // regions that are not draggable. (See ControlRegionView in
3497 // native_app_window_cocoa.mm). This requires the render host view to be 3488 // native_app_window_cocoa.mm). This requires the render host view to be
3498 // draggable by default. 3489 // draggable by default.
3499 - (BOOL)mouseDownCanMoveWindow { 3490 - (BOOL)mouseDownCanMoveWindow {
3500 return YES; 3491 return YES;
3501 } 3492 }
3502 3493
3503 @end 3494 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698