| 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/session_state_delegate.h" | 7 #include "ash/session_state_delegate.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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 container_->StackChildAtTop(modal_background_->GetNativeView()); | 170 container_->StackChildAtTop(modal_background_->GetNativeView()); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void SystemModalContainerLayoutManager::DestroyModalBackground() { | 173 void SystemModalContainerLayoutManager::DestroyModalBackground() { |
| 174 // modal_background_ can be NULL when a root window is shutting down | 174 // modal_background_ can be NULL when a root window is shutting down |
| 175 // and OnWindowDestroying is called first. | 175 // and OnWindowDestroying is called first. |
| 176 if (modal_background_) { | 176 if (modal_background_) { |
| 177 ui::ScopedLayerAnimationSettings settings( | 177 ui::ScopedLayerAnimationSettings settings( |
| 178 modal_background_->GetNativeView()->layer()->GetAnimator()); | 178 modal_background_->GetNativeView()->layer()->GetAnimator()); |
| 179 modal_background_->Close(); | 179 modal_background_->Close(); |
| 180 settings.AddObserver(views::corewm::CreateHidingWindowAnimationObserver( | 180 settings.AddObserver(::wm::CreateHidingWindowAnimationObserver( |
| 181 modal_background_->GetNativeView())); | 181 modal_background_->GetNativeView())); |
| 182 modal_background_->GetNativeView()->layer()->SetOpacity(0.0f); | 182 modal_background_->GetNativeView()->layer()->SetOpacity(0.0f); |
| 183 modal_background_ = NULL; | 183 modal_background_ = NULL; |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 // static | 187 // static |
| 188 bool SystemModalContainerLayoutManager::IsModalBackground( | 188 bool SystemModalContainerLayoutManager::IsModalBackground( |
| 189 aura::Window* window) { | 189 aura::Window* window) { |
| 190 int id = window->parent()->id(); | 190 int id = window->parent()->id(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 215 void SystemModalContainerLayoutManager::RemoveModalWindow( | 215 void SystemModalContainerLayoutManager::RemoveModalWindow( |
| 216 aura::Window* window) { | 216 aura::Window* window) { |
| 217 aura::Window::Windows::iterator it = | 217 aura::Window::Windows::iterator it = |
| 218 std::find(modal_windows_.begin(), modal_windows_.end(), window); | 218 std::find(modal_windows_.begin(), modal_windows_.end(), window); |
| 219 if (it != modal_windows_.end()) | 219 if (it != modal_windows_.end()) |
| 220 modal_windows_.erase(it); | 220 modal_windows_.erase(it); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace internal | 223 } // namespace internal |
| 224 } // namespace ash | 224 } // namespace ash |
| OLD | NEW |