OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 ATHENA_WM_WINDOW_LIST_PROVIDER_IMPL_H_ | |
6 #define ATHENA_WM_WINDOW_LIST_PROVIDER_IMPL_H_ | |
7 | |
8 #include "athena/wm/public/window_list_provider.h" | |
9 #include "base/gtest_prod_util.h" | |
10 #include "ui/aura/window_observer.h" | |
11 | |
12 namespace athena { | |
13 | |
14 class WindowListProviderObserver; | |
15 | |
16 // This implementation of the WindowListProviderImpl uses the same order as in | |
17 // the container window's stacking order. | |
18 class ATHENA_EXPORT WindowListProviderImpl : public WindowListProvider, | |
19 public aura::WindowObserver { | |
20 public: | |
21 explicit WindowListProviderImpl(aura::Window* container); | |
22 ~WindowListProviderImpl() override; | |
23 | |
24 // TODO(oshima): Remove this method. This should live outside. | |
25 bool IsValidWindow(aura::Window* window) const; | |
26 | |
27 // WindowListProvider: | |
28 void AddObserver(WindowListProviderObserver* observer) override; | |
29 void RemoveObserver(WindowListProviderObserver* observer) override; | |
30 const aura::Window::Windows& GetWindowList() const override; | |
31 bool IsWindowInList(aura::Window* window) const override; | |
32 void StackWindowFrontOf(aura::Window* window, | |
33 aura::Window* reference_window) override; | |
34 void StackWindowBehindTo(aura::Window* window, | |
35 aura::Window* reference_window) override; | |
36 | |
37 private: | |
38 void RecreateWindowList(); | |
39 | |
40 // aura::WindowObserver: | |
41 void OnWindowAdded(aura::Window* new_window) override; | |
42 void OnWillRemoveWindow(aura::Window* old_window) override; | |
43 void OnWindowStackingChanged(aura::Window* window) override; | |
44 | |
45 aura::Window* container_; | |
46 aura::Window::Windows window_list_; | |
47 ObserverList<WindowListProviderObserver> observers_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(WindowListProviderImpl); | |
50 }; | |
51 | |
52 } // namespace athena | |
53 | |
54 #endif // ATHENA_WM_WINDOW_LIST_PROVIDER_IMPL_H_ | |
OLD | NEW |