| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #import "chrome/browser/ui/cocoa/panels/panel_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/panels/panel_cocoa.h" |
| 10 #import "chrome/browser/ui/cocoa/panels/panel_utils_cocoa.h" | 10 #import "chrome/browser/ui/cocoa/panels/panel_utils_cocoa.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 EnsureWindowCreated(); | 75 EnsureWindowCreated(); |
| 76 | 76 |
| 77 // Make the stack window own the panel window such that all panels window | 77 // Make the stack window own the panel window such that all panels window |
| 78 // could be moved simulatenously when the stack window is moved. | 78 // could be moved simulatenously when the stack window is moved. |
| 79 [window_ addChildWindow:panel->GetNativeWindow() ordered:NSWindowAbove]; | 79 [window_ addChildWindow:panel->GetNativeWindow() ordered:NSWindowAbove]; |
| 80 | 80 |
| 81 UpdateStackWindowBounds(); | 81 UpdateStackWindowBounds(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void PanelStackWindowCocoa::RemovePanel(Panel* panel) { | 84 void PanelStackWindowCocoa::RemovePanel(Panel* panel) { |
| 85 if (IsAnimatingPanelBounds()) { |
| 86 // This panel is gone. We should not perform any update to it. |
| 87 bounds_updates_.erase(panel); |
| 88 } |
| 89 |
| 85 panels_.remove(panel); | 90 panels_.remove(panel); |
| 86 | 91 |
| 87 // If the native panel is closed, the native window should already be gone. | 92 // If the native panel is closed, the native window should already be gone. |
| 88 if (!static_cast<PanelCocoa*>(panel->native_panel())->IsClosed()) | 93 if (!static_cast<PanelCocoa*>(panel->native_panel())->IsClosed()) |
| 89 [window_ removeChildWindow:panel->GetNativeWindow()]; | 94 [window_ removeChildWindow:panel->GetNativeWindow()]; |
| 90 | 95 |
| 91 UpdateStackWindowBounds(); | 96 UpdateStackWindowBounds(); |
| 92 } | 97 } |
| 93 | 98 |
| 94 void PanelStackWindowCocoa::MergeWith(NativePanelStackWindow* another) { | 99 void PanelStackWindowCocoa::MergeWith(NativePanelStackWindow* another) { |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater | 376 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater |
| 372 styleMask:NSBorderlessWindowMask | 377 styleMask:NSBorderlessWindowMask |
| 373 backing:NSBackingStoreBuffered | 378 backing:NSBackingStoreBuffered |
| 374 defer:NO]); | 379 defer:NO]); |
| 375 [window_ setBackgroundColor:[NSColor clearColor]]; | 380 [window_ setBackgroundColor:[NSColor clearColor]]; |
| 376 [window_ setHasShadow:YES]; | 381 [window_ setHasShadow:YES]; |
| 377 [window_ setLevel:NSNormalWindowLevel]; | 382 [window_ setLevel:NSNormalWindowLevel]; |
| 378 [window_ orderFront:nil]; | 383 [window_ orderFront:nil]; |
| 379 [window_ setTitle:base::SysUTF16ToNSString(delegate_->GetTitle())]; | 384 [window_ setTitle:base::SysUTF16ToNSString(delegate_->GetTitle())]; |
| 380 } | 385 } |
| OLD | NEW |