<commit_before>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 284f4fd..5703616 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -85,6 +85,7 @@
 #include "ui/gfx/geometry/rect_conversions.h"
 #include "ui/gfx/geometry/size_conversions.h"
 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
+#include "ui/gl/gpu_switching_manager.h"
 #include "ui/gl/gl_switches.h"
 
 using content::BrowserAccessibility;
@@ -136,6 +137,11 @@ BOOL EventIsReservedBySystem(NSEvent* event) {
 
 }  // 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;
@@ -506,7 +512,9 @@ float FlipYFromRectToScreen(float y, float rect_height) {
   background_layer_.reset([[CALayer alloc] init]);
   // Set the default color to be white. This is the wrong thing to do, but many
   // UI components expect this view to be opaque.
+#if 0
   [background_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
+#endif
   [cocoa_view_ setLayer:background_layer_];
   [cocoa_view_ setWantsLayer:YES];
 
@@ -1696,6 +1704,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
 }
 
 - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
+  if ([self.window respondsToSelector:@selector(acceptsFirstMouse)] &&
+      [self.window acceptsFirstMouse])
+    return YES;
   return [self acceptsMouseEventsWhenInactive];
 }
 
@@ -1837,6 +1848,7 @@ - (BOOL)performKeyEquivalent:(NSEvent*)theEvent {
   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
@@ -1850,6 +1862,7 @@ - (BOOL)performKeyEquivalent:(NSEvent*)theEvent {
     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
@@ -2605,6 +2618,9 @@ - (RenderWidgetHostViewMac*)renderWidgetHostViewMac {
 // move) for the given event. Customize here to be more selective about which
 // key presses to autohide on.
 + (BOOL)shouldAutohideCursorForEvent:(NSEvent*)event {
+  if ([event.window respondsToSelector:@selector(disableAutoHideCursor)] &&
+      [event.window disableAutoHideCursor])
+    return NO;
   return ([event type] == NSKeyDown &&
              !([event modifierFlags] & NSCommandKeyMask)) ? YES : NO;
 }
@@ -2761,9 +2777,11 @@ - (id)accessibilityFocusedUIElement {
 // 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.
@@ -2772,7 +2790,9 @@ - (NSArray *)validAttributesForMarkedText {
         NSUnderlineStyleAttributeName,
         NSUnderlineColorAttributeName,
         NSMarkedClauseSegmentAttributeName,
+#ifndef MAS_BUILD
         NSTextInputReplacementRangeAttributeName,
+#endif
         nil]);
   }
   return validAttributesForMarkedText_.get();
@@ -3221,6 +3241,10 @@ - (BOOL)readSelectionFromPasteboard:(NSPasteboard*)pboard {
 }
 
 - (BOOL)isOpaque {
+  bool wantsTransparent = ui::GpuSwitchingManager::UseTransparent() ||<commit_msg>Update render_widget_host_view_mac.patch<commit_after>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 40a2fe7..3242b3e 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -85,6 +85,7 @@
 #include "ui/gfx/geometry/rect_conversions.h"
 #include "ui/gfx/geometry/size_conversions.h"
 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
+#include "ui/gl/gpu_switching_manager.h"
 #include "ui/gl/gl_switches.h"
 
 using content::BrowserAccessibility;
@@ -136,6 +137,11 @@ BOOL EventIsReservedBySystem(NSEvent* event) {
 
 }  // 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;
@@ -506,7 +512,9 @@ float FlipYFromRectToScreen(float y, float rect_height) {
   background_layer_.reset([[CALayer alloc] init]);
   // Set the default color to be white. This is the wrong thing to do, but many
   // UI components expect this view to be opaque.
+#if 0
   [background_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
+#endif
   [cocoa_view_ setLayer:background_layer_];
   [cocoa_view_ setWantsLayer:YES];
 
@@ -1700,6 +1708,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
 }
 
 - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
+  if ([self.window respondsToSelector:@selector(acceptsFirstMouse)] &&
+      [self.window acceptsFirstMouse])
+    return YES;
   return [self acceptsMouseEventsWhenInactive];
 }
 
@@ -1841,6 +1852,7 @@ - (BOOL)performKeyEquivalent:(NSEvent*)theEvent {
   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
@@ -1854,6 +1866,7 @@ - (BOOL)performKeyEquivalent:(NSEvent*)theEvent {
     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
@@ -2609,6 +2622,9 @@ - (RenderWidgetHostViewMac*)renderWidgetHostViewMac {
 // move) for the given event. Customize here to be more selective about which
 // key presses to autohide on.
 + (BOOL)shouldAutohideCursorForEvent:(NSEvent*)event {
+  if ([event.window respondsToSelector:@selector(disableAutoHideCursor)] &&
+      [event.window disableAutoHideCursor])
+    return NO;
   return ([event type] == NSKeyDown &&
              !([event modifierFlags] & NSCommandKeyMask)) ? YES : NO;
 }
@@ -2765,9 +2781,11 @@ - (id)accessibilityFocusedUIElement {
 // 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.
@@ -2776,7 +2794,9 @@ - (NSArray *)validAttributesForMarkedText {
         NSUnderlineStyleAttributeName,
         NSUnderlineColorAttributeName,
         NSMarkedClauseSegmentAttributeName,
+#ifndef MAS_BUILD
         NSTextInputReplacementRangeAttributeName,
+#endif
         nil]);
   }
   return validAttributesForMarkedText_.get();
@@ -3225,6 +3245,10 @@ - (BOOL)readSelectionFromPasteboard:(NSPasteboard*)pboard {
 }
 
 - (BOOL)isOpaque {
+  bool wantsTransparent = ui::GpuSwitchingManager::UseTransparent() ||
{'fraction_non_alphanumeric': 0.11815711142746214, 'fraction_numerical': 0.030542254432509384, 'mean_word_length': 4.587852494577007, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2481330', 'n_tokens_mistral': 2690, 'n_tokens_neox': 2474, 'n_words': 581}