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.
5 #ifndef ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_
6 #define ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ui/aura/window_observer.h"
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
{
24 AlwaysOnTopController();
25 ~AlwaysOnTopController() override
;
27 // Sets the container for always on top windows.
28 void SetAlwaysOnTopContainer(aura::Window
* always_on_top_container
);
30 // Gets container for given |window| based on its "AlwaysOnTop" property.
31 aura::Window
* GetContainer(aura::Window
* window
) const;
34 // Overridden from aura::WindowObserver:
35 void OnWindowAdded(aura::Window
* child
) override
;
36 void OnWillRemoveWindow(aura::Window
* child
) override
;
37 void OnWindowPropertyChanged(aura::Window
* window
,
39 intptr_t old
) override
;
40 void OnWindowDestroyed(aura::Window
* window
) override
;
42 aura::Window
* always_on_top_container_
;
44 DISALLOW_COPY_AND_ASSIGN(AlwaysOnTopController
);
49 #endif // ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_