OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 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_VIEWS_WIDGET_NATIVE_WIDGET_LAYER_REORDERER_AURA_H_ | |
6 #define UI_VIEWS_WIDGET_NATIVE_WIDGET_LAYER_REORDERER_AURA_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "ui/aura/window_observer.h" | |
10 | |
11 namespace aura { | |
12 class Window; | |
13 } | |
14 | |
15 namespace views { | |
16 class View; | |
17 | |
18 // Class which ensures the following z-order of the widget's child layers from | |
19 // topmost to bottommost: | |
20 // 1) Layers for child windows not attached to a view and layers not owned by | |
21 // a window or a view. | |
22 // 2) Layers for views and layers for child windows attached to a view ordered | |
23 // according to the order of the views in the view hierarchy. | |
24 // The order of child windows is kept in sync with the order of the layers. | |
25 class NativeWidgetLayerReordererAura : public aura::WindowObserver { | |
sky
2013/05/24 15:57:26
This is specific to aura::Window, so maybe the nam
pkotwicz
2013/05/26 04:12:15
Renamed to NativeWidgetWindowReordererAura
| |
26 public: | |
27 NativeWidgetLayerReordererAura(aura::Window* window, View* root_view); | |
28 virtual ~NativeWidgetLayerReordererAura(); | |
29 | |
30 // Explicitly reorder the children of |window_| (and their layers). This | |
31 // method should be called when the position of a view with an attached window | |
32 // changes in the view hierarchy. This method assumes that the layers owned by | |
33 // views are already in the correct order relative to each other. | |
34 void ReorderChildWindowLayers(); | |
35 | |
36 private: | |
37 // Stop observing |window| and its children. | |
38 void StopObserving(aura::Window* window); | |
39 | |
40 // aura::WindowObserver overrides: | |
41 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE; | |
42 virtual void OnWillRemoveWindow(aura::Window* window) OVERRIDE; | |
43 virtual void OnWindowPropertyChanged(aura::Window* window, | |
44 const void* key, | |
45 intptr_t old) OVERRIDE; | |
46 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | |
47 | |
48 // The window and the root view of the native widget which owns the | |
49 // NativeWidgetLayerReordererAura. | |
50 aura::Window* window_; | |
51 View* root_view_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(NativeWidgetLayerReordererAura); | |
54 }; | |
55 | |
56 } // namespace views | |
57 | |
58 #endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_LAYER_REORDERER_AURA_H_ | |
OLD | NEW |