| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_WINDOW_TREE_CLIENT_DELEGATE_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ |
| 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "components/mus/public/interfaces/window_tree.mojom.h" | 10 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 11 #include "services/shell/public/interfaces/interface_provider.mojom.h" | 11 #include "services/shell/public/interfaces/interface_provider.mojom.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 class Event; | 14 class Event; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace mus { | 17 namespace mus { |
| 18 | 18 |
| 19 class Window; | 19 class Window; |
| 20 class WindowTreeClient; | 20 class WindowTreeClient; |
| 21 | 21 |
| 22 // Interface implemented by an application using the window manager. | 22 // Interface implemented by an application using mus. |
| 23 // | |
| 24 // WindowTreeClient is deleted by any of the following: | |
| 25 // . If all the roots of the connection are destroyed and the connection is | |
| 26 // configured to delete when there are no roots (the default). This happens | |
| 27 // if the owner of the roots Embed()s another app in all the roots, or all | |
| 28 // the roots are explicitly deleted. | |
| 29 // . The connection to the window manager is lost. | |
| 30 // . Explicitly by way of calling delete. | |
| 31 // | |
| 32 // When the WindowTreeClient is deleted all windows are deleted (and observers | |
| 33 // notified). This is followed by notifying the delegate by way of | |
| 34 // OnClientDestroyed(). | |
| 35 class WindowTreeClientDelegate { | 23 class WindowTreeClientDelegate { |
| 36 public: | 24 public: |
| 37 // Called when the application implementing this interface is embedded at | 25 // Called when the application implementing this interface is embedded at |
| 38 // |root|. | 26 // |root|. |
| 39 // NOTE: this is only invoked if the WindowTreeClient is created with an | 27 // NOTE: this is only invoked if the WindowTreeClient is created with an |
| 40 // InterfaceRequest. | 28 // InterfaceRequest. |
| 41 virtual void OnEmbed(Window* root) = 0; | 29 virtual void OnEmbed(Window* root) = 0; |
| 42 | 30 |
| 43 // Sent when another app is embedded in |root| (one of the roots of the | 31 // Sent when another app is embedded in |root| (one of the roots of the |
| 44 // connection). Afer this call |root| is deleted. If |root| is the only root | 32 // connection). Afer this call |root| is deleted. If |root| is the only root |
| (...skipping 11 matching lines...) Expand all Loading... |
| 56 // windows owned by other processes. | 44 // windows owned by other processes. |
| 57 virtual void OnEventObserved(const ui::Event& event, Window* target) = 0; | 45 virtual void OnEventObserved(const ui::Event& event, Window* target) = 0; |
| 58 | 46 |
| 59 protected: | 47 protected: |
| 60 virtual ~WindowTreeClientDelegate() {} | 48 virtual ~WindowTreeClientDelegate() {} |
| 61 }; | 49 }; |
| 62 | 50 |
| 63 } // namespace mus | 51 } // namespace mus |
| 64 | 52 |
| 65 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ | 53 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ |
| OLD | NEW |