Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Side by Side Diff: ui/views/widget/native_widget_mac.mm

Issue 2577593002: MacViews: Be robust against Views manipulating Layers during Widget::Close(). (Closed)
Patch Set: selfnits Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/view_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698