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

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

Issue 203793004: Fixing invalid visibility states with layers (opacity==0, visibility==true) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed comment 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/panels/panel_layout_manager.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 (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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 views::View* contents_view = new views::View(); 158 views::View* contents_view = new views::View();
159 // TODO(jamescook): This could be SK_ColorWHITE for the new dialog style. 159 // TODO(jamescook): This could be SK_ColorWHITE for the new dialog style.
160 contents_view->set_background( 160 contents_view->set_background(
161 views::Background::CreateSolidBackground(SK_ColorBLACK)); 161 views::Background::CreateSolidBackground(SK_ColorBLACK));
162 modal_background_->SetContentsView(contents_view); 162 modal_background_->SetContentsView(contents_view);
163 modal_background_->GetNativeView()->layer()->SetOpacity(0.0f); 163 modal_background_->GetNativeView()->layer()->SetOpacity(0.0f);
164 } 164 }
165 165
166 ui::ScopedLayerAnimationSettings settings( 166 ui::ScopedLayerAnimationSettings settings(
167 modal_background_->GetNativeView()->layer()->GetAnimator()); 167 modal_background_->GetNativeView()->layer()->GetAnimator());
168 // Show should not be called with a target opacity of 0. We therefore start
169 // the fade to show animation before Show() is called.
170 modal_background_->GetNativeView()->layer()->SetOpacity(0.5f);
168 modal_background_->Show(); 171 modal_background_->Show();
169 modal_background_->GetNativeView()->layer()->SetOpacity(0.5f);
170 container_->StackChildAtTop(modal_background_->GetNativeView()); 172 container_->StackChildAtTop(modal_background_->GetNativeView());
171 } 173 }
172 174
173 void SystemModalContainerLayoutManager::DestroyModalBackground() { 175 void SystemModalContainerLayoutManager::DestroyModalBackground() {
174 // 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
175 // and OnWindowDestroying is called first. 177 // and OnWindowDestroying is called first.
176 if (modal_background_) { 178 if (modal_background_) {
177 ui::ScopedLayerAnimationSettings settings( 179 ui::ScopedLayerAnimationSettings settings(
178 modal_background_->GetNativeView()->layer()->GetAnimator()); 180 modal_background_->GetNativeView()->layer()->GetAnimator());
179 modal_background_->Close(); 181 modal_background_->Close();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 void SystemModalContainerLayoutManager::RemoveModalWindow( 217 void SystemModalContainerLayoutManager::RemoveModalWindow(
216 aura::Window* window) { 218 aura::Window* window) {
217 aura::Window::Windows::iterator it = 219 aura::Window::Windows::iterator it =
218 std::find(modal_windows_.begin(), modal_windows_.end(), window); 220 std::find(modal_windows_.begin(), modal_windows_.end(), window);
219 if (it != modal_windows_.end()) 221 if (it != modal_windows_.end())
220 modal_windows_.erase(it); 222 modal_windows_.erase(it);
221 } 223 }
222 224
223 } // namespace internal 225 } // namespace internal
224 } // namespace ash 226 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698