OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_COMMON_WM_WINDOW_USER_DATA_H_ | 5 #ifndef ASH_WM_WINDOW_USER_DATA_H_ |
6 #define ASH_COMMON_WM_WINDOW_USER_DATA_H_ | 6 #define ASH_WM_WINDOW_USER_DATA_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "ash/common/wm_window.h" | 12 #include "ash/wm_window.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
15 #include "ui/aura/window_observer.h" | 15 #include "ui/aura/window_observer.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 | 18 |
19 // WmWindowUserData provides a way to associate arbitrary objects with a | 19 // WmWindowUserData provides a way to associate arbitrary objects with a |
20 // WmWindow. WmWindowUserData owns the data, deleting it either when | 20 // WmWindow. WmWindowUserData owns the data, deleting it either when |
21 // WmWindowUserData is deleted, or when the window the data is associated with | 21 // WmWindowUserData is deleted, or when the window the data is associated with |
22 // is destroyed (from aura::WindowObserver::OnWindowDestroying()). | 22 // is destroyed (from aura::WindowObserver::OnWindowDestroying()). |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 window_to_data_.erase(WmWindow::Get(window)); | 68 window_to_data_.erase(WmWindow::Get(window)); |
69 } | 69 } |
70 | 70 |
71 std::map<WmWindow*, std::unique_ptr<UserData>> window_to_data_; | 71 std::map<WmWindow*, std::unique_ptr<UserData>> window_to_data_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(WmWindowUserData); | 73 DISALLOW_COPY_AND_ASSIGN(WmWindowUserData); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace ash | 76 } // namespace ash |
77 | 77 |
78 #endif // ASH_COMMON_WM_WINDOW_USER_DATA_H_ | 78 #endif // ASH_WM_WINDOW_USER_DATA_H_ |
OLD | NEW |