Update availability annotations for macOS 10.12 SDK [part 2].

Due to a clang bug, adding the API_AVAILABLE annotation also changes the
visibility to be "default". This causes an unintentional leak of
global-visibility symbols. Explicitly re-specify "hidden" visibility to work
around this.

https://bugs.llvm.org/show_bug.cgi?id=33796

Bug: 669240
Change-Id: I1118de5ddb6035402f8b787cece33e0bb040ff15
TBR: [email protected]
Reviewed-on: https://chromium-review.googlesource.com/574683
Commit-Queue: Erik Chen <[email protected]>
Reviewed-by: Nico Weber <[email protected]>
Cr-Commit-Position: refs/heads/master@{#487309}
diff --git a/ui/base/cocoa/touch_bar_util.h b/ui/base/cocoa/touch_bar_util.h
index d35d50f..94e0852b 100644
--- a/ui/base/cocoa/touch_bar_util.h
+++ b/ui/base/cocoa/touch_bar_util.h
@@ -7,6 +7,7 @@
 
 #import <Cocoa/Cocoa.h>
 
+#include "base/mac/availability.h"
 #include "ui/base/ui_base_export.h"
 
 namespace ui {
@@ -19,6 +20,15 @@
 
 // Returns a stylized blue button for the touch bar. The button performs
 // |action| from the |target|.
+// The __attribute__ visibility annotation is necessary to work around a clang
+// bug: https://bugs.llvm.org/show_bug.cgi?id=33796.
+#if defined(UI_BASE_IMPLEMENTATION) && defined(COMPONENT_BUILD)
+// UI_BASE_EXPORT specifies "default" visibility.
+API_AVAILABLE(macosx(10.12.2))
+#else
+API_AVAILABLE(macosx(10.12.2))
+__attribute__((visibility("hidden")))
+#endif
 UI_BASE_EXPORT NSButton* GetBlueTouchBarButton(NSString* title,
                                                id target,
                                                SEL action);