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

Side by Side Diff: ash/wm/system_modal_container_layout_manager.cc

Issue 180273025: Keep dedicated layers for hiding animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/maximize_mode/workspace_backdrop_delegate.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // the fade to show animation before Show() is called. 169 // the fade to show animation before Show() is called.
170 modal_background_->GetNativeView()->layer()->SetOpacity(0.5f); 170 modal_background_->GetNativeView()->layer()->SetOpacity(0.5f);
171 modal_background_->Show(); 171 modal_background_->Show();
172 container_->StackChildAtTop(modal_background_->GetNativeView()); 172 container_->StackChildAtTop(modal_background_->GetNativeView());
173 } 173 }
174 174
175 void SystemModalContainerLayoutManager::DestroyModalBackground() { 175 void SystemModalContainerLayoutManager::DestroyModalBackground() {
176 // modal_background_ can be NULL when a root window is shutting down 176 // modal_background_ can be NULL when a root window is shutting down
177 // and OnWindowDestroying is called first. 177 // and OnWindowDestroying is called first.
178 if (modal_background_) { 178 if (modal_background_) {
179 ui::ScopedLayerAnimationSettings settings( 179 ::wm::ScopedHidingAnimationSettings settings(
180 modal_background_->GetNativeView()->layer()->GetAnimator()); 180 modal_background_->GetNativeView());
181 modal_background_->Close(); 181 modal_background_->Close();
182 settings.AddObserver(::wm::CreateHidingWindowAnimationObserver(
183 modal_background_->GetNativeView()));
184 modal_background_->GetNativeView()->layer()->SetOpacity(0.0f); 182 modal_background_->GetNativeView()->layer()->SetOpacity(0.0f);
185 modal_background_ = NULL; 183 modal_background_ = NULL;
186 } 184 }
187 } 185 }
188 186
189 // static 187 // static
190 bool SystemModalContainerLayoutManager::IsModalBackground( 188 bool SystemModalContainerLayoutManager::IsModalBackground(
191 aura::Window* window) { 189 aura::Window* window) {
192 int id = window->parent()->id(); 190 int id = window->parent()->id();
193 if (id != internal::kShellWindowId_SystemModalContainer && 191 if (id != internal::kShellWindowId_SystemModalContainer &&
(...skipping 23 matching lines...) Expand all
217 void SystemModalContainerLayoutManager::RemoveModalWindow( 215 void SystemModalContainerLayoutManager::RemoveModalWindow(
218 aura::Window* window) { 216 aura::Window* window) {
219 aura::Window::Windows::iterator it = 217 aura::Window::Windows::iterator it =
220 std::find(modal_windows_.begin(), modal_windows_.end(), window); 218 std::find(modal_windows_.begin(), modal_windows_.end(), window);
221 if (it != modal_windows_.end()) 219 if (it != modal_windows_.end())
222 modal_windows_.erase(it); 220 modal_windows_.erase(it);
223 } 221 }
224 222
225 } // namespace internal 223 } // namespace internal
226 } // namespace ash 224 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/maximize_mode/workspace_backdrop_delegate.cc ('k') | ash/wm/window_animations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698