mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: bump chromium in DEPS to 90.0.4430.19 * build: add 'use_rts' definition Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2694187 (cherry picked from commitb820b4078d) * chore: bump chromium in DEPS to 91.0.4441.0 * chore: update patches (cherry picked from commit55e50a0879) * chore: media_internal_resources becomes resources Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2699022 (cherry picked from commite715b9c921) * chore: update patches (cherry picked from commitc8148febfa) * refactor: extensions::ViewType moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 (cherry picked from commit87df2766ba) * chore: might_have_observers has been removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2667839 (cherry picked from commite900271bea) * refactor: CertVerifier is not in the network namespace anymore Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2689805 (cherry picked from commiteccfa516c5) * refactor: ExtensionUserScriptManager is now UserScriptManager Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2657617 (cherry picked from commit2fed02556d) * refactor: content::SiteInstance::GetSiteForURL was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2680274 (cherry picked from commit0d94e0d1d9) * refactor: MenuItemType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 (cherry picked from commit1a296e59c2) * refactor: extensions::ViewType was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351 (cherry picked from commitdc36e8e6fc) * refacotr: grit::ResourceMap replaced with webui::ResourcePath Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2685601 (cherry picked from commit59669e99cb) * refactor: blink::MenuItem::Type was moved to mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443 (cherry picked from commitbe627568b2) * refactor: CreateDataPipe deprecated form was removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2698090 (cherry picked from commit77ad17b383) * refactor: DesktopMediaList::Type replaces content::DesktopMediaType_* Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2700637 (cherry picked from commit4e02d9407a) * chore: wire up activation_time in OSR Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2638372 (cherry picked from commitf51f427646) * chore: remove deleted file from chromium_src list (cherry picked from commit59432fe30a) * chore: fix lint (cherry picked from commit54cc68dd7a) * update patches (cherry picked from commite99e6a5a8a) * chore: update patches (cherry picked from commit1e16606524) * fixup gn check (cherry picked from commit8f4e362d8f) * update to xcode 12.4.0 Needed because of8008deb41c(cherry picked from commitfae4d87a5a) * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 (cherry picked from commitd4bec23bde) * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 (cherry picked from commit9e336f5d0c) * 2752932: Associate each AwProxyingURLLoaderFactory with a frame tree node id. https://chromium-review.googlesource.com/c/chromium/src/+/2752932 (cherry picked from commit08036802cb) * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 (cherry picked from commit676f74f3dc) * 2734095: Introduce StoragePartitionId type to wrap current string representation. https://chromium-review.googlesource.com/c/chromium/src/+/2734095 (cherry picked from commit76538d2d38) * chore: bump chromium in DEPS to 90.0.4430.19 * chore: bump chromium in DEPS to 90.0.4430.30 * chore: bump chromium in DEPS to 90.0.4430.40 * chore: bump chromium in DEPS to 90.0.4430.51 * chore: bump chromium in DEPS to 91.0.4446.0 * chore: bump chromium in DEPS to 91.0.4448.0 (cherry picked from commit003dd6c16c) * Update patches (cherry picked from commit9f5e3f6685) * 2743594: Remove WebSize from blink. https://chromium-review.googlesource.com/c/chromium/src/+/2743594 (cherry picked from commitb15b820bca) * 2725403: Add URLLoaderClient::OnReceiveEarlyHints() https://chromium-review.googlesource.com/c/chromium/src/+/2725403 (cherry picked from commit185c343b22) * 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer. https://chromium-review.googlesource.com/c/chromium/src/+/2651385 (cherry picked from commit88bbe2a352) * 2721718: Move HostID to extensions::mojom::HostID https://chromium-review.googlesource.com/c/chromium/src/+/2721718 (cherry picked from commit3010dd93e3) * 2733070: Rename observer to URLLoaderNetworkServiceObserver https://chromium-review.googlesource.com/c/chromium/src/+/2733070 (cherry picked from commitd54bee03d0) * Use nogncheck for content/browser/site_instance_impl.h This is needed because //content/browser:browser is not a visible target (cherry picked from commit5fc298ee5f) * 2648046: Introduce alert notification helper .app https://chromium-review.googlesource.com/c/chromium/src/+/2648046 (cherry picked from commit2cd53eb46a) * 2752406: [LSC] Replace base::string16 with std::u16string in //ui https://chromium-review.googlesource.com/c/chromium/src/+/2752406 (cherry picked from commitf1bb6be4b9) * only include mac notifications on mac (cherry picked from commit3160e608e2) * add additional skipping of atk toolchain check (cherry picked from commit86d23cee40) * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 (cherry picked from commit22d8f22cfb) * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 (cherry picked from commitec893f8322) * 2720306: [api] Remove deprecated [Shared]ArrayBuffer API https://chromium-review.googlesource.com/c/v8/v8/+/2720306 (cherry picked from commitd0989802bd) * Fixup 2721718: Move HostID to extensions::mojom::HostID (cherry picked from commit29dfabadfd) * fixup 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer (cherry picked from commit97b6868e9c) * Fixup 2752406: [LSC] Replace base::string16 with std::u16string in //ui (cherry picked from commitb6d2ae0455) * Fixup 2725403: Add URLLoaderClient::OnReceiveEarlyHints() (cherry picked from commit7e961d8a37) * update node headers (cherry picked from commitc49bc282d5) * 2693008: Fix loading non-system cursors on Windows on browser_tests https://chromium-review.googlesource.com/c/chromium/src/+/2693008 (cherry picked from commit3b183854ff) * 2757472: Reland "Reland "[LSC] Remove base::string16 alias"" https://chromium-review.googlesource.com/c/chromium/src/+/2757472 (cherry picked from commit2d3c65beca) * undo changes to WebContentsPreferences::GetPreloadPath to fix mac build (cherry picked from commitdeeb2de14b) * fix StrCat issue (cherry picked from commit451e0931bf) * incantations for WebContentsPreferences::GetPreloadPath wide strings (cherry picked from commit205f572181) * bump nan (cherry picked from commit74318705c2) * fix GetAsString maybe? (cherry picked from commitea62ecd188) * windows build fixes (cherry picked from commit5b598037bb) * more windows build fix (cherry picked from commit61cf1abd4d) * SetAppUserModelID -> wstring (cherry picked from commit83d93bcbdc) * upgrade nan dep in tests (cherry picked from commit4f97b9303c) * update patch * wstrings are cross-platform (cherry picked from commit7f7b1f6c8a) * linter (cherry picked from commitaaf03765ed) * only bind setAppUserModelId on windows (cherry picked from commit640a145112) * well that was an odyssey (cherry picked from commitdd975328a0) * backport fcdf35e from v8 to fix nan crash (cherry picked from commit606fd87d1e) * disable typedarrays-test.js (cherry picked from commit01ca00ec82) * don't defer in NSWindow creation https://chromium-review.googlesource.com/c/chromium/src/+/2707696 (cherry picked from commit3122820e58) * use PartitionAllocator for ArrayBuffers in the main process (cherry picked from commit1f575ca3af) * fix patches (cherry picked from commit54e72fa8e3) * chore: omit some unnecessary conversions (cherry picked from commit0f3620099a) * refactor: make LoginItemSettings::path a wstring (cherry picked from commit9127cff58b) * refactor: make ShowTaskDialog take a wstr (cherry picked from commit1594c54933) * Revert "refactor: make LoginItemSettings::path a wstring" This reverts commit9127cff58b. (cherry picked from commit9684d85101) * fixup patches This reverts commit0cc08813a6. * update patches after merge Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Jeremy Rose <nornagon@nornagon.net> Co-authored-by: Charles Kerr <charles@charleskerr.com>
661 lines
24 KiB
Diff
661 lines
24 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Tue, 9 Oct 2018 10:36:20 -0700
|
|
Subject: mas_no_private_api.patch
|
|
|
|
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.
|
|
|
|
diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
|
|
index 1659e070cae733cf2213d752fcc262fb2bce2b54..57a3a34365f723b6e75a5f90d50533a45773e395 100644
|
|
--- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm
|
|
+++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
|
|
@@ -261,7 +261,7 @@
|
|
return PopulateSize([value sizeValue]);
|
|
}
|
|
}
|
|
-
|
|
+#ifndef MAS_BUILD
|
|
// AXTextMarker
|
|
if (content::IsAXTextMarker(value)) {
|
|
return PopulateTextPosition(content::AXTextMarkerToAXPosition(value),
|
|
@@ -272,6 +272,7 @@
|
|
if (content::IsAXTextMarkerRange(value)) {
|
|
return PopulateTextMarkerRange(value, line_indexer);
|
|
}
|
|
+#endif
|
|
|
|
// AXValue
|
|
if (CFGetTypeID(value) == AXValueGetTypeID()) {
|
|
@@ -384,7 +385,7 @@
|
|
kConstValuePrefix + affinity);
|
|
return set;
|
|
}
|
|
-
|
|
+#ifndef MAS_BUILD
|
|
base::Value AccessibilityTreeFormatterMac::PopulateTextMarkerRange(
|
|
id marker_range,
|
|
const LineIndexer* line_indexer) const {
|
|
@@ -400,7 +401,7 @@
|
|
PopulateTextPosition(ax_range.focus()->Clone(), line_indexer));
|
|
return dict;
|
|
}
|
|
-
|
|
+#endif
|
|
base::Value AccessibilityTreeFormatterMac::PopulateArray(
|
|
NSArray* node_array,
|
|
const LineIndexer* line_indexer) const {
|
|
diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm
|
|
index 88f339d1669436db9c1e4d048a46fc28038c83fe..2e194c5174c24552eb684faa339ad92b640d9dd7 100644
|
|
--- a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm
|
|
+++ b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm
|
|
@@ -234,6 +234,7 @@
|
|
if (property_name == "AXIndexForChildUIElement") { // UIElement
|
|
return OptionalNSObject::NotNilOrError(PropertyNodeToUIElement(arg_node));
|
|
}
|
|
+#ifndef MAS_BUILD
|
|
if (property_name == "AXIndexForTextMarker") { // TextMarker
|
|
return OptionalNSObject::NotNilOrError(PropertyNodeToTextMarker(arg_node));
|
|
}
|
|
@@ -241,6 +242,7 @@
|
|
return OptionalNSObject::NotNilOrError(
|
|
PropertyNodeToTextMarkerRange(arg_node));
|
|
}
|
|
+#endif
|
|
|
|
return OptionalNSObject::NotApplicable();
|
|
}
|
|
@@ -306,6 +308,7 @@
|
|
return uielement;
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
id AttributeInvoker::DictNodeToTextMarker(
|
|
const AXPropertyNode& dictnode) const {
|
|
if (!dictnode.IsDict()) {
|
|
@@ -413,6 +416,7 @@ OptionalNSObject TextMarkerRangeGetEndMarker(const OptionalNSObject& obj) {
|
|
return OptionalNSObject::NotNilOrError(content::AXTextMarkerFrom(
|
|
cocoa_node, range.focus()->text_offset(), range.focus()->affinity()));
|
|
}
|
|
+#endif
|
|
|
|
OptionalNSObject MakePairArray(const OptionalNSObject& obj1,
|
|
const OptionalNSObject& obj2) {
|
|
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
|
|
index a7d6351854d08926c4e9c43c95e9075bd4d4c728..9c89595cb6c37527b96b4afde387133349ec5999 100644
|
|
--- a/content/browser/accessibility/browser_accessibility_cocoa.h
|
|
+++ b/content/browser/accessibility/browser_accessibility_cocoa.h
|
|
@@ -156,7 +156,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
|
@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;
|
|
@@ -168,7 +170,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
|
// Index of a row, column, or tree item.
|
|
@property(nonatomic, readonly) NSNumber* index;
|
|
@property(nonatomic, readonly) NSNumber* treeItemRowIndex;
|
|
+#ifndef MAS_BUILD
|
|
@property(nonatomic, readonly) NSNumber* insertionPointLineNumber;
|
|
+#endif
|
|
@property(nonatomic, readonly) NSString* invalid;
|
|
@property(nonatomic, readonly) NSNumber* isMultiSelectable;
|
|
@property(nonatomic, readonly) NSString* placeholderValue;
|
|
@@ -191,14 +195,18 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
|
// The object is selected as a whole.
|
|
@property(nonatomic, readonly) NSNumber* selected;
|
|
@property(nonatomic, readonly) NSArray* selectedChildren;
|
|
+#ifndef MAS_BUILD
|
|
@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
|
|
index 86e56961584a26746cc254e8d0f53fe29f62fdb9..2d8265b3d41ce834d29f2764daf4be4aad15a1d1 100644
|
|
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
|
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
|
@@ -202,6 +202,7 @@
|
|
NSString* const NSAccessibilityLengthForTextMarkerRangeParameterizedAttribute =
|
|
@"AXLengthForTextMarkerRange";
|
|
|
|
+#ifndef MAS_BUILD
|
|
// Private attributes that can be used for testing text markers, e.g. in dump
|
|
// tree tests.
|
|
NSString* const
|
|
@@ -213,6 +214,7 @@
|
|
NSString* const
|
|
NSAccessibilityTextMarkerNodeDebugDescriptionParameterizedAttribute =
|
|
@"AXTextMarkerNodeDebugDescription";
|
|
+#endif
|
|
|
|
// Other private attributes.
|
|
NSString* const NSAccessibilityIdentifierChromeAttribute = @"ChromeAXNodeId";
|
|
@@ -237,6 +239,7 @@
|
|
// VoiceOver uses -1 to mean "no limit" for AXResultsLimit.
|
|
const int kAXResultsLimitNoLimit = -1;
|
|
|
|
+#ifndef MAS_BUILD
|
|
extern "C" {
|
|
|
|
// The following are private accessibility APIs required for cursor navigation
|
|
@@ -472,6 +475,7 @@ void AddMisspelledTextAttributes(const BrowserAccessibility::AXRange& ax_range,
|
|
AddMisspelledTextAttributes(ax_range, attributed_text);
|
|
return attributed_text;
|
|
}
|
|
+#endif
|
|
|
|
// Returns an autoreleased copy of the AXNodeData's attribute.
|
|
NSString* NSStringForStringAttribute(BrowserAccessibility* browserAccessibility,
|
|
@@ -743,6 +747,7 @@ bool IsSelectedStateRelevant(BrowserAccessibility* item) {
|
|
#define NSAccessibilityLanguageAttribute @"AXLanguage"
|
|
#endif
|
|
|
|
+#ifndef MAS_BUILD
|
|
bool content::IsAXTextMarker(id object) {
|
|
if (object == nil)
|
|
return false;
|
|
@@ -786,6 +791,7 @@ bool IsSelectedStateRelevant(BrowserAccessibility* item) {
|
|
kCFAllocatorDefault, anchor_textmarker, focus_textmarker);
|
|
return [static_cast<id>(cf_marker_range) autorelease];
|
|
}
|
|
+#endif
|
|
|
|
@implementation BrowserAccessibilityCocoa
|
|
|
|
@@ -825,7 +831,9 @@ + (void)initialize {
|
|
{NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
|
|
{NSAccessibilityElementBusyAttribute, @"elementBusy"},
|
|
{NSAccessibilityEnabledAttribute, @"enabled"},
|
|
+#ifndef MAS_BUILD
|
|
{NSAccessibilityEndTextMarkerAttribute, @"endTextMarker"},
|
|
+#endif
|
|
{NSAccessibilityExpandedAttribute, @"expanded"},
|
|
{NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
|
|
{NSAccessibilityFocusedAttribute, @"focused"},
|
|
@@ -837,8 +845,10 @@ + (void)initialize {
|
|
{NSAccessibilityHighestEditableAncestorAttribute,
|
|
@"highestEditableAncestor"},
|
|
{NSAccessibilityIndexAttribute, @"index"},
|
|
+#ifndef MAS_BUILD
|
|
{NSAccessibilityInsertionPointLineNumberAttribute,
|
|
@"insertionPointLineNumber"},
|
|
+#endif
|
|
{NSAccessibilityInvalidAttribute, @"invalid"},
|
|
{NSAccessibilityIsMultiSelectableAttribute, @"isMultiSelectable"},
|
|
{NSAccessibilityLanguageAttribute, @"language"},
|
|
@@ -860,13 +870,17 @@ + (void)initialize {
|
|
{NSAccessibilityRowsAttribute, @"rows"},
|
|
// TODO(aboxhall): expose
|
|
// NSAccessibilityServesAsTitleForUIElementsAttribute
|
|
+#ifndef MAS_BUILD
|
|
{NSAccessibilityStartTextMarkerAttribute, @"startTextMarker"},
|
|
+#endif
|
|
{NSAccessibilitySelectedAttribute, @"selected"},
|
|
{NSAccessibilitySelectedChildrenAttribute, @"selectedChildren"},
|
|
+#ifndef MAS_BUILD
|
|
{NSAccessibilitySelectedTextAttribute, @"selectedText"},
|
|
{NSAccessibilitySelectedTextRangeAttribute, @"selectedTextRange"},
|
|
{NSAccessibilitySelectedTextMarkerRangeAttribute,
|
|
@"selectedTextMarkerRange"},
|
|
+#endif
|
|
{NSAccessibilitySizeAttribute, @"size"},
|
|
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
|
|
{NSAccessibilitySubroleAttribute, @"subrole"},
|
|
@@ -1370,6 +1384,7 @@ - (NSNumber*)enabled {
|
|
ax::mojom::Restriction::kDisabled);
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
// Returns a text marker that points to the last character in the document that
|
|
// can be selected with VoiceOver.
|
|
- (id)endTextMarker {
|
|
@@ -1378,6 +1393,7 @@ - (id)endTextMarker {
|
|
BrowserAccessibility::AXPosition position = _owner->CreatePositionAt(0);
|
|
return CreateTextMarker(position->CreatePositionAtEndOfContent());
|
|
}
|
|
+#endif
|
|
|
|
- (NSNumber*)expanded {
|
|
if (![self instanceActive])
|
|
@@ -1578,6 +1594,7 @@ - (bool)findRowIndex:(BrowserAccessibilityCocoa*)toFind
|
|
return false;
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
- (NSNumber*)insertionPointLineNumber {
|
|
if (![self instanceActive])
|
|
return nil;
|
|
@@ -1603,6 +1620,7 @@ - (NSNumber*)insertionPointLineNumber {
|
|
caretPosition->AsTextPosition()->text_offset());
|
|
return @(std::distance(lineBreaks.begin(), iterator));
|
|
}
|
|
+#endif
|
|
|
|
// Returns whether or not this node should be ignored in the
|
|
// accessibility tree.
|
|
@@ -1954,8 +1972,12 @@ - (BOOL)shouldExposeTitleUIElement {
|
|
return content::AXTextEdit(newValue, std::u16string(), nil);
|
|
}
|
|
}
|
|
+#ifndef MAS_BUILD
|
|
return content::AXTextEdit(insertedText, deletedText,
|
|
CreateTextMarker(_owner->CreatePositionAt(i)));
|
|
+#else
|
|
+ return content::AXTextEdit(insertedText, deletedText, nil);
|
|
+#endif
|
|
}
|
|
|
|
- (BOOL)instanceActive {
|
|
@@ -2283,6 +2305,7 @@ - (NSArray*)selectedChildren {
|
|
return ret;
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
- (NSString*)selectedText {
|
|
if (![self instanceActive])
|
|
return nil;
|
|
@@ -2294,11 +2317,13 @@ - (NSString*)selectedText {
|
|
return nil;
|
|
return base::SysUTF16ToNSString(range.GetText());
|
|
}
|
|
+#endif
|
|
|
|
// Returns range of text under the current object that is selected.
|
|
//
|
|
// Example, caret at offset 5:
|
|
// NSRange: “pos=5 len=0”
|
|
+#ifndef MAS_BUILD
|
|
- (NSValue*)selectedTextRange {
|
|
if (![self instanceActive])
|
|
return nil;
|
|
@@ -2323,7 +2348,9 @@ - (NSValue*)selectedTextRange {
|
|
int selLength = range.GetText().length();
|
|
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
|
|
}
|
|
+#endif
|
|
|
|
+#ifndef MAS_BUILD
|
|
- (id)selectedTextMarkerRange {
|
|
if (![self instanceActive])
|
|
return nil;
|
|
@@ -2335,6 +2362,7 @@ - (id)selectedTextMarkerRange {
|
|
// words correctly.
|
|
return CreateTextMarkerRange(ax_range.AsBackwardRange());
|
|
}
|
|
+#endif
|
|
|
|
- (NSValue*)size {
|
|
if (![self instanceActive])
|
|
@@ -2367,6 +2395,7 @@ - (NSString*)sortDirection {
|
|
return nil;
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
// Returns a text marker that points to the first character in the document that
|
|
// can be selected with VoiceOver.
|
|
- (id)startTextMarker {
|
|
@@ -2375,6 +2404,7 @@ - (id)startTextMarker {
|
|
BrowserAccessibility::AXPosition position = _owner->CreatePositionAt(0);
|
|
return CreateTextMarker(position->CreatePositionAtStartOfContent());
|
|
}
|
|
+#endif
|
|
|
|
// Returns a subrole based upon the role.
|
|
- (NSString*)subrole {
|
|
@@ -2704,12 +2734,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
|
|
NSMutableAttributedString* attributedInnerText =
|
|
[[[NSMutableAttributedString alloc]
|
|
initWithString:base::SysUTF16ToNSString(innerText)] autorelease];
|
|
+#ifndef MAS_BUILD
|
|
if (!_owner->IsText()) {
|
|
BrowserAccessibility::AXRange ax_range(
|
|
_owner->CreatePositionAt(0),
|
|
_owner->CreatePositionAt(int{innerText.length()}));
|
|
AddMisspelledTextAttributes(ax_range, attributedInnerText);
|
|
}
|
|
+#endif
|
|
|
|
return [attributedInnerText attributedSubstringFromRange:range];
|
|
}
|
|
@@ -2822,6 +2854,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
|
return ToBrowserAccessibilityCocoa(cell);
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
if ([attribute
|
|
isEqualToString:
|
|
NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) {
|
|
@@ -3145,6 +3178,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
|
|
|
return CreateTextMarker(root->CreatePositionAt(index));
|
|
}
|
|
+#endif
|
|
|
|
if ([attribute isEqualToString:
|
|
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
|
|
@@ -3175,6 +3209,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
|
return nil;
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
if ([attribute
|
|
isEqualToString:
|
|
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
|
|
@@ -3292,6 +3327,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
|
|
|
return @(child->GetIndexInParent());
|
|
}
|
|
+#endif
|
|
|
|
return nil;
|
|
}
|
|
@@ -3821,6 +3857,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
|
_owner->CreatePositionAt(range.location),
|
|
_owner->CreatePositionAt(NSMaxRange(range))));
|
|
}
|
|
+#ifndef MAS_BUILD
|
|
if ([attribute
|
|
isEqualToString:NSAccessibilitySelectedTextMarkerRangeAttribute]) {
|
|
BrowserAccessibility::AXRange range = CreateRangeFromTextMarkerRange(value);
|
|
@@ -3831,6 +3868,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
|
BrowserAccessibility::AXRange(range.anchor()->AsLeafTextPosition(),
|
|
range.focus()->AsLeafTextPosition()));
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
- (id)accessibilityFocusedUIElement {
|
|
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
|
index 2a5163acf68b8a26b562dd0ab54e78fb408e89fe..98a5b1efc461d8f46becd78a4e19c410300e40e0 100644
|
|
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
|
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
|
@@ -482,7 +482,7 @@ void PostAnnouncementNotification(NSString* announcement) {
|
|
if (native_focus_object && [native_focus_object instanceActive]) {
|
|
[user_info setObject:native_focus_object
|
|
forKey:ui::NSAccessibilityTextChangeElement];
|
|
-
|
|
+#ifndef MAS_BUILD
|
|
id selected_text = [native_focus_object selectedTextMarkerRange];
|
|
if (selected_text) {
|
|
NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute =
|
|
@@ -490,6 +490,7 @@ void PostAnnouncementNotification(NSString* announcement) {
|
|
[user_info setObject:selected_text
|
|
forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
return user_info;
|
|
diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm
|
|
index 894ac47e596c1c96a7e0659be80ed8a5629d0304..eca797a24df79b8502b9698e6ed8830ad1c5cb59 100644
|
|
--- a/content/renderer/renderer_main_platform_delegate_mac.mm
|
|
+++ b/content/renderer/renderer_main_platform_delegate_mac.mm
|
|
@@ -10,9 +10,11 @@
|
|
#include "sandbox/mac/seatbelt.h"
|
|
#include "sandbox/mac/system_services.h"
|
|
|
|
+#ifndef MAS_BUILD
|
|
extern "C" {
|
|
CGError CGSSetDenyWindowServerConnections(bool);
|
|
}
|
|
+#endif
|
|
|
|
namespace content {
|
|
|
|
@@ -22,6 +24,7 @@
|
|
// verifies there are no existing open connections), and then indicates that
|
|
// Chrome should continue execution without access to launchservicesd.
|
|
void DisableSystemServices() {
|
|
+#ifndef MAS_BUILD
|
|
// 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.
|
|
@@ -30,6 +33,7 @@ void DisableSystemServices() {
|
|
|
|
sandbox::DisableLaunchServices();
|
|
sandbox::DisableCoreServicesCheckFix();
|
|
+#endif
|
|
}
|
|
|
|
} // namespace
|
|
diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm
|
|
index c15f3a631292b538698625328fb429ee3c9964f5..37e038753ecf1b82ec92c06b2c0729b5328781c9 100644
|
|
--- 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";
|
|
+ // Check that key exists since boolForKey defaults to NO when the
|
|
+ // 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;
|
|
}
|
|
|
|
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
|
|
index b56737af6f4da7cc01f78430c53dfa5afd1bc6df..60cdaa18e55acfd5817d2689bdb5a0ec8c1318d7 100644
|
|
--- a/device/bluetooth/bluetooth_adapter_mac.mm
|
|
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
|
|
@@ -43,6 +43,7 @@
|
|
#include "device/bluetooth/bluetooth_socket_mac.h"
|
|
#include "device/bluetooth/public/cpp/bluetooth_address.h"
|
|
|
|
+#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
|
|
@@ -56,6 +57,7 @@
|
|
// [4] https://support.apple.com/kb/PH25091
|
|
void IOBluetoothPreferenceSetControllerPowerState(int state);
|
|
}
|
|
+#endif
|
|
|
|
namespace {
|
|
|
|
@@ -124,8 +126,10 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
|
|
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)),
|
|
low_energy_discovery_manager_(
|
|
@@ -356,8 +360,12 @@ CBCentralManagerState GetCBManagerState(CBCentralManager* manager) {
|
|
}
|
|
|
|
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
|
|
index c68099d5baa0fec203313e8734d2d659578d687d..4a724e0f744722a4ba30ff6e22b56997364e4c49 100644
|
|
--- a/media/audio/BUILD.gn
|
|
+++ b/media/audio/BUILD.gn
|
|
@@ -175,6 +175,12 @@ source_set("audio") {
|
|
"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",
|
|
+ ]
|
|
+ }
|
|
frameworks = [
|
|
"AudioToolbox.framework",
|
|
"AudioUnit.framework",
|
|
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
|
|
index a994f74bb68d1e57ffa787e159f0a6c69e7b6953..1d84f84b59b2bae75c10c00da730022eca52d258 100644
|
|
--- a/media/audio/mac/audio_manager_mac.cc
|
|
+++ b/media/audio/mac/audio_manager_mac.cc
|
|
@@ -882,7 +882,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
|
|
|
|
void AudioManagerMac::InitializeOnAudioThread() {
|
|
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
|
|
- InitializeCoreAudioDispatchOverride();
|
|
+ // InitializeCoreAudioDispatchOverride();
|
|
power_observer_.reset(new AudioPowerObserver());
|
|
}
|
|
|
|
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
|
|
index dddd4a98a99fdea4c32d9c5b33a8fc661c75f590..a210069a9576d4aca436cdc8a2cd4322714aa24c 100644
|
|
--- a/net/dns/dns_config_service_posix.cc
|
|
+++ b/net/dns/dns_config_service_posix.cc
|
|
@@ -136,8 +136,8 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
|
|
|
bool Watch() override {
|
|
CheckOnCorrectSequence();
|
|
-
|
|
bool success = true;
|
|
+#ifndef MAS_BUILD
|
|
if (!config_watcher_.Watch(base::BindRepeating(&Watcher::OnConfigChanged,
|
|
base::Unretained(this)))) {
|
|
LOG(ERROR) << "DNS config watch failed to start.";
|
|
@@ -154,6 +154,7 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
|
success = false;
|
|
}
|
|
#endif // !defined(OS_IOS)
|
|
+#endif
|
|
return success;
|
|
}
|
|
|
|
diff --git a/sandbox/mac/sandbox_compiler.cc b/sandbox/mac/sandbox_compiler.cc
|
|
index e524aa7b851022abed1edac39e18d8d92e5349b4..718d3f963da5c1a15a1bdb0e6043f89bc0f940f8 100644
|
|
--- 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
|
|
index e0c31170acd13c9997c6b1d04c6de1420feaf422..0e561f97b33380bfbe52e64c2c4a6988095e8074 100644
|
|
--- 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
|
|
index 84c7370a3bb98aa29cdc04730a25148c3adc162a..5175c2c210e13e41224ae7268528c595c35cc4dc 100644
|
|
--- a/sandbox/mac/seatbelt_extension.cc
|
|
+++ b/sandbox/mac/seatbelt_extension.cc
|
|
@@ -11,6 +11,7 @@
|
|
#include "base/notreached.h"
|
|
#include "sandbox/mac/seatbelt_extension_token.h"
|
|
|
|
+#ifndef MAS_BUILD
|
|
// libsandbox private API.
|
|
extern "C" {
|
|
extern const char* APP_SANDBOX_READ;
|
|
@@ -21,6 +22,7 @@ char* sandbox_extension_issue_file(const char* type,
|
|
const char* path,
|
|
uint32_t flags);
|
|
}
|
|
+#endif
|
|
|
|
namespace sandbox {
|
|
|
|
@@ -49,7 +51,11 @@ std::unique_ptr<SeatbeltExtension> SeatbeltExtension::FromToken(
|
|
|
|
bool SeatbeltExtension::Consume() {
|
|
DCHECK(!token_.empty());
|
|
+#ifndef MAS_BUILD
|
|
handle_ = sandbox_extension_consume(token_.c_str());
|
|
+#else
|
|
+ handle_ = -1;
|
|
+#endif
|
|
return handle_ > 0;
|
|
}
|
|
|
|
@@ -61,7 +67,11 @@ bool SeatbeltExtension::ConsumePermanently() {
|
|
}
|
|
|
|
bool SeatbeltExtension::Revoke() {
|
|
+#ifndef MAS_BUILD
|
|
int rv = sandbox_extension_release(handle_);
|
|
+#else
|
|
+ int rv = -1;
|
|
+#endif
|
|
handle_ = 0;
|
|
token_.clear();
|
|
return rv == 0;
|
|
@@ -79,9 +89,11 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token)
|
|
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);
|
|
+#endif
|
|
default:
|
|
NOTREACHED();
|
|
return nullptr;
|