OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_AURA_SHELL_ALWAYS_ON_TOP_CONTROLLER_H_ |
| 6 #define UI_AURA_SHELL_ALWAYS_ON_TOP_CONTROLLER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
| 11 #include "ui/aura/window_observer.h" |
| 12 |
| 13 namespace aura { |
| 14 class Window; |
| 15 } |
| 16 |
| 17 namespace aura_shell { |
| 18 namespace internal { |
| 19 |
| 20 // AlwaysOnTopController puts window into proper containers based on its |
| 21 // 'AlwaysOnTop' property. That is, putting a window to |default_container_| |
| 22 // if its "AlwaysOnTop" property is false. Otherwise, put it in |
| 23 // |always_on_top_container_|. |
| 24 class AlwaysOnTopController : public aura::WindowObserver { |
| 25 public: |
| 26 AlwaysOnTopController(); |
| 27 virtual ~AlwaysOnTopController(); |
| 28 |
| 29 // Sets the two top level window containers. |
| 30 void SetContainers(aura::Window* default_container, |
| 31 aura::Window* always_on_top_container); |
| 32 |
| 33 // Gets container for given |window| based on its "AlwaysOnTop" property. |
| 34 aura::Window* GetContainer(aura::Window* window) const; |
| 35 |
| 36 private: |
| 37 // Overridden from aura::WindowObserver: |
| 38 virtual void OnWindowAdded(aura::Window* child) OVERRIDE; |
| 39 virtual void OnWillRemoveWindow(aura::Window* child) OVERRIDE; |
| 40 virtual void OnPropertyChanged(aura::Window* window, |
| 41 const char* name, |
| 42 void* old) OVERRIDE; |
| 43 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; |
| 44 |
| 45 aura::Window* default_container_; |
| 46 aura::Window* always_on_top_container_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(AlwaysOnTopController); |
| 49 }; |
| 50 |
| 51 } // namepsace aura_shell |
| 52 } // namepsace internal |
| 53 |
| 54 #endif // UI_AURA_SHELL_ALWAYS_ON_TOP_CONTROLLER_H_ |
OLD | NEW |