| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/wm/system_modal_container_layout_manager.h" | 5 #include "ash/wm/system_modal_container_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/system_modal_container_event_filter.h" | 10 #include "ash/wm/system_modal_container_event_filter.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 if (key != aura::client::kModalKey) | 114 if (key != aura::client::kModalKey) |
| 115 return; | 115 return; |
| 116 | 116 |
| 117 if (window->GetProperty(aura::client::kModalKey) != ui::MODAL_TYPE_NONE) { | 117 if (window->GetProperty(aura::client::kModalKey) != ui::MODAL_TYPE_NONE) { |
| 118 AddModalWindow(window); | 118 AddModalWindow(window); |
| 119 } else if (static_cast<ui::ModalType>(old) != ui::MODAL_TYPE_NONE) { | 119 } else if (static_cast<ui::ModalType>(old) != ui::MODAL_TYPE_NONE) { |
| 120 RemoveModalWindow(window); | 120 RemoveModalWindow(window); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 void SystemModalContainerLayoutManager::OnWindowDestroying( |
| 125 aura::Window* window) { |
| 126 if (modal_screen_ && modal_screen_->GetNativeView() == window) |
| 127 modal_screen_ = NULL; |
| 128 } |
| 129 |
| 130 |
| 124 //////////////////////////////////////////////////////////////////////////////// | 131 //////////////////////////////////////////////////////////////////////////////// |
| 125 // SystemModalContainerLayoutManager, | 132 // SystemModalContainerLayoutManager, |
| 126 // ui::ImplicitAnimationObserver implementation: | 133 // ui::ImplicitAnimationObserver implementation: |
| 127 | 134 |
| 128 void SystemModalContainerLayoutManager::OnImplicitAnimationsCompleted() { | 135 void SystemModalContainerLayoutManager::OnImplicitAnimationsCompleted() { |
| 129 if (modal_screen_ && !modal_screen_->GetNativeView()->layer()->ShouldDraw()) | 136 if (modal_screen_ && !modal_screen_->GetNativeView()->layer()->ShouldDraw()) |
| 130 DestroyModalScreen(); | 137 DestroyModalScreen(); |
| 131 } | 138 } |
| 132 | 139 |
| 133 //////////////////////////////////////////////////////////////////////////////// | 140 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 210 |
| 204 Shell::GetInstance()->RemoveRootWindowEventFilter(modality_filter_.get()); | 211 Shell::GetInstance()->RemoveRootWindowEventFilter(modality_filter_.get()); |
| 205 ui::ScopedLayerAnimationSettings settings( | 212 ui::ScopedLayerAnimationSettings settings( |
| 206 modal_screen_->GetNativeView()->layer()->GetAnimator()); | 213 modal_screen_->GetNativeView()->layer()->GetAnimator()); |
| 207 settings.AddObserver(this); | 214 settings.AddObserver(this); |
| 208 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); | 215 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); |
| 209 } | 216 } |
| 210 | 217 |
| 211 } // namespace internal | 218 } // namespace internal |
| 212 } // namespace ash | 219 } // namespace ash |
| OLD | NEW |