From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 20 Sep 2018 17:48:49 -0700 Subject: mas: avoid private APIs in blink Guard usages in chromium code 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/third_party/blink/renderer/core/editing/kill_ring_mac.mm b/third_party/blink/renderer/core/editing/kill_ring_mac.mm index 700a4b58ea17597b41dddb8c552e2f2cfc9aa393..8e79ef2ae958dfbaf9cf928d4e3c76dd4d3ab99b 100644 --- a/third_party/blink/renderer/core/editing/kill_ring_mac.mm +++ b/third_party/blink/renderer/core/editing/kill_ring_mac.mm @@ -31,6 +31,7 @@ namespace blink { +#if !IS_MAS_BUILD() extern "C" { // Kill ring calls. Would be better to use NSKillRing.h, but that's not @@ -43,38 +44,53 @@ void _NSNewKillRingSequence(); void _NSSetKillRingToYankedState(); } +#endif static void InitializeKillRingIfNeeded() { static bool initialized_kill_ring = false; if (!initialized_kill_ring) { initialized_kill_ring = true; +#if !IS_MAS_BUILD() _NSInitializeKillRing(); +#endif } } void KillRing::Append(const String& string) { InitializeKillRingIfNeeded(); +#if !IS_MAS_BUILD() _NSAppendToKillRing(string); +#endif } void KillRing::Prepend(const String& string) { InitializeKillRingIfNeeded(); +#if !IS_MAS_BUILD() _NSPrependToKillRing(string); +#endif } String KillRing::Yank() { InitializeKillRingIfNeeded(); +#if !IS_MAS_BUILD() return _NSYankFromKillRing(); +#else + return ""; +#endif } void KillRing::StartNewSequence() { InitializeKillRingIfNeeded(); +#if !IS_MAS_BUILD() _NSNewKillRingSequence(); +#endif } void KillRing::SetToYankedState() { InitializeKillRingIfNeeded(); +#if !IS_MAS_BUILD() _NSSetKillRingToYankedState(); +#endif } } // namespace blink