Home | History | Annotate | Download | only in wm
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_
      6 #define ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/compiler_specific.h"
     10 #include "ui/aura/window_observer.h"
     11 
     12 namespace aura {
     13 class Window;
     14 }
     15 
     16 namespace ash {
     17 
     18 // AlwaysOnTopController puts window into proper containers based on its
     19 // 'AlwaysOnTop' property. That is, putting a window into the worskpace
     20 // container if its "AlwaysOnTop" property is false. Otherwise, put it in
     21 // |always_on_top_container_|.
     22 class AlwaysOnTopController : public aura::WindowObserver {
     23  public:
     24   AlwaysOnTopController();
     25   virtual ~AlwaysOnTopController();
     26 
     27   // Sets the container for always on top windows.
     28   void SetAlwaysOnTopContainer(aura::Window* always_on_top_container);
     29 
     30   // Gets container for given |window| based on its "AlwaysOnTop" property.
     31   aura::Window* GetContainer(aura::Window* window) const;
     32 
     33  private:
     34   // Overridden from aura::WindowObserver:
     35   virtual void OnWindowAdded(aura::Window* child) OVERRIDE;
     36   virtual void OnWillRemoveWindow(aura::Window* child) OVERRIDE;
     37   virtual void OnWindowPropertyChanged(aura::Window* window,
     38                                        const void* key,
     39                                        intptr_t old) OVERRIDE;
     40   virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
     41 
     42   aura::Window* always_on_top_container_;
     43 
     44   DISALLOW_COPY_AND_ASSIGN(AlwaysOnTopController);
     45 };
     46 
     47 }  // namepsace ash
     48 
     49 #endif  // ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_
     50