1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "ui/views/cocoa/views_nswindow_delegate.h"
7 #include "base/logging.h"
8 #import "ui/views/cocoa/bridged_native_widget.h"
10 @implementation ViewsNSWindowDelegate
12 - (id)initWithBridgedNativeWidget:(views::BridgedNativeWidget*)parent {
14 if ((self = [super init])) {
20 - (views::NativeWidgetMac*)nativeWidgetMac {
21 return parent_->native_widget_mac();
24 // NSWindowDelegate implementation.
26 - (void)windowWillClose:(NSNotification*)notification {
27 DCHECK([parent_->ns_window() isEqual:[notification object]]);
28 parent_->OnWindowWillClose();