OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/native_widget_mac.h" | 5 #include "ui/views/widget/native_widget_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 DCHECK(GetWidget()->GetRootView()); | 133 DCHECK(GetWidget()->GetRootView()); |
134 bridge_->SetRootView(GetWidget()->GetRootView()); | 134 bridge_->SetRootView(GetWidget()->GetRootView()); |
135 | 135 |
136 // "Infer" must be handled by ViewsDelegate::OnBeforeWidgetInit(). | 136 // "Infer" must be handled by ViewsDelegate::OnBeforeWidgetInit(). |
137 DCHECK_NE(Widget::InitParams::INFER_OPACITY, params.opacity); | 137 DCHECK_NE(Widget::InitParams::INFER_OPACITY, params.opacity); |
138 bool translucent = params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW; | 138 bool translucent = params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW; |
139 bridge_->CreateLayer(params.layer_type, translucent); | 139 bridge_->CreateLayer(params.layer_type, translucent); |
140 } | 140 } |
141 | 141 |
| 142 void NativeWidgetMac::OnWidgetInitDone() {} |
| 143 |
142 NonClientFrameView* NativeWidgetMac::CreateNonClientFrameView() { | 144 NonClientFrameView* NativeWidgetMac::CreateNonClientFrameView() { |
143 return new NativeFrameView(GetWidget()); | 145 return new NativeFrameView(GetWidget()); |
144 } | 146 } |
145 | 147 |
146 bool NativeWidgetMac::ShouldUseNativeFrame() const { | 148 bool NativeWidgetMac::ShouldUseNativeFrame() const { |
147 return true; | 149 return true; |
148 } | 150 } |
149 | 151 |
150 bool NativeWidgetMac::ShouldWindowContentsBeTransparent() const { | 152 bool NativeWidgetMac::ShouldWindowContentsBeTransparent() const { |
151 // On Windows, this returns true when Aero is enabled which draws the titlebar | 153 // On Windows, this returns true when Aero is enabled which draws the titlebar |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; | 721 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; |
720 } | 722 } |
721 | 723 |
722 - (void)animationDidEnd:(NSAnimation*)animation { | 724 - (void)animationDidEnd:(NSAnimation*)animation { |
723 [window_ close]; | 725 [window_ close]; |
724 [animation_ setDelegate:nil]; | 726 [animation_ setDelegate:nil]; |
725 [self release]; | 727 [self release]; |
726 } | 728 } |
727 | 729 |
728 @end | 730 @end |
OLD | NEW |