| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_MUS_WS_WINDOW_TREE_HOST_DELEGATE_H_ | |
| 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_HOST_DELEGATE_H_ | |
| 7 | |
| 8 namespace mus { | |
| 9 | |
| 10 namespace ws { | |
| 11 | |
| 12 class WindowTreeImpl; | |
| 13 | |
| 14 // A WindowTreeHostDelegate interface is implemented by an object that | |
| 15 // has the WindowTreeImpl that is associated with the WindowTreeHostImpl that | |
| 16 // holds a pointer to this object. Typically, a WindowTreeHostDelegate will also | |
| 17 // manage the lifetime of the WindowTreeHostImpl and will delete the object when | |
| 18 // it get informed of when the Display of the root is closed. | |
| 19 class WindowTreeHostDelegate { | |
| 20 public: | |
| 21 // Called when the window associated with the root is completely initialized | |
| 22 // (i.e. the ViewportMetrics for the display is known). | |
| 23 virtual void OnDisplayInitialized() = 0; | |
| 24 | |
| 25 // Called when the window associated with the root is closed. | |
| 26 virtual void OnDisplayClosed() = 0; | |
| 27 | |
| 28 // Returns the WindowTreeImpl associated with the delegate. | |
| 29 virtual const WindowTreeImpl* GetWindowTree() const = 0; | |
| 30 WindowTreeImpl* GetWindowTree() { | |
| 31 return const_cast<WindowTreeImpl*>( | |
| 32 const_cast<const WindowTreeHostDelegate*>(this)->GetWindowTree()); | |
| 33 } | |
| 34 | |
| 35 protected: | |
| 36 virtual ~WindowTreeHostDelegate() {} | |
| 37 }; | |
| 38 | |
| 39 } // namespace ws | |
| 40 | |
| 41 } // namespace mus | |
| 42 | |
| 43 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_DELEGATE_H_ | |
| OLD | NEW |