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