| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 const ui::Compositor* NativeWidgetMac::GetCompositor() const { | 190 const ui::Compositor* NativeWidgetMac::GetCompositor() const { |
| 191 return bridge_ && bridge_->layer() ? bridge_->layer()->GetCompositor() | 191 return bridge_ && bridge_->layer() ? bridge_->layer()->GetCompositor() |
| 192 : nullptr; | 192 : nullptr; |
| 193 } | 193 } |
| 194 | 194 |
| 195 const ui::Layer* NativeWidgetMac::GetLayer() const { | 195 const ui::Layer* NativeWidgetMac::GetLayer() const { |
| 196 return bridge_ ? bridge_->layer() : nullptr; | 196 return bridge_ ? bridge_->layer() : nullptr; |
| 197 } | 197 } |
| 198 | 198 |
| 199 void NativeWidgetMac::ReorderNativeViews() { | 199 void NativeWidgetMac::ReorderNativeViews() { |
| 200 if (bridge_) { | 200 if (bridge_) |
| 201 bridge_->SetRootView(GetWidget()->GetRootView()); | |
| 202 bridge_->ReorderChildViews(); | 201 bridge_->ReorderChildViews(); |
| 203 } | |
| 204 } | 202 } |
| 205 | 203 |
| 206 void NativeWidgetMac::ViewRemoved(View* view) { | 204 void NativeWidgetMac::ViewRemoved(View* view) { |
| 207 DragDropClientMac* client = bridge_ ? bridge_->drag_drop_client() : nullptr; | 205 DragDropClientMac* client = bridge_ ? bridge_->drag_drop_client() : nullptr; |
| 208 if (client) | 206 if (client) |
| 209 client->drop_helper()->ResetTargetViewIfEquals(view); | 207 client->drop_helper()->ResetTargetViewIfEquals(view); |
| 210 } | 208 } |
| 211 | 209 |
| 212 void NativeWidgetMac::SetNativeWindowProperty(const char* name, void* value) { | 210 void NativeWidgetMac::SetNativeWindowProperty(const char* name, void* value) { |
| 213 if (bridge_) | 211 if (bridge_) |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; | 778 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; |
| 781 } | 779 } |
| 782 | 780 |
| 783 - (void)animationDidEnd:(NSAnimation*)animation { | 781 - (void)animationDidEnd:(NSAnimation*)animation { |
| 784 [window_ close]; | 782 [window_ close]; |
| 785 [animation_ setDelegate:nil]; | 783 [animation_ setDelegate:nil]; |
| 786 [self release]; | 784 [self release]; |
| 787 } | 785 } |
| 788 | 786 |
| 789 @end | 787 @end |
| OLD | NEW |