Chromium Code Reviews| Index: ui/views/widget/native_widget_layer_reorderer_aura.h |
| diff --git a/ui/views/widget/native_widget_layer_reorderer_aura.h b/ui/views/widget/native_widget_layer_reorderer_aura.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3f27a4cce6a24b8a8e93464959c27f581cc731f9 |
| --- /dev/null |
| +++ b/ui/views/widget/native_widget_layer_reorderer_aura.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_VIEWS_WIDGET_NATIVE_WIDGET_LAYER_REORDERER_AURA_H_ |
| +#define UI_VIEWS_WIDGET_NATIVE_WIDGET_LAYER_REORDERER_AURA_H_ |
| + |
| +#include "base/compiler_specific.h" |
| +#include "ui/aura/window_observer.h" |
| + |
| +namespace aura { |
| +class Window; |
| +} |
| + |
| +namespace views { |
| +class View; |
| + |
| +// Class which ensures the following z-order of the widget's child layers from |
| +// topmost to bottommost: |
| +// 1) Layers for child windows not attached to a view and layers not owned by |
| +// a window or a view. |
| +// 2) Layers for views and layers for child windows attached to a view ordered |
| +// according to the order of the views in the view hierarchy. |
| +// The order of child windows is kept in sync with the order of the layers. |
| +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
|
| + public: |
| + NativeWidgetLayerReordererAura(aura::Window* window, View* root_view); |
| + virtual ~NativeWidgetLayerReordererAura(); |
| + |
| + // Explicitly reorder the children of |window_| (and their layers). This |
| + // method should be called when the position of a view with an attached window |
| + // changes in the view hierarchy. This method assumes that the layers owned by |
| + // views are already in the correct order relative to each other. |
| + void ReorderChildWindowLayers(); |
| + |
| + private: |
| + // Stop observing |window| and its children. |
| + void StopObserving(aura::Window* window); |
| + |
| + // aura::WindowObserver overrides: |
| + virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE; |
| + virtual void OnWillRemoveWindow(aura::Window* window) OVERRIDE; |
| + virtual void OnWindowPropertyChanged(aura::Window* window, |
| + const void* key, |
| + intptr_t old) OVERRIDE; |
| + virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| + |
| + // The window and the root view of the native widget which owns the |
| + // NativeWidgetLayerReordererAura. |
| + aura::Window* window_; |
| + View* root_view_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NativeWidgetLayerReordererAura); |
| +}; |
| + |
| +} // namespace views |
| + |
| +#endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_LAYER_REORDERER_AURA_H_ |