2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-21 00:30:26 +00:00
|
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
2018-10-09 17:37:20 +00:00
|
|
|
Date: Tue, 9 Oct 2018 10:36:20 -0700
|
2021-05-19 18:20:12 +00:00
|
|
|
Subject: mas: avoid some private APIs
|
2018-09-21 00:30:26 +00:00
|
|
|
|
|
|
|
Guard usages in blink of private Mac APIs by MAS_BUILD, so they can be
|
|
|
|
excluded for people who want to submit their apps to the Mac App store.
|
|
|
|
|
2020-06-22 17:35:10 +00:00
|
|
|
diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
|
2022-01-10 22:31:39 +00:00
|
|
|
index dc33d3674d6c3cf794a401a4c41bd1980ccd9a51..b44a24bcde38e407f93b13e5699323055d4a8a62 100644
|
2020-06-22 17:35:10 +00:00
|
|
|
--- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm
|
|
|
|
+++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -275,6 +275,7 @@
|
|
|
|
return PopulateArray((NSArray*)value, indexer);
|
2020-06-22 17:35:10 +00:00
|
|
|
}
|
2022-01-10 22:31:39 +00:00
|
|
|
|
2020-06-22 17:35:10 +00:00
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
// AXTextMarker
|
|
|
|
if (content::IsAXTextMarker(value)) {
|
2021-03-04 23:46:13 +00:00
|
|
|
return PopulateTextPosition(content::AXTextMarkerToAXPosition(value),
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -284,6 +285,7 @@
|
|
|
|
// AXTextMarkerRange
|
|
|
|
if (content::IsAXTextMarkerRange(value))
|
|
|
|
return PopulateTextMarkerRange(value, indexer);
|
2020-06-22 17:35:10 +00:00
|
|
|
+#endif
|
2020-10-16 01:30:41 +00:00
|
|
|
|
2022-01-10 22:31:39 +00:00
|
|
|
return AXNSObjectToBaseValue(value, indexer);
|
|
|
|
}
|
|
|
|
@@ -322,7 +324,7 @@
|
2021-05-04 03:13:46 +00:00
|
|
|
AXMakeConst(affinity));
|
2020-06-22 17:35:10 +00:00
|
|
|
return set;
|
|
|
|
}
|
|
|
|
-
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
base::Value AccessibilityTreeFormatterMac::PopulateTextMarkerRange(
|
2021-03-04 23:46:13 +00:00
|
|
|
id marker_range,
|
2022-01-10 22:31:39 +00:00
|
|
|
const AXTreeIndexerMac* indexer) const {
|
|
|
|
@@ -338,7 +340,7 @@
|
|
|
|
PopulateTextPosition(ax_range.focus()->Clone(), indexer));
|
2020-06-22 17:35:10 +00:00
|
|
|
return dict;
|
|
|
|
}
|
|
|
|
-
|
|
|
|
+#endif
|
|
|
|
base::Value AccessibilityTreeFormatterMac::PopulateArray(
|
|
|
|
NSArray* node_array,
|
2022-01-10 22:31:39 +00:00
|
|
|
const AXTreeIndexerMac* indexer) const {
|
2021-08-11 21:04:56 +00:00
|
|
|
diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.h b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.h
|
2022-01-10 22:31:39 +00:00
|
|
|
index 2b05b9e3b9a5f4ad1951fbbbfa34adf129d8f408..0ca278cf6bb0ecc2127f5507941cf592449e2e61 100644
|
2021-08-11 21:04:56 +00:00
|
|
|
--- a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.h
|
|
|
|
+++ b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.h
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -89,12 +89,14 @@ class CONTENT_EXPORT AttributeInvoker final {
|
2021-08-11 21:04:56 +00:00
|
|
|
const ui::AXPropertyNode&,
|
|
|
|
bool log_failure = true) const;
|
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
id DictNodeToTextMarker(const ui::AXPropertyNode&,
|
|
|
|
bool log_failure = true) const;
|
|
|
|
id PropertyNodeToTextMarker(const ui::AXPropertyNode&,
|
|
|
|
bool log_failure = true) const;
|
|
|
|
id PropertyNodeToTextMarkerRange(const ui::AXPropertyNode&,
|
|
|
|
bool log_failure = true) const;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
gfx::NativeViewAccessible LineIndexToNode(
|
|
|
|
const std::u16string line_index) const;
|
2020-08-15 01:51:28 +00:00
|
|
|
diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm
|
2022-01-10 22:31:39 +00:00
|
|
|
index 696d87b7aaf0c9de9c071bd97197192720752010..ebf3935d20ba22ccc0473252a1323be4bd003eec 100644
|
2020-08-15 01:51:28 +00:00
|
|
|
--- a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm
|
|
|
|
+++ b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -189,9 +189,11 @@
|
|
|
|
if (IsNSAccessibilityElement(target) || IsAXUIElement(target))
|
2021-06-22 19:17:16 +00:00
|
|
|
return InvokeForAXElement(target, property_node);
|
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
if (content::IsAXTextMarkerRange(target)) {
|
|
|
|
return InvokeForAXTextMarkerRange(target, property_node);
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if ([target isKindOfClass:[NSArray class]])
|
|
|
|
return InvokeForArray(target, property_node);
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -389,6 +391,7 @@
|
2021-06-03 08:05:04 +00:00
|
|
|
property_name == "AXTextMarkerRangeForUIElement") { // UIElement
|
2022-01-10 22:31:39 +00:00
|
|
|
return OptionalNSObject::NotNullOrError(PropertyNodeToUIElement(arg_node));
|
2020-08-15 01:51:28 +00:00
|
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
2021-06-05 02:03:31 +00:00
|
|
|
if (property_name == "AXIndexForTextMarker" ||
|
|
|
|
property_name == "AXNextWordEndTextMarkerForTextMarker" ||
|
|
|
|
property_name ==
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -400,6 +403,7 @@
|
|
|
|
return OptionalNSObject::NotNullOrError(
|
2020-08-15 01:51:28 +00:00
|
|
|
PropertyNodeToTextMarkerRange(arg_node));
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
return OptionalNSObject::NotApplicable();
|
|
|
|
}
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -412,6 +416,7 @@
|
2021-08-11 21:04:56 +00:00
|
|
|
return value;
|
|
|
|
|
|
|
|
// NSRange
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
value = PropertyNodeToRange(property_node, false);
|
|
|
|
if (value)
|
|
|
|
return value;
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -428,6 +433,10 @@
|
2021-08-11 21:04:56 +00:00
|
|
|
|
|
|
|
// TextMarkerRange
|
|
|
|
return PropertyNodeToTextMarkerRange(property_node, false);
|
|
|
|
+#else
|
|
|
|
+
|
|
|
|
+ return PropertyNodeToRange(property_node, false);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// NSNumber. Format: integer.
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -538,6 +547,7 @@
|
2020-08-15 01:51:28 +00:00
|
|
|
return uielement;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
2021-08-11 21:04:56 +00:00
|
|
|
id AttributeInvoker::DictNodeToTextMarker(const AXPropertyNode& dictnode,
|
|
|
|
bool log_failure) const {
|
2020-08-15 01:51:28 +00:00
|
|
|
if (!dictnode.IsDict()) {
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -627,6 +637,7 @@
|
2021-08-11 21:04:56 +00:00
|
|
|
|
|
|
|
return content::AXTextMarkerRangeFrom(anchor_textmarker, focus_textmarker);
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
2021-11-24 08:45:59 +00:00
|
|
|
} // namespace a11y
|
|
|
|
} // namespace content
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
|
2022-01-10 22:31:39 +00:00
|
|
|
index 8ba9ceef621eaa8539d2e127ab75c23ab671f2a1..cdcf397f3fb4fb98b48fcd5080edb883eeb9b52e 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/accessibility/browser_accessibility_cocoa.h
|
|
|
|
+++ b/content/browser/accessibility/browser_accessibility_cocoa.h
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -148,7 +148,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
2018-09-14 05:02:16 +00:00
|
|
|
@property(nonatomic, readonly) NSNumber* enabled;
|
|
|
|
// Returns a text marker that points to the last character in the document that
|
|
|
|
// can be selected with Voiceover.
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
@property(nonatomic, readonly) id endTextMarker;
|
|
|
|
+#endif
|
|
|
|
@property(nonatomic, readonly) NSNumber* expanded;
|
|
|
|
@property(nonatomic, readonly) NSNumber* focused;
|
|
|
|
@property(nonatomic, readonly) NSNumber* grabbed;
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -160,7 +162,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
2019-10-18 19:57:34 +00:00
|
|
|
// Index of a row, column, or tree item.
|
|
|
|
@property(nonatomic, readonly) NSNumber* index;
|
2020-10-16 01:30:41 +00:00
|
|
|
@property(nonatomic, readonly) NSNumber* treeItemRowIndex;
|
2019-10-18 19:57:34 +00:00
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
@property(nonatomic, readonly) NSNumber* insertionPointLineNumber;
|
|
|
|
+#endif
|
|
|
|
@property(nonatomic, readonly) NSNumber* isMultiSelectable;
|
2021-10-21 18:51:36 +00:00
|
|
|
@property(nonatomic, readonly) NSNumber* loaded;
|
2021-11-24 08:45:59 +00:00
|
|
|
@property(nonatomic, readonly) NSNumber* loadingProgress;
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -179,14 +183,18 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
2019-10-18 19:57:34 +00:00
|
|
|
// The object is selected as a whole.
|
|
|
|
@property(nonatomic, readonly) NSNumber* selected;
|
2018-09-14 05:02:16 +00:00
|
|
|
@property(nonatomic, readonly) NSArray* selectedChildren;
|
2019-10-18 19:57:34 +00:00
|
|
|
+#ifndef MAS_BUILD
|
2018-09-14 05:02:16 +00:00
|
|
|
@property(nonatomic, readonly) NSString* selectedText;
|
|
|
|
@property(nonatomic, readonly) NSValue* selectedTextRange;
|
|
|
|
@property(nonatomic, readonly) id selectedTextMarkerRange;
|
|
|
|
+#endif
|
|
|
|
@property(nonatomic, readonly) NSValue* size;
|
|
|
|
@property(nonatomic, readonly) NSString* sortDirection;
|
|
|
|
// Returns a text marker that points to the first character in the document that
|
|
|
|
// can be selected with Voiceover.
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
@property(nonatomic, readonly) id startTextMarker;
|
|
|
|
+#endif
|
|
|
|
// A string indicating the subrole of this object as far as accessibility
|
|
|
|
// is concerned.
|
|
|
|
@property(nonatomic, readonly) NSString* subrole;
|
|
|
|
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
2022-01-10 22:31:39 +00:00
|
|
|
index 34fbe096ddcc84b156384f12a23f278c0f94e385..043c9b8113c4f15f0248839a69b7ee76e3da2794 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
|
|
|
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -188,6 +188,7 @@
|
2019-11-05 23:41:20 +00:00
|
|
|
|
|
|
|
// Private attributes that can be used for testing text markers, e.g. in dump
|
|
|
|
// tree tests.
|
2022-01-10 22:31:39 +00:00
|
|
|
+#ifndef MAS_BUILD
|
2019-11-05 23:41:20 +00:00
|
|
|
NSString* const
|
2022-01-10 22:31:39 +00:00
|
|
|
NSAccessibilityTextMarkerDebugDescriptionParameterizedAttribute =
|
|
|
|
@"AXTextMarkerDebugDescription";
|
|
|
|
@@ -197,6 +198,7 @@
|
2019-11-05 23:41:20 +00:00
|
|
|
NSString* const
|
|
|
|
NSAccessibilityTextMarkerNodeDebugDescriptionParameterizedAttribute =
|
|
|
|
@"AXTextMarkerNodeDebugDescription";
|
2019-12-05 19:04:34 +00:00
|
|
|
+#endif
|
2019-11-05 23:41:20 +00:00
|
|
|
|
|
|
|
// Other private attributes.
|
2021-01-12 23:31:23 +00:00
|
|
|
NSString* const NSAccessibilityIdentifierChromeAttribute = @"ChromeAXNodeId";
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -224,6 +226,7 @@
|
2018-09-14 05:02:16 +00:00
|
|
|
// The following are private accessibility APIs required for cursor navigation
|
2021-11-24 08:45:59 +00:00
|
|
|
// and text selection. VoiceOver started relying on them in Mac OS X 10.11.
|
|
|
|
// They are public as of the 12.0 SDK.
|
2022-01-10 22:31:39 +00:00
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
#if !defined(MAC_OS_VERSION_12_0) || \
|
|
|
|
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_VERSION_12_0
|
|
|
|
using AXTextMarkerRangeRef = CFTypeRef;
|
|
|
|
@@ -455,6 +458,7 @@ void AddMisspelledTextAttributes(const BrowserAccessibility::AXRange& ax_range,
|
2019-07-09 01:00:24 +00:00
|
|
|
AddMisspelledTextAttributes(ax_range, attributed_text);
|
2019-07-03 01:22:09 +00:00
|
|
|
return attributed_text;
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// Returns an autoreleased copy of the AXNodeData's attribute.
|
2019-03-21 15:45:22 +00:00
|
|
|
NSString* NSStringForStringAttribute(BrowserAccessibility* browserAccessibility,
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -716,6 +720,7 @@ bool IsSelectedStateRelevant(BrowserAccessibility* item) {
|
2021-08-11 21:04:56 +00:00
|
|
|
0 == strcmp([value objCType], @encode(NSRange));
|
|
|
|
}
|
2020-06-22 17:35:10 +00:00
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
bool content::IsAXTextMarker(id object) {
|
|
|
|
if (object == nil)
|
|
|
|
return false;
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -760,6 +765,7 @@ bool IsSelectedStateRelevant(BrowserAccessibility* item) {
|
2021-11-24 08:45:59 +00:00
|
|
|
static_cast<AXTextMarkerRef>(focus_textmarker));
|
2020-07-14 01:13:34 +00:00
|
|
|
return [static_cast<id>(cf_marker_range) autorelease];
|
2020-06-22 17:35:10 +00:00
|
|
|
}
|
|
|
|
+#endif
|
2020-07-14 01:13:34 +00:00
|
|
|
|
2020-06-22 17:35:10 +00:00
|
|
|
@implementation BrowserAccessibilityCocoa
|
|
|
|
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -784,7 +790,9 @@ + (void)initialize {
|
2018-09-14 05:02:16 +00:00
|
|
|
{NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
|
2019-02-26 21:31:29 +00:00
|
|
|
{NSAccessibilityElementBusyAttribute, @"elementBusy"},
|
2018-09-14 05:02:16 +00:00
|
|
|
{NSAccessibilityEnabledAttribute, @"enabled"},
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
{NSAccessibilityEndTextMarkerAttribute, @"endTextMarker"},
|
|
|
|
+#endif
|
|
|
|
{NSAccessibilityExpandedAttribute, @"expanded"},
|
2018-09-21 00:30:26 +00:00
|
|
|
{NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
|
2018-09-14 05:02:16 +00:00
|
|
|
{NSAccessibilityFocusedAttribute, @"focused"},
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -794,8 +802,10 @@ + (void)initialize {
|
2019-10-18 19:57:34 +00:00
|
|
|
{NSAccessibilityHighestEditableAncestorAttribute,
|
|
|
|
@"highestEditableAncestor"},
|
|
|
|
{NSAccessibilityIndexAttribute, @"index"},
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
{NSAccessibilityInsertionPointLineNumberAttribute,
|
|
|
|
@"insertionPointLineNumber"},
|
|
|
|
+#endif
|
|
|
|
{NSAccessibilityIsMultiSelectableAttribute, @"isMultiSelectable"},
|
|
|
|
{NSAccessibilityLanguageAttribute, @"language"},
|
2021-11-24 08:45:59 +00:00
|
|
|
{NSAccessibilityLinkedUIElementsAttribute, @"linkedUIElements"},
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -814,13 +824,17 @@ + (void)initialize {
|
2018-09-14 05:02:16 +00:00
|
|
|
{NSAccessibilityRowsAttribute, @"rows"},
|
|
|
|
// TODO(aboxhall): expose
|
|
|
|
// NSAccessibilityServesAsTitleForUIElementsAttribute
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
{NSAccessibilityStartTextMarkerAttribute, @"startTextMarker"},
|
|
|
|
+#endif
|
|
|
|
{NSAccessibilitySelectedAttribute, @"selected"},
|
|
|
|
{NSAccessibilitySelectedChildrenAttribute, @"selectedChildren"},
|
2019-10-18 19:57:34 +00:00
|
|
|
+#ifndef MAS_BUILD
|
2018-09-14 05:02:16 +00:00
|
|
|
{NSAccessibilitySelectedTextAttribute, @"selectedText"},
|
|
|
|
{NSAccessibilitySelectedTextRangeAttribute, @"selectedTextRange"},
|
|
|
|
{NSAccessibilitySelectedTextMarkerRangeAttribute,
|
|
|
|
@"selectedTextMarkerRange"},
|
|
|
|
+#endif
|
|
|
|
{NSAccessibilitySizeAttribute, @"size"},
|
|
|
|
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
|
|
|
|
{NSAccessibilitySubroleAttribute, @"subrole"},
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -1160,12 +1174,14 @@ - (NSNumber*)enabled {
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
// Returns a text marker that points to the last character in the document that
|
|
|
|
// can be selected with VoiceOver.
|
2022-01-10 22:31:39 +00:00
|
|
|
+#ifndef MAS_BUILD
|
2018-09-14 05:02:16 +00:00
|
|
|
- (id)endTextMarker {
|
2022-01-10 22:31:39 +00:00
|
|
|
if (![self instanceActive])
|
|
|
|
return nil;
|
2021-06-22 19:17:16 +00:00
|
|
|
BrowserAccessibility::AXPosition position = _owner->CreateTextPositionAt(0);
|
2021-01-12 23:31:23 +00:00
|
|
|
return CreateTextMarker(position->CreatePositionAtEndOfContent());
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
- (NSNumber*)expanded {
|
|
|
|
if (![self instanceActive])
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -1338,6 +1354,7 @@ - (bool)findRowIndex:(BrowserAccessibilityCocoa*)toFind
|
2020-10-16 01:30:41 +00:00
|
|
|
return false;
|
2019-10-18 19:57:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
2021-09-01 19:55:07 +00:00
|
|
|
- (NSNumber*)AXInsertionPointLineNumber {
|
|
|
|
return [self insertionPointLineNumber];
|
|
|
|
}
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -1368,6 +1385,7 @@ - (NSNumber*)insertionPointLineNumber {
|
2019-10-18 19:57:34 +00:00
|
|
|
caretPosition->AsTextPosition()->text_offset());
|
2022-01-10 22:31:39 +00:00
|
|
|
return @(std::distance(lineStarts.begin(), iterator));
|
2019-10-18 19:57:34 +00:00
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
// Returns whether or not this node should be ignored in the
|
|
|
|
// accessibility tree.
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -1692,8 +1710,12 @@ - (BOOL)shouldExposeTitleUIElement {
|
2021-03-15 18:32:18 +00:00
|
|
|
return content::AXTextEdit(newValue, std::u16string(), nil);
|
2020-08-12 18:33:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
return content::AXTextEdit(insertedText, deletedText,
|
2021-06-22 19:17:16 +00:00
|
|
|
CreateTextMarker(_owner->CreateTextPositionAt(i)));
|
2020-08-12 18:33:58 +00:00
|
|
|
+#else
|
|
|
|
+ return content::AXTextEdit(insertedText, deletedText, nil);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
2021-10-06 02:21:00 +00:00
|
|
|
// internal
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -1881,6 +1903,7 @@ - (NSArray*)selectedChildren {
|
2019-10-18 19:57:34 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
2021-09-01 19:55:07 +00:00
|
|
|
- (NSString*)AXSelectedText {
|
|
|
|
return [self selectedText];
|
2019-10-18 19:57:34 +00:00
|
|
|
}
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -1941,6 +1964,7 @@ - (id)selectedTextMarkerRange {
|
2020-08-12 18:33:58 +00:00
|
|
|
// words correctly.
|
2020-12-22 22:14:44 +00:00
|
|
|
return CreateTextMarkerRange(ax_range.AsBackwardRange());
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
- (NSValue*)size {
|
|
|
|
if (![self instanceActive])
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -1975,12 +1999,14 @@ - (NSString*)sortDirection {
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
// Returns a text marker that points to the first character in the document that
|
|
|
|
// can be selected with VoiceOver.
|
2022-01-10 22:31:39 +00:00
|
|
|
+#ifndef MAS_BUILD
|
2018-09-14 05:02:16 +00:00
|
|
|
- (id)startTextMarker {
|
2022-01-10 22:31:39 +00:00
|
|
|
if (![self instanceActive])
|
|
|
|
return nil;
|
2021-06-22 19:17:16 +00:00
|
|
|
BrowserAccessibility::AXPosition position = _owner->CreateTextPositionAt(0);
|
2021-01-12 23:31:23 +00:00
|
|
|
return CreateTextMarker(position->CreatePositionAtStartOfContent());
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
2021-09-01 19:55:07 +00:00
|
|
|
- (NSString*)AXSubrole {
|
|
|
|
return [self subrole];
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -2308,12 +2334,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
|
2021-11-24 08:45:59 +00:00
|
|
|
NSMutableAttributedString* attributedTextContent =
|
2020-04-13 23:39:26 +00:00
|
|
|
[[[NSMutableAttributedString alloc]
|
2021-11-24 08:45:59 +00:00
|
|
|
initWithString:base::SysUTF16ToNSString(textContent)] autorelease];
|
2018-09-14 05:02:16 +00:00
|
|
|
+#ifndef MAS_BUILD
|
2020-07-14 01:13:34 +00:00
|
|
|
if (!_owner->IsText()) {
|
2021-03-04 23:46:13 +00:00
|
|
|
BrowserAccessibility::AXRange ax_range(
|
2021-06-22 19:17:16 +00:00
|
|
|
_owner->CreateTextPositionAt(0),
|
2021-11-24 08:45:59 +00:00
|
|
|
_owner->CreateTextPositionAt(static_cast<int>(textContent.length())));
|
|
|
|
AddMisspelledTextAttributes(ax_range, attributedTextContent);
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
2021-11-24 08:45:59 +00:00
|
|
|
return [attributedTextContent attributedSubstringFromRange:range];
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -2448,6 +2476,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
2019-01-08 23:59:47 +00:00
|
|
|
return ToBrowserAccessibilityCocoa(cell);
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
2021-03-04 23:46:13 +00:00
|
|
|
if ([attribute
|
|
|
|
isEqualToString:
|
|
|
|
NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) {
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -2786,6 +2815,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
2019-08-15 20:50:58 +00:00
|
|
|
|
2021-06-22 19:17:16 +00:00
|
|
|
return CreateTextMarker(root->CreateTextPositionAt(index));
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if ([attribute isEqualToString:
|
2019-03-21 15:45:22 +00:00
|
|
|
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -2816,6 +2846,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
2018-09-14 05:02:16 +00:00
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
2019-03-21 15:45:22 +00:00
|
|
|
if ([attribute
|
|
|
|
isEqualToString:
|
|
|
|
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -2935,6 +2966,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
return @(child->GetIndexInParent());
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
return nil;
|
|
|
|
}
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -3453,6 +3485,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
2021-08-24 00:52:17 +00:00
|
|
|
->AsTextSelectionPosition()));
|
2021-08-11 21:04:56 +00:00
|
|
|
}
|
2020-11-14 00:16:56 +00:00
|
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
if ([attribute
|
|
|
|
isEqualToString:NSAccessibilitySelectedTextMarkerRangeAttribute]) {
|
2021-03-04 23:46:13 +00:00
|
|
|
BrowserAccessibility::AXRange range = CreateRangeFromTextMarkerRange(value);
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -3463,6 +3496,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
2021-08-24 00:52:17 +00:00
|
|
|
range.anchor()->AsTextSelectionPosition(),
|
|
|
|
range.focus()->AsTextSelectionPosition()));
|
2020-11-14 00:16:56 +00:00
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
2020-12-14 18:57:36 +00:00
|
|
|
- (id)accessibilityFocusedUIElement {
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
2021-11-24 08:45:59 +00:00
|
|
|
index 2084f4677670646ba769f2fe68797a5e5647f3f3..49914bdc1cbd8f55fcd55eaf912df04279d86bb7 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
|
|
|
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
2021-09-01 19:55:07 +00:00
|
|
|
@@ -502,7 +502,7 @@ void PostAnnouncementNotification(NSString* announcement) {
|
2021-02-09 20:16:21 +00:00
|
|
|
if (native_focus_object && [native_focus_object instanceActive]) {
|
|
|
|
[user_info setObject:native_focus_object
|
|
|
|
forKey:ui::NSAccessibilityTextChangeElement];
|
|
|
|
-
|
2018-09-14 05:02:16 +00:00
|
|
|
+#ifndef MAS_BUILD
|
2021-02-09 20:16:21 +00:00
|
|
|
id selected_text = [native_focus_object selectedTextMarkerRange];
|
|
|
|
if (selected_text) {
|
|
|
|
NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute =
|
2021-09-01 19:55:07 +00:00
|
|
|
@@ -510,6 +510,7 @@ void PostAnnouncementNotification(NSString* announcement) {
|
2021-02-09 20:16:21 +00:00
|
|
|
[user_info setObject:selected_text
|
|
|
|
forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
2021-02-09 20:16:21 +00:00
|
|
|
+#endif
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
|
2021-02-09 20:16:21 +00:00
|
|
|
return user_info;
|
2021-09-01 19:55:07 +00:00
|
|
|
diff --git a/content/common/pseudonymization_salt.cc b/content/common/pseudonymization_salt.cc
|
|
|
|
index 28e003bef910abff022def659fe18d4cd0549f8a..530bcbdb5d350f6486dc1e8536f7b279be69e241 100644
|
|
|
|
--- a/content/common/pseudonymization_salt.cc
|
|
|
|
+++ b/content/common/pseudonymization_salt.cc
|
|
|
|
@@ -41,11 +41,13 @@ uint32_t GetPseudonymizationSalt() {
|
|
|
|
uint32_t salt = g_salt.load();
|
|
|
|
|
|
|
|
if (salt == 0) {
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
#if DCHECK_IS_ON()
|
|
|
|
// Only the Browser process needs to initialize the `salt` on demand.
|
|
|
|
// Other processes (identified via the IsProcessSandboxed heuristic) should
|
|
|
|
// receive the salt from their parent processes.
|
|
|
|
DCHECK(!sandbox::policy::Sandbox::IsProcessSandboxed());
|
|
|
|
+#endif
|
|
|
|
#endif
|
|
|
|
salt = InitializeSalt();
|
|
|
|
}
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm
|
2020-09-21 08:00:36 +00:00
|
|
|
index 894ac47e596c1c96a7e0659be80ed8a5629d0304..eca797a24df79b8502b9698e6ed8830ad1c5cb59 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/renderer/renderer_main_platform_delegate_mac.mm
|
|
|
|
+++ b/content/renderer/renderer_main_platform_delegate_mac.mm
|
2019-04-20 17:20:37 +00:00
|
|
|
@@ -10,9 +10,11 @@
|
|
|
|
#include "sandbox/mac/seatbelt.h"
|
2018-10-24 23:25:48 +00:00
|
|
|
#include "sandbox/mac/system_services.h"
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
extern "C" {
|
2019-01-12 01:00:43 +00:00
|
|
|
CGError CGSSetDenyWindowServerConnections(bool);
|
2019-02-26 21:31:29 +00:00
|
|
|
}
|
2018-09-14 05:02:16 +00:00
|
|
|
+#endif
|
|
|
|
|
|
|
|
namespace content {
|
|
|
|
|
2020-08-10 15:23:21 +00:00
|
|
|
@@ -22,6 +24,7 @@
|
2019-01-12 01:00:43 +00:00
|
|
|
// verifies there are no existing open connections), and then indicates that
|
|
|
|
// Chrome should continue execution without access to launchservicesd.
|
|
|
|
void DisableSystemServices() {
|
2018-09-14 05:02:16 +00:00
|
|
|
+#ifndef MAS_BUILD
|
2019-01-12 01:00:43 +00:00
|
|
|
// Tell the WindowServer that we don't want to make any future connections.
|
|
|
|
// This will return Success as long as there are no open connections, which
|
|
|
|
// is what we want.
|
2020-09-21 08:00:36 +00:00
|
|
|
@@ -30,6 +33,7 @@ void DisableSystemServices() {
|
2018-10-24 23:25:48 +00:00
|
|
|
|
|
|
|
sandbox::DisableLaunchServices();
|
2020-09-21 08:00:36 +00:00
|
|
|
sandbox::DisableCoreServicesCheckFix();
|
2018-09-14 05:02:16 +00:00
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
2019-04-20 17:20:37 +00:00
|
|
|
} // namespace
|
2020-08-26 04:13:42 +00:00
|
|
|
diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm
|
2020-12-14 18:57:36 +00:00
|
|
|
index c15f3a631292b538698625328fb429ee3c9964f5..37e038753ecf1b82ec92c06b2c0729b5328781c9 100644
|
2020-08-26 04:13:42 +00:00
|
|
|
--- a/content/renderer/theme_helper_mac.mm
|
|
|
|
+++ b/content/renderer/theme_helper_mac.mm
|
|
|
|
@@ -7,11 +7,11 @@
|
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
|
|
|
|
#include "base/strings/sys_string_conversions.h"
|
|
|
|
-
|
|
|
|
+#if !defined(MAS_BUILD)
|
|
|
|
extern "C" {
|
|
|
|
bool CGFontRenderingGetFontSmoothingDisabled(void) API_AVAILABLE(macos(10.14));
|
|
|
|
}
|
|
|
|
-
|
|
|
|
+#endif
|
|
|
|
namespace content {
|
|
|
|
|
|
|
|
void SystemColorsDidChange(int aqua_color_variant,
|
|
|
|
@@ -59,8 +59,19 @@ void SystemColorsDidChange(int aqua_color_variant,
|
|
|
|
bool IsSubpixelAntialiasingAvailable() {
|
|
|
|
if (__builtin_available(macOS 10.14, *)) {
|
|
|
|
// See https://trac.webkit.org/changeset/239306/webkit for more info.
|
|
|
|
+#if !defined(MAS_BUILD)
|
|
|
|
return !CGFontRenderingGetFontSmoothingDisabled();
|
|
|
|
+#else
|
|
|
|
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
|
|
|
+ NSString *default_key = @"CGFontRenderingGetFontSmoothingDisabled";
|
2020-10-20 01:40:58 +00:00
|
|
|
+ // Check that key exists since boolForKey defaults to NO when the
|
2020-08-26 04:13:42 +00:00
|
|
|
+ // key is missing and this key in fact defaults to YES;
|
|
|
|
+ if ([defaults objectForKey:default_key] == nil)
|
|
|
|
+ return false;
|
|
|
|
+ return ![defaults boolForKey:default_key];
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
+
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
|
2022-01-10 22:31:39 +00:00
|
|
|
index 3f7dce0281f7b5a540d7b9377ef14a8a6aa9a2fa..11d8419791f3e45d5242081422d452d4fc703833 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/device/bluetooth/bluetooth_adapter_mac.mm
|
|
|
|
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
|
2021-06-03 08:05:04 +00:00
|
|
|
@@ -42,6 +42,7 @@
|
2018-09-14 05:02:16 +00:00
|
|
|
#include "device/bluetooth/bluetooth_socket_mac.h"
|
2020-08-12 18:33:58 +00:00
|
|
|
#include "device/bluetooth/public/cpp/bluetooth_address.h"
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
extern "C" {
|
|
|
|
// Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and
|
|
|
|
// `Karabiner` [3] to programmatically control the Bluetooth state. Calling the
|
2021-06-03 08:05:04 +00:00
|
|
|
@@ -55,6 +56,7 @@
|
2018-09-14 05:02:16 +00:00
|
|
|
// [4] https://support.apple.com/kb/PH25091
|
|
|
|
void IOBluetoothPreferenceSetControllerPowerState(int state);
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2021-06-03 08:05:04 +00:00
|
|
|
@@ -123,8 +125,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
|
2018-09-14 05:02:16 +00:00
|
|
|
controller_state_function_(
|
|
|
|
base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState,
|
|
|
|
base::Unretained(this))),
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
power_state_function_(
|
|
|
|
base::BindRepeating(IOBluetoothPreferenceSetControllerPowerState)),
|
|
|
|
+#endif
|
|
|
|
classic_discovery_manager_(
|
|
|
|
BluetoothDiscoveryManagerMac::CreateClassic(this)),
|
2020-10-28 00:33:04 +00:00
|
|
|
low_energy_discovery_manager_(
|
2022-01-10 22:31:39 +00:00
|
|
|
@@ -365,8 +369,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool BluetoothAdapterMac::SetPoweredImpl(bool powered) {
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
power_state_function_.Run(base::strict_cast<int>(powered));
|
|
|
|
return true;
|
|
|
|
+#else
|
|
|
|
+ return false;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void BluetoothAdapterMac::RemovePairingDelegateInternal(
|
|
|
|
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
|
2021-11-24 08:45:59 +00:00
|
|
|
index 5e1b1f542e98f9257938f909a2d92e3117e298af..4b9825694c8b8d6bbe671ebeef8eb57baf8b05a1 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/media/audio/BUILD.gn
|
|
|
|
+++ b/media/audio/BUILD.gn
|
2021-11-24 08:45:59 +00:00
|
|
|
@@ -174,6 +174,12 @@ source_set("audio") {
|
2018-09-14 05:02:16 +00:00
|
|
|
"mac/scoped_audio_unit.cc",
|
|
|
|
"mac/scoped_audio_unit.h",
|
|
|
|
]
|
|
|
|
+ if (is_mas_build) {
|
|
|
|
+ sources -= [
|
|
|
|
+ "mac/coreaudio_dispatch_override.cc",
|
|
|
|
+ "mac/coreaudio_dispatch_override.h",
|
|
|
|
+ ]
|
|
|
|
+ }
|
2020-07-14 01:13:34 +00:00
|
|
|
frameworks = [
|
2018-09-14 05:02:16 +00:00
|
|
|
"AudioToolbox.framework",
|
|
|
|
"AudioUnit.framework",
|
|
|
|
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
|
2021-11-24 08:45:59 +00:00
|
|
|
index ebdc6364312ee710d416318836c03aeec9bfb65c..aa9b50de7efaf0e1b64effea93204984c91790b5 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/media/audio/mac/audio_manager_mac.cc
|
|
|
|
+++ b/media/audio/mac/audio_manager_mac.cc
|
2021-11-24 08:45:59 +00:00
|
|
|
@@ -886,7 +886,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
void AudioManagerMac::InitializeOnAudioThread() {
|
|
|
|
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
|
|
|
|
- InitializeCoreAudioDispatchOverride();
|
|
|
|
+ // InitializeCoreAudioDispatchOverride();
|
chore: bump chromium to 92.0.4475.0 (master) (#28462)
* chore: bump chromium in DEPS to 91.0.4464.0
* chore: rebuild chromium/dcheck.patch with import-patches -3
Mechanical only; no code changes
* chore: remove content_browser_main_loop.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
The function being patched (BrowserMainLoop::MainMessageLoopRun()) no
longer exists.
NB: if removing this introduces regressions the likely fix will be to
add a similar patch for ShellBrowserMainParts::WillRunMainMessageLoop()
which has similar code and was added at the same time this was removed.
* chore: rebuild chromium/put_back_deleted_colors_for_autofill.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/disable_color_correct_rendering.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/eat_allow_disabling_blink_scheduler_throttling_per_renderview.patch with patch
Mechanical only; no code changes
* chore: rebuild chromium/gpu_notify_when_dxdiag_request_fails.patch with import-patches -3
Mechanical only; no code changes
* chore: rebuild chromium/ui_gtk_public_header.patch manually
no code changes
* chore: rebuild chromium/web_contents.patch with import-patches -3
Mechanical only; no code changes
* chore: remove v8/skip_global_registration_of_shared_arraybuffer_backing_stores.patch
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2763874
This patch has been merged upstream
* chore: export patches
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785841
SkColorFromColorId() no longer takes theme, scheme args
* chore: sync chromium/put_back_deleted_colors_for_autofill.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2772143
Change new calls to GetDarkSchemeColor to fit our patched call signature
* chore: update add_trustedauthclient_to_urlloaderfactory.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2757969
Sync with removal of render_frame_id_ in our mojom
* chore: update chromium/frame_host_manager.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update chromium/revert_remove_contentrendererclient_shouldfork.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2755314
Upstream has removed `history_list_length_` which we were comparing to 0
to calculate our `is_initial_navigation` bool when calling ShouldFork().
ShouldFork() is ours and none of the code paths actually use that param,
so this commit removes it altogether.
* chore: update permissions_to_register
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2789074
Replace all uses of APIPermission::ID enum with Mojo type
* refactor: update return type of PreMainMessageLoopRun()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
Used to return void; now returns an int errorcode.
Note: 2725153 also has some nice doc updates about Browser's "stages"
* refactor: sync ElectronBrowserMainParts to MainParts changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
RunMainMessageLoopParts has been replaced with WillRunMainMessageLoop
so `BrowserMainLoop::result_code_` is no longer available to us for our
exit_code_ pointer.
This variable held a dual role: (1) of course, hold the exit code, but
also (2) was a nullptr before the message loop was ready, indicating to
anyone calling SetExitCode() that we were still in startup and could
just exit() without any extra steps. exit_code_ still fulfills these two
roles but is now a base::Optional.
* chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
BrowserMainParts::BrowsePreDefaultMainMesssageLoopRun() has been
removed; move that work to the new WillRunMainMessageLoop().
* refactor: stop using CallbackList; it has been removed.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2785973
* refactor: update use of threadpools.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2773408
The upstream code is still in flux (e.g. reverts and re-lands) but the
tl;dr for this commit is (1) include thread_pool.h if you're using it
and (2) don't instantiate pools directly.
* refactor: remove routing_id from CreateLoaderAndStart
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
NB: One logic branch in ProxyingURLLoaderFactory::CreateLoaderAndStart
calls std::make_unique<InProgressRequest>, which needs a routing_id.
This PR uses the member field `routing_id_` since there's no longer one
being passed into CreateLoaderAndStart.
* refactor: sync to upstream ParittionOptions churn
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
PartitionOptions' enums have changed.
* refactor: update Manifest::Location usage
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
tldr: s/Manifest::FOO/ManifestLocation::kFoo/
* chore: bump chromium in DEPS to 91.0.4465.0
* update patches
* refactor: update extensions::Manifest to upstream
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771320
- extensions::Manifest::COMPONENT
+ extensions::mojom::ManifestLocation::kExternalComponent
* refactor: sync with upstream UrlInfo ctor changes
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2740008
UrlInfo ctor now takes UrlInfo::OriginIsolationRequest instead of a bool
* chore: update invocation of convert_protocol_to_json.py
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2792623
python3 is being used in parts of the upstream build, but the copy of
convert_protocol_to_json.py invoked in v8/third_party/inspector_protocol
is not python3-friendly. Node has a py2+3-friendly version of it in its
tools directory, so call it instead.
* chore: use extensions::mojom::APIPermissionID
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791122
tldr:
- extensions::APIPermission::kFoo
+ extensions::mojom::APIPermissionID::kFoo
* chore: Remove support for TLS1.0/1.1 in SSLVersionMin policy
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2765737
Remove TLS v1.0 & 1.1 from our SSLProtocolVersionFromString() function.
This is the same change made upstream at
https://chromium-review.googlesource.com/c/chromium/src/+/2765737/8/chrome/browser/ssl/ssl_config_service_manager_pref.cc
* fixup! chore: update ElectronBrowserMainParts::PreDefaultMainMessageLoopRun
* chore: Use IDType for permission change subscriptions.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791431
tldr: {Subscribe,Unsubscribe}PermissionStatusChange's tag type used to
be an int; now it's the new SubscriptionId type (which is an IdType64).
* chore: sync PowerMonitor code to upstream refactor
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2752635
tldr: PowerMonitor has been split into PowerStateObserver,
PowerSuspendObserver, and PowerThermalObserver to reduce number of tasks
posted to consumers who only need notifications for one of those things
instead of all of them.
* chore: use PartitionOptions's new Cookies field
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2771318
* Revert "refactor: remove routing_id from CreateLoaderAndStart"
This reverts commit 8c9773b87a3c84f9073a47089eb2b6889d745245.
8c9773b was only a partial fix; reverting to start & try again.
* update patches
* chore: bump chromium in DEPS to 91.0.4466.0
* chore: update chromium/accelerator.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2795472
tldr: sync patch with upstream renamed variable & macro names.
* chore: update chromium/gtk_visibility.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796200
tldr: no code changes; just updating the diff to apply cleanly.
note: ooh upstream Wayland hacking!
* chore: update chromium/picture-in-picture.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710023
tldr: no code changes; just updating the diff to apply cleanly.
* chore: update chromium/worker_feat_add_hook_to_notify_script_ready.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2775573
tldr: no code changes; just updating the diff to apply cleanly.
* chore: export_all_patches
* chore: update chromium/feat_add_set_theme_source_to_allow_apps_to.patch
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2796511
tldr: NotifyObservers has been renamed to NotifyOnNativeThemeUpdated,
so update the invocation in our patch.
* chore: update ElectronBrowserClient w/upstream API
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797454
tldr: GetDevToolsManagerDelegate() was returning an owned raw pointer.
Replaced it with CreateDevToolsManagerDelegate() which uses unique_ptr<>.
* chore: handle new content::PermissionType::FILE_HANDLING in toV8()
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762201
`file-handling` string confirmed in https://chromium-review.googlesource.com/c/chromium/src/+/2762201/18/chrome/browser/ui/webui/settings/site_settings_helper.cc
* refactor: remove routing_id from CreateLoaderAndStart pt 1
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2762858
Part 1: the easiest ones
* 2796724: Support Python3
https://chromium-review.googlesource.com/c/infra/luci/python-adb/+/2796724
* chore: bump chromium in DEPS to 91.0.4468.0
* 2668974: WebShare: Implement SharingServicePicker
https://chromium-review.googlesource.com/c/chromium/src/+/2668974
* 2802766: Apply modernize-make-unique to media/
https://chromium-review.googlesource.com/c/chromium/src/+/2802766
* 2802823: Apply modernize-make-unique to gpu/
https://chromium-review.googlesource.com/c/chromium/src/+/2802823
* 2803041: Apply modernize-make-unique to remaining files
https://chromium-review.googlesource.com/c/chromium/src/+/2803041
* 2798873: Convert GtkKeyBindingsHandler build checks to runtime checks
https://chromium-review.googlesource.com/c/chromium/src/+/2798873
* 2733595: [ch-r] Parse ACCEPT_CH H2/3 frame and restart with new headers if needed
https://chromium-review.googlesource.com/c/chromium/src/+/2733595
* chore: update patch indices
* 2795107: Remove unused PermissionRequest IDs.
https://chromium-review.googlesource.com/c/chromium/src/+/2795107
* chore: bump chromium in DEPS to 91.0.4469.0
* chore: fixup patch indices
* chore: bump chromium in DEPS to 91.0.4469.5
* PiP 1.5: Add microphone, camera, and hang up buttons to the PiP window
https://chromium-review.googlesource.com/c/chromium/src/+/2710023
* fixup! refactor: remove routing_id from CreateLoaderAndStart
* refactor: use URLLoaderNetworkServiceObserver for auth requests from SimpleURLLoader
* fixup! chore: fixup patch indices
* 2724817: Expand scope of wasm-eval to all URLs
https://chromium-review.googlesource.com/c/chromium/src/+/2724817
* Fixup patch after rebase
* chore: bump chromium in DEPS to 91.0.4472.0
* 2797341: [ozone/x11] Enabled the global shortcut listener.
https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* 2805553: Reland Add GTK ColorMixers to ColorPipeline P1
https://chromium-review.googlesource.com/c/chromium/src/+/2805553
* 2804366: PiP 1.5: Label back to tab button with origin and center it
https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* 2784730: Fix crash on AX mode change in NativeViewHost without a Widget
https://chromium-review.googlesource.com/c/chromium/src/+/2784730
* chore: update patch indices
* 2810174: Add PdfAnnotationsEnabled policy.
https://chromium-review.googlesource.com/c/chromium/src/+/2810174
* 2807829: Allow capturers to indicate if they want a WakeLock or not.
https://chromium-review.googlesource.com/c/chromium/src/+/2807829
* chore: bump chromium in DEPS to 92.0.4473.0
* chore: bump chromium in DEPS to 92.0.4474.0
* chore: bump chromium in DEPS to 92.0.4475.0
* chore: update patches
* chore: updates patches
* chore: update is_media_key patch to handle new ozone impl
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
* fix: ExecuteJavascript requests now need to be flagged as non-bf-aware
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2787195
* chore: icon_util_x11 is now icon_util_linux
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2791362
* build: update sysroots
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2628496
* build: fix missing symbols on linux build
* use_ozone and use_x11 are not exclusive
* new button view to build for pip
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2797341
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2804366
* chore: fix broken gtk_util color patch
* chore: remove patch conflict
* build: update linux manifests
* chore: build bttlb on all platforms for pip
* chore: add thread_pool include for views delegate win
* chore: fix lint
* chore: add node patches for V8 changes
* build: add missing base include on windows
* fix: update frame host manager patch for new state transitions
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2714464
* chore: update windows zip manifests
* chore: update mac zip manifests
* chore: fix patch linting
* refactor: implement missing URLLoaderNetworkServiceObserver methods
It is against The Mojo Rules to leave hanging callbacks. These always
have to be called.
Refs: https://github.com/electron/electron/commit/186528aab9f8e29d658f07d220bb7f627980edda
* spec: fix locale test on local linux
* fix: pass the exit code correctly in new PreMainMessageLoopRun
Refs: https://github.com/electron/electron/commit/2622e91c4493ceb032e2f80cb484885bb8f97475
* fix: ensure we early-exit when request_handler_ is not provided
Refs: https://github.com/electron/electron/commit/93077afbfb6db248a0c0cc447d7ad2c9ccfda1d5
* fix: strongly set result_code in the BrowserMainLoop
* fix: invalid usage of non-targetted PostTask
You must always either use a host threadpool or specify a target
thread. In this case we did neither after this refactor.
Refs: https://github.com/electron/electron/pull/28462/commits/4e33ee0ad35a710bd34641cb0376bdee6aea2d1f
* chore: fix gn check
* chore: remove stray .rej files in patch
* chore: add mojo error code to url loader failure
* build: ensure CI is truthy in arm test env
* fix: handle windowCaptureMacV2 being enabled when fetching media source id
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2709931
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-15 17:44:35 +00:00
|
|
|
power_observer_ = std::make_unique<AudioPowerObserver>();
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
|
2021-11-24 08:45:59 +00:00
|
|
|
index 3a541ac224c53b2809e8634286dac91873d46b72..89c9b095a2a96b9cae5e8d4bba85847f9585f985 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/net/dns/dns_config_service_posix.cc
|
|
|
|
+++ b/net/dns/dns_config_service_posix.cc
|
2021-10-21 18:51:36 +00:00
|
|
|
@@ -140,8 +140,8 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
2018-09-14 05:02:16 +00:00
|
|
|
|
2021-01-25 16:46:00 +00:00
|
|
|
bool Watch() override {
|
|
|
|
CheckOnCorrectSequence();
|
|
|
|
-
|
2018-09-14 05:02:16 +00:00
|
|
|
bool success = true;
|
|
|
|
+#ifndef MAS_BUILD
|
2020-03-11 11:15:07 +00:00
|
|
|
if (!config_watcher_.Watch(base::BindRepeating(&Watcher::OnConfigChanged,
|
|
|
|
base::Unretained(this)))) {
|
2018-09-14 05:02:16 +00:00
|
|
|
LOG(ERROR) << "DNS config watch failed to start.";
|
2021-10-21 18:51:36 +00:00
|
|
|
@@ -158,6 +158,7 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
2021-01-12 23:31:23 +00:00
|
|
|
success = false;
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
2021-03-04 17:27:05 +00:00
|
|
|
#endif // !defined(OS_IOS)
|
2018-09-14 05:02:16 +00:00
|
|
|
+#endif
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/sandbox/mac/sandbox_compiler.cc b/sandbox/mac/sandbox_compiler.cc
|
2018-10-24 18:24:11 +00:00
|
|
|
index e524aa7b851022abed1edac39e18d8d92e5349b4..718d3f963da5c1a15a1bdb0e6043f89bc0f940f8 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/sandbox/mac/sandbox_compiler.cc
|
|
|
|
+++ b/sandbox/mac/sandbox_compiler.cc
|
|
|
|
@@ -28,6 +28,7 @@ bool SandboxCompiler::InsertStringParam(const std::string& key,
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SandboxCompiler::CompileAndApplyProfile(std::string* error) {
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
char* error_internal = nullptr;
|
|
|
|
std::vector<const char*> params;
|
|
|
|
|
|
|
|
@@ -44,6 +45,7 @@ bool SandboxCompiler::CompileAndApplyProfile(std::string* error) {
|
|
|
|
sandbox::Seatbelt::FreeError(error_internal);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/sandbox/mac/seatbelt.cc b/sandbox/mac/seatbelt.cc
|
2019-02-26 21:31:29 +00:00
|
|
|
index e0c31170acd13c9997c6b1d04c6de1420feaf422..0e561f97b33380bfbe52e64c2c4a6988095e8074 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/sandbox/mac/seatbelt.cc
|
|
|
|
+++ b/sandbox/mac/seatbelt.cc
|
|
|
|
@@ -64,7 +64,11 @@ void Seatbelt::FreeError(char* errorbuf) {
|
|
|
|
|
|
|
|
// static
|
|
|
|
bool Seatbelt::IsSandboxed() {
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
return ::sandbox_check(getpid(), NULL, 0);
|
|
|
|
+#else
|
|
|
|
+ return true;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace sandbox
|
|
|
|
diff --git a/sandbox/mac/seatbelt_extension.cc b/sandbox/mac/seatbelt_extension.cc
|
2021-10-06 02:21:00 +00:00
|
|
|
index d59a16112d27e2696437163483c44eca414c225c..1ccd20fe7efa3cbae48f99d0660b025283dd370e 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/sandbox/mac/seatbelt_extension.cc
|
|
|
|
+++ b/sandbox/mac/seatbelt_extension.cc
|
2020-05-26 20:06:26 +00:00
|
|
|
@@ -11,6 +11,7 @@
|
|
|
|
#include "base/notreached.h"
|
2018-09-14 05:02:16 +00:00
|
|
|
#include "sandbox/mac/seatbelt_extension_token.h"
|
|
|
|
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
// libsandbox private API.
|
|
|
|
extern "C" {
|
|
|
|
extern const char* APP_SANDBOX_READ;
|
2021-10-06 02:21:00 +00:00
|
|
|
@@ -22,6 +23,7 @@ char* sandbox_extension_issue_file(const char* type,
|
2018-09-14 05:02:16 +00:00
|
|
|
const char* path,
|
|
|
|
uint32_t flags);
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
namespace sandbox {
|
|
|
|
|
2021-10-06 02:21:00 +00:00
|
|
|
@@ -50,7 +52,11 @@ std::unique_ptr<SeatbeltExtension> SeatbeltExtension::FromToken(
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
bool SeatbeltExtension::Consume() {
|
|
|
|
DCHECK(!token_.empty());
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
handle_ = sandbox_extension_consume(token_.c_str());
|
|
|
|
+#else
|
|
|
|
+ handle_ = -1;
|
|
|
|
+#endif
|
|
|
|
return handle_ > 0;
|
|
|
|
}
|
|
|
|
|
2021-10-06 02:21:00 +00:00
|
|
|
@@ -62,7 +68,11 @@ bool SeatbeltExtension::ConsumePermanently() {
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool SeatbeltExtension::Revoke() {
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
int rv = sandbox_extension_release(handle_);
|
|
|
|
+#else
|
|
|
|
+ int rv = -1;
|
|
|
|
+#endif
|
|
|
|
handle_ = 0;
|
|
|
|
token_.clear();
|
|
|
|
return rv == 0;
|
2021-10-06 02:21:00 +00:00
|
|
|
@@ -80,12 +90,14 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token)
|
2018-09-14 05:02:16 +00:00
|
|
|
char* SeatbeltExtension::IssueToken(SeatbeltExtension::Type type,
|
|
|
|
const std::string& resource) {
|
|
|
|
switch (type) {
|
|
|
|
+#ifndef MAS_BUILD
|
|
|
|
case FILE_READ:
|
|
|
|
return sandbox_extension_issue_file(APP_SANDBOX_READ, resource.c_str(),
|
|
|
|
0);
|
2021-10-06 02:21:00 +00:00
|
|
|
case FILE_READ_WRITE:
|
|
|
|
return sandbox_extension_issue_file(APP_SANDBOX_READ_WRITE,
|
|
|
|
resource.c_str(), 0);
|
2018-09-14 05:02:16 +00:00
|
|
|
+#endif
|
|
|
|
default:
|
|
|
|
NOTREACHED();
|
|
|
|
return nullptr;
|