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

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

Issue 2890143003: Move ContextMenu show/hide state tracking to WebContents (Closed)
Patch Set: Remove #if def Created 3 years, 6 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
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 <Carbon/Carbon.h> 7 #import <Carbon/Carbon.h>
8 #import <objc/runtime.h> 8 #import <objc/runtime.h>
9 #include <OpenGL/gl.h> 9 #include <OpenGL/gl.h>
10 #include <QuartzCore/QuartzCore.h> 10 #include <QuartzCore/QuartzCore.h>
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 if ([NSApp respondsToSelector:@selector(stopSpeaking:)]) 1127 if ([NSApp respondsToSelector:@selector(stopSpeaking:)])
1128 [NSApp stopSpeaking:cocoa_view_]; 1128 [NSApp stopSpeaking:cocoa_view_];
1129 } 1129 }
1130 1130
1131 // 1131 //
1132 // RenderWidgetHostViewCocoa uses the stored selection text, 1132 // RenderWidgetHostViewCocoa uses the stored selection text,
1133 // which implements NSServicesRequests protocol. 1133 // which implements NSServicesRequests protocol.
1134 // 1134 //
1135 1135
1136 void RenderWidgetHostViewMac::SetShowingContextMenu(bool showing) { 1136 void RenderWidgetHostViewMac::SetShowingContextMenu(bool showing) {
1137 RenderWidgetHostViewBase::SetShowingContextMenu(showing);
1138
1139 // Create a fake mouse event to inform the render widget that the mouse 1137 // Create a fake mouse event to inform the render widget that the mouse
1140 // left or entered. 1138 // left or entered.
1141 NSWindow* window = [cocoa_view_ window]; 1139 NSWindow* window = [cocoa_view_ window];
1142 // TODO(asvitkine): If the location outside of the event stream doesn't 1140 // TODO(asvitkine): If the location outside of the event stream doesn't
1143 // correspond to the current event (due to delayed event processing), then 1141 // correspond to the current event (due to delayed event processing), then
1144 // this may result in a cursor flicker if there are later mouse move events 1142 // this may result in a cursor flicker if there are later mouse move events
1145 // in the pipeline. Find a way to use the mouse location from the event that 1143 // in the pipeline. Find a way to use the mouse location from the event that
1146 // dismissed the context menu. 1144 // dismissed the context menu.
1147 NSPoint location = [window mouseLocationOutsideOfEventStream]; 1145 NSPoint location = [window mouseLocationOutsideOfEventStream];
1148 NSTimeInterval event_time = [[NSApp currentEvent] timestamp]; 1146 NSTimeInterval event_time = [[NSApp currentEvent] timestamp];
(...skipping 2442 matching lines...) Expand 10 before | Expand all | Expand 10 after
3591 3589
3592 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3590 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3593 // regions that are not draggable. (See ControlRegionView in 3591 // regions that are not draggable. (See ControlRegionView in
3594 // native_app_window_cocoa.mm). This requires the render host view to be 3592 // native_app_window_cocoa.mm). This requires the render host view to be
3595 // draggable by default. 3593 // draggable by default.
3596 - (BOOL)mouseDownCanMoveWindow { 3594 - (BOOL)mouseDownCanMoveWindow {
3597 return YES; 3595 return YES;
3598 } 3596 }
3599 3597
3600 @end 3598 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698