2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_cocoa.mm b/content/browser/renderer_host/render_widget_host_view_cocoa.mm
|
2018-09-14 18:03:43 +00:00
|
|
|
index 5b4ae0732914..ea774eb81c75 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/renderer_host/render_widget_host_view_cocoa.mm
|
|
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_cocoa.mm
|
2018-09-14 18:03:43 +00:00
|
|
|
@@ -179,6 +179,11 @@ void ExtractUnderlines(NSAttributedString* string,
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
+@interface NSWindow (AtomCustomMethods)
|
|
|
|
+- (BOOL)acceptsFirstMouse;
|
|
|
|
+- (BOOL)disableAutoHideCursor;
|
|
|
|
+@end
|
|
|
|
+
|
|
|
|
// These are not documented, so use only after checking -respondsToSelector:.
|
|
|
|
@interface NSApplication (UndocumentedSpeechMethods)
|
|
|
|
- (void)speakString:(NSString*)string;
|
2018-09-14 18:03:43 +00:00
|
|
|
@@ -363,6 +368,9 @@ void ExtractUnderlines(NSAttributedString* string,
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
|
|
|
|
+ if ([self.window respondsToSelector:@selector(acceptsFirstMouse)] &&
|
|
|
|
+ [self.window acceptsFirstMouse])
|
|
|
|
+ return YES;
|
|
|
|
return [self acceptsMouseEventsWhenInactive];
|
|
|
|
}
|
|
|
|
|
2018-09-14 18:03:43 +00:00
|
|
|
@@ -587,6 +595,7 @@ void ExtractUnderlines(NSAttributedString* string,
|
2018-09-14 05:02:16 +00:00
|
|
|
if (EventIsReservedBySystem(theEvent))
|
|
|
|
return NO;
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
// If we return |NO| from this function, cocoa will send the key event to
|
|
|
|
// the menu and only if the menu does not process the event to |keyDown:|. We
|
|
|
|
// want to send the event to a renderer _before_ sending it to the menu, so
|
2018-09-14 18:03:43 +00:00
|
|
|
@@ -600,6 +609,7 @@ void ExtractUnderlines(NSAttributedString* string,
|
2018-09-14 05:02:16 +00:00
|
|
|
DCHECK(![[NSApp mainMenu] performKeyEquivalent:theEvent]);
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// Command key combinations are sent via performKeyEquivalent rather than
|
|
|
|
// keyDown:. We just forward this on and if WebCore doesn't want to handle
|
2018-09-14 18:03:43 +00:00
|
|
|
@@ -699,6 +709,10 @@ void ExtractUnderlines(NSAttributedString* string,
|
2018-09-14 05:02:16 +00:00
|
|
|
eventType == NSKeyDown &&
|
|
|
|
!(modifierFlags & NSCommandKeyMask);
|
|
|
|
|
|
|
|
+ if ([theEvent.window respondsToSelector:@selector(disableAutoHideCursor)] &&
|
|
|
|
+ [theEvent.window disableAutoHideCursor])
|
|
|
|
+ shouldAutohideCursor = NO;
|
|
|
|
+
|
|
|
|
// We only handle key down events and just simply forward other events.
|
|
|
|
if (eventType != NSKeyDown) {
|
|
|
|
client_->OnNSViewForwardKeyboardEvent(event, latency_info);
|
2018-09-14 18:03:43 +00:00
|
|
|
@@ -1461,9 +1475,11 @@ void ExtractUnderlines(NSAttributedString* string,
|
2018-09-14 05:02:16 +00:00
|
|
|
// Since this implementation doesn't have to wait any IPC calls, this doesn't
|
|
|
|
// make any key-typing jank. --hbono 7/23/09
|
|
|
|
//
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
extern "C" {
|
|
|
|
extern NSString* NSTextInputReplacementRangeAttributeName;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
- (NSArray*)validAttributesForMarkedText {
|
|
|
|
// This code is just copied from WebKit except renaming variables.
|
2018-09-14 18:03:43 +00:00
|
|
|
@@ -1472,7 +1488,10 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
|
2018-09-14 05:02:16 +00:00
|
|
|
initWithObjects:NSUnderlineStyleAttributeName,
|
|
|
|
NSUnderlineColorAttributeName,
|
|
|
|
NSMarkedClauseSegmentAttributeName,
|
|
|
|
- NSTextInputReplacementRangeAttributeName, nil]);
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
+ NSTextInputReplacementRangeAttributeName,
|
|
|
|
+#endif
|
|
|
|
+ nil]);
|
|
|
|
}
|
|
|
|
return validAttributesForMarkedText_.get();
|
|
|
|
}
|
2018-09-14 18:03:43 +00:00
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
|
|
index 8b012bcb8f77..077ccbeaa913 100644
|
|
|
|
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
|
|
|
@@ -53,6 +53,7 @@
|
|
|
|
#include "ui/events/keycodes/dom/dom_code.h"
|
|
|
|
#include "ui/gfx/geometry/dip_util.h"
|
|
|
|
#include "ui/gfx/mac/coordinate_conversion.h"
|
|
|
|
+#include "ui/gl/gpu_switching_manager.h"
|
|
|
|
|
|
|
|
using blink::WebInputEvent;
|
|
|
|
using blink::WebMouseEvent;
|
|
|
|
--
|
|
|
|
2.17.0
|
|
|
|
|