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

Side by Side Diff: ui/aura_shell/modal_container_layout_manager.cc

Issue 8620002: s/Move/Stack/ in names of stacking-related methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a test Created 9 years 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 | « ui/aura/window_unittest.cc ('k') | ui/aura_shell/shadow_controller.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/aura_shell/modal_container_layout_manager.h" 5 #include "ui/aura_shell/modal_container_layout_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/desktop.h" 9 #include "ui/aura/desktop.h"
10 #include "ui/aura/event.h" 10 #include "ui/aura/event.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 aura::Window* window) { 128 aura::Window* window) {
129 return StackingController::GetActivatableWindow(window) == modal_window(); 129 return StackingController::GetActivatableWindow(window) == modal_window();
130 } 130 }
131 131
132 //////////////////////////////////////////////////////////////////////////////// 132 ////////////////////////////////////////////////////////////////////////////////
133 // ModalContainerLayoutManager, private: 133 // ModalContainerLayoutManager, private:
134 134
135 void ModalContainerLayoutManager::AddModalWindow(aura::Window* window) { 135 void ModalContainerLayoutManager::AddModalWindow(aura::Window* window) {
136 modal_windows_.push_back(window); 136 modal_windows_.push_back(window);
137 CreateModalScreen(); 137 CreateModalScreen();
138 container_->MoveChildToFront(window); 138 container_->StackChildAtTop(window);
139 window->Activate(); 139 window->Activate();
140 } 140 }
141 141
142 void ModalContainerLayoutManager::RemoveModalWindow(aura::Window* window) { 142 void ModalContainerLayoutManager::RemoveModalWindow(aura::Window* window) {
143 aura::Window::Windows::iterator it = 143 aura::Window::Windows::iterator it =
144 std::find(modal_windows_.begin(), modal_windows_.end(), window); 144 std::find(modal_windows_.begin(), modal_windows_.end(), window);
145 if (it != modal_windows_.end()) 145 if (it != modal_windows_.end())
146 modal_windows_.erase(it); 146 modal_windows_.erase(it);
147 147
148 if (modal_windows_.empty()) 148 if (modal_windows_.empty())
(...skipping 16 matching lines...) Expand all
165 modal_screen_->SetContentsView(new ScreenView); 165 modal_screen_->SetContentsView(new ScreenView);
166 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); 166 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f);
167 modal_screen_->GetNativeView()->layer()->GetAnimator()->AddObserver(this); 167 modal_screen_->GetNativeView()->layer()->GetAnimator()->AddObserver(this);
168 168
169 Shell::GetInstance()->AddDesktopEventFilter(modality_filter_.get()); 169 Shell::GetInstance()->AddDesktopEventFilter(modality_filter_.get());
170 170
171 ui::LayerAnimator::ScopedSettings settings( 171 ui::LayerAnimator::ScopedSettings settings(
172 modal_screen_->GetNativeView()->layer()->GetAnimator()); 172 modal_screen_->GetNativeView()->layer()->GetAnimator());
173 modal_screen_->Show(); 173 modal_screen_->Show();
174 modal_screen_->GetNativeView()->layer()->SetOpacity(0.5f); 174 modal_screen_->GetNativeView()->layer()->SetOpacity(0.5f);
175 container_->MoveChildToFront(modal_screen_->GetNativeView()); 175 container_->StackChildAtTop(modal_screen_->GetNativeView());
176 } 176 }
177 177
178 void ModalContainerLayoutManager::DestroyModalScreen() { 178 void ModalContainerLayoutManager::DestroyModalScreen() {
179 modal_screen_->GetNativeView()->layer()->GetAnimator()->RemoveObserver(this); 179 modal_screen_->GetNativeView()->layer()->GetAnimator()->RemoveObserver(this);
180 modal_screen_->Close(); 180 modal_screen_->Close();
181 modal_screen_ = NULL; 181 modal_screen_ = NULL;
182 } 182 }
183 183
184 void ModalContainerLayoutManager::HideModalScreen() { 184 void ModalContainerLayoutManager::HideModalScreen() {
185 Shell::GetInstance()->RemoveDesktopEventFilter(modality_filter_.get()); 185 Shell::GetInstance()->RemoveDesktopEventFilter(modality_filter_.get());
186 ui::LayerAnimator::ScopedSettings settings( 186 ui::LayerAnimator::ScopedSettings settings(
187 modal_screen_->GetNativeView()->layer()->GetAnimator()); 187 modal_screen_->GetNativeView()->layer()->GetAnimator());
188 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); 188 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f);
189 } 189 }
190 190
191 } // namespace internal 191 } // namespace internal
192 } // namespace aura_shell 192 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura/window_unittest.cc ('k') | ui/aura_shell/shadow_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698