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

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

Issue 9348113: Fix two crash and potential leak&crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert unnecessary file, updated comment Created 8 years, 10 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
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/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
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
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
OLDNEW
« no previous file with comments | « ash/wm/system_modal_container_layout_manager.h ('k') | chrome/browser/ui/views/notifications/balloon_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698