OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_MUS_PUBLIC_CPP_SCOPED_WINDOW_PTR_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_SCOPED_WINDOW_PTR_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_SCOPED_WINDOW_PTR_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_SCOPED_WINDOW_PTR_H_ |
7 | 7 |
| 8 #include "base/macros.h" |
8 #include "components/mus/public/cpp/window_observer.h" | 9 #include "components/mus/public/cpp/window_observer.h" |
9 | 10 |
10 namespace mus { | 11 namespace mus { |
11 | 12 |
12 // Wraps a Window, taking overship of the Window. Also deals with Window being | 13 // Wraps a Window, taking overship of the Window. Also deals with Window being |
13 // destroyed while ScopedWindowPtr still exists. | 14 // destroyed while ScopedWindowPtr still exists. |
14 class ScopedWindowPtr : public WindowObserver { | 15 class ScopedWindowPtr : public WindowObserver { |
15 public: | 16 public: |
16 explicit ScopedWindowPtr(Window* window); | 17 explicit ScopedWindowPtr(Window* window); |
17 ~ScopedWindowPtr() override; | 18 ~ScopedWindowPtr() override; |
(...skipping 11 matching lines...) Expand all Loading... |
29 void OnWindowDestroying(Window* window) override; | 30 void OnWindowDestroying(Window* window) override; |
30 | 31 |
31 Window* window_; | 32 Window* window_; |
32 | 33 |
33 DISALLOW_COPY_AND_ASSIGN(ScopedWindowPtr); | 34 DISALLOW_COPY_AND_ASSIGN(ScopedWindowPtr); |
34 }; | 35 }; |
35 | 36 |
36 } // namespace mus | 37 } // namespace mus |
37 | 38 |
38 #endif // COMPONENTS_MUS_PUBLIC_CPP_SCOPED_WINDOW_PTR_H_ | 39 #endif // COMPONENTS_MUS_PUBLIC_CPP_SCOPED_WINDOW_PTR_H_ |
OLD | NEW |