| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 const ui::Compositor* NativeWidgetMac::GetCompositor() const { | 186 const ui::Compositor* NativeWidgetMac::GetCompositor() const { |
| 187 return bridge_ && bridge_->layer() ? bridge_->layer()->GetCompositor() | 187 return bridge_ && bridge_->layer() ? bridge_->layer()->GetCompositor() |
| 188 : nullptr; | 188 : nullptr; |
| 189 } | 189 } |
| 190 | 190 |
| 191 const ui::Layer* NativeWidgetMac::GetLayer() const { | 191 const ui::Layer* NativeWidgetMac::GetLayer() const { |
| 192 return bridge_ ? bridge_->layer() : nullptr; | 192 return bridge_ ? bridge_->layer() : nullptr; |
| 193 } | 193 } |
| 194 | 194 |
| 195 void NativeWidgetMac::ReorderNativeViews() { | 195 void NativeWidgetMac::ReorderNativeViews() { |
| 196 if (bridge_) | 196 if (bridge_) { |
| 197 bridge_->SetRootView(GetWidget()->GetRootView()); | 197 bridge_->SetRootView(GetWidget()->GetRootView()); |
| 198 bridge_->ReorderChildViews(); |
| 199 } |
| 198 } | 200 } |
| 199 | 201 |
| 200 void NativeWidgetMac::ViewRemoved(View* view) { | 202 void NativeWidgetMac::ViewRemoved(View* view) { |
| 201 // TODO(tapted): Something for drag and drop might be needed here in future. | 203 // TODO(tapted): Something for drag and drop might be needed here in future. |
| 202 // See http://crbug.com/464581. A NOTIMPLEMENTED() here makes a lot of spam, | 204 // See http://crbug.com/464581. A NOTIMPLEMENTED() here makes a lot of spam, |
| 203 // so only emit it when a drag and drop could be likely. | 205 // so only emit it when a drag and drop could be likely. |
| 204 if (IsMouseButtonDown()) | 206 if (IsMouseButtonDown()) |
| 205 NOTIMPLEMENTED(); | 207 NOTIMPLEMENTED(); |
| 206 } | 208 } |
| 207 | 209 |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; | 735 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; |
| 734 } | 736 } |
| 735 | 737 |
| 736 - (void)animationDidEnd:(NSAnimation*)animation { | 738 - (void)animationDidEnd:(NSAnimation*)animation { |
| 737 [window_ close]; | 739 [window_ close]; |
| 738 [animation_ setDelegate:nil]; | 740 [animation_ setDelegate:nil]; |
| 739 [self release]; | 741 [self release]; |
| 740 } | 742 } |
| 741 | 743 |
| 742 @end | 744 @end |
| OLD | NEW |