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

Unified Diff: ui/aura_shell/stacking_controller.cc

Issue 8638013: [cros Aura] Added modal container for screen lock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura_shell/stacking_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/stacking_controller.cc
diff --git a/ui/aura_shell/stacking_controller.cc b/ui/aura_shell/stacking_controller.cc
index ffe5cb4af7cb8101de55cd0accca44598d297604..6c7a606925d99a3590db881a3d774fc78ef8db7e 100644
--- a/ui/aura_shell/stacking_controller.cc
+++ b/ui/aura_shell/stacking_controller.cc
@@ -23,7 +23,8 @@ aura::Window* GetContainer(int id) {
bool SupportsChildActivation(aura::Window* window) {
return window->id() == kShellWindowId_DefaultContainer ||
window->id() == kShellWindowId_AlwaysOnTopContainer ||
- window->id() == kShellWindowId_ModalContainer;
+ window->id() == kShellWindowId_ModalContainer ||
+ window->id() == kShellWindowId_LockModalContainer;
}
bool IsWindowModal(aura::Window* window) {
@@ -75,7 +76,7 @@ void StackingController::AddChildToDefaultParent(aura::Window* window) {
case aura::WINDOW_TYPE_NORMAL:
case aura::WINDOW_TYPE_POPUP:
if (IsWindowModal(window)) {
- parent = GetContainer(internal::kShellWindowId_ModalContainer);
+ parent = GetModalContainer(window);
break;
}
parent = always_on_top_controller_->GetContainer(window);
@@ -113,5 +114,28 @@ aura::Window* StackingController::GetTopmostWindowToActivate(
////////////////////////////////////////////////////////////////////////////////
// StackingController, private:
+aura::Window* StackingController::GetModalContainer(
+ aura::Window* window) const {
+ if (!IsWindowModal(window))
+ return NULL;
+
+ // If screen lock is not active, all modal windows are placed into the
+ // normal modal container.
+ aura::Window* lock_container =
+ GetContainer(internal::kShellWindowId_LockScreenContainer);
+ if (!lock_container->children().size())
+ return GetContainer(internal::kShellWindowId_ModalContainer);
+
+ // Otherwise those that originate from LockScreen container and above are
+ // placed in the screen lock modal container.
+ int lock_container_id = lock_container->id();
+ int window_container_id = window->transient_parent()->parent()->id();
+
+ if (window_container_id < lock_container_id)
+ return GetContainer(internal::kShellWindowId_ModalContainer);
+ else
Ben Goodger (Google) 2011/11/29 16:42:26 nit: no else after return
Nikita (slow) 2011/11/29 17:12:32 Done.
+ return GetContainer(internal::kShellWindowId_LockModalContainer);
+}
+
} // namespace internal
} // namespace aura_shell
« no previous file with comments | « ui/aura_shell/stacking_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698