Fix new clang warnings

This commit is contained in:
Cheng Zhao 2018-04-20 19:23:21 +09:00
parent c44279bb10
commit aa5c80f8a6

View file

@ -1224,26 +1224,29 @@ void NativeWindowMac::SetVibrancy(const std::string& type) {
void NativeWindowMac::SetTouchBar( void NativeWindowMac::SetTouchBar(
const std::vector<mate::PersistentDictionary>& items) { const std::vector<mate::PersistentDictionary>& items) {
if (![window_ respondsToSelector:@selector(touchBar)]) if (@available(macOS 10.12.2, *)) {
return;
touch_bar_.reset([[AtomTouchBar alloc] touch_bar_.reset([[AtomTouchBar alloc]
initWithDelegate:window_delegate_.get() initWithDelegate:window_delegate_.get()
window:this window:this
settings:items]); settings:items]);
[window_ setTouchBar:nil]; [window_ setTouchBar:nil];
} }
}
void NativeWindowMac::RefreshTouchBarItem(const std::string& item_id) { void NativeWindowMac::RefreshTouchBarItem(const std::string& item_id) {
if (@available(macOS 10.12.2, *)) {
if (touch_bar_ && [window_ touchBar]) if (touch_bar_ && [window_ touchBar])
[touch_bar_ refreshTouchBarItem:[window_ touchBar] id:item_id]; [touch_bar_ refreshTouchBarItem:[window_ touchBar] id:item_id];
} }
}
void NativeWindowMac::SetEscapeTouchBarItem( void NativeWindowMac::SetEscapeTouchBarItem(
const mate::PersistentDictionary& item) { const mate::PersistentDictionary& item) {
if (@available(macOS 10.12.2, *)) {
if (touch_bar_ && [window_ touchBar]) if (touch_bar_ && [window_ touchBar])
[touch_bar_ setEscapeTouchBarItem:item forTouchBar:[window_ touchBar]]; [touch_bar_ setEscapeTouchBarItem:item forTouchBar:[window_ touchBar]];
} }
}
gfx::Rect NativeWindowMac::ContentBoundsToWindowBounds( gfx::Rect NativeWindowMac::ContentBoundsToWindowBounds(
const gfx::Rect& bounds) const { const gfx::Rect& bounds) const {