| OLD | NEW |
| 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/always_on_top_controller.h" | 5 #include "ui/aura_shell/always_on_top_controller.h" |
| 6 | 6 |
| 7 #include "ui/aura/client/aura_constants.h" | 7 #include "ui/aura/client/aura_constants.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/aura/window_types.h" | 9 #include "ui/aura/window_types.h" |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 if (child->parent() == default_container_ || | 50 if (child->parent() == default_container_ || |
| 51 child->parent() == always_on_top_container_) { | 51 child->parent() == always_on_top_container_) { |
| 52 child->AddObserver(this); | 52 child->AddObserver(this); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 void AlwaysOnTopController::OnWillRemoveWindow(aura::Window* child) { | 56 void AlwaysOnTopController::OnWillRemoveWindow(aura::Window* child) { |
| 57 child->RemoveObserver(this); | 57 child->RemoveObserver(this); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void AlwaysOnTopController::OnPropertyChanged(aura::Window* window, | 60 void AlwaysOnTopController::OnWindowPropertyChanged(aura::Window* window, |
| 61 const char* name, | 61 const char* name, |
| 62 void* old) { | 62 void* old) { |
| 63 if (name == aura::kAlwaysOnTopKey) { | 63 if (name == aura::kAlwaysOnTopKey) { |
| 64 DCHECK(window->type() == aura::WINDOW_TYPE_NORMAL || | 64 DCHECK(window->type() == aura::WINDOW_TYPE_NORMAL || |
| 65 window->type() == aura::WINDOW_TYPE_POPUP); | 65 window->type() == aura::WINDOW_TYPE_POPUP); |
| 66 aura::Window* container = GetContainer(window); | 66 aura::Window* container = GetContainer(window); |
| 67 if (window->parent() != container) | 67 if (window->parent() != container) |
| 68 container->AddChild(window); | 68 container->AddChild(window); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 void AlwaysOnTopController::OnWindowDestroyed(aura::Window* window) { | 72 void AlwaysOnTopController::OnWindowDestroyed(aura::Window* window) { |
| 73 if (window == default_container_) | 73 if (window == default_container_) |
| 74 default_container_ = NULL; | 74 default_container_ = NULL; |
| 75 if (window == always_on_top_container_) | 75 if (window == always_on_top_container_) |
| 76 always_on_top_container_ = NULL; | 76 always_on_top_container_ = NULL; |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace internal | 79 } // namespace internal |
| 80 } // namespace aura_shell | 80 } // namespace aura_shell |
| OLD | NEW |