| 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 SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ |
| 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "services/shell/public/interfaces/interface_provider.mojom.h" | 10 #include "services/shell/public/interfaces/interface_provider.mojom.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Interface implemented by an application using mus. | 22 // Interface implemented by an application using mus. |
| 23 class WindowTreeClientDelegate { | 23 class WindowTreeClientDelegate { |
| 24 public: | 24 public: |
| 25 // Called when the application implementing this interface is embedded at | 25 // Called when the application implementing this interface is embedded at |
| 26 // |root|. | 26 // |root|. |
| 27 // 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 |
| 28 // InterfaceRequest. | 28 // InterfaceRequest. |
| 29 virtual void OnEmbed(Window* root) = 0; | 29 virtual void OnEmbed(Window* root) = 0; |
| 30 | 30 |
| 31 // 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 |
| 32 // connection). Afer this call |root| is deleted. If |root| is the only root | 32 // connection). Afer this call |root| is deleted. If the associated |
| 33 // and the connection is configured to delete when there are no roots (the | 33 // WindowTreeClient was created from a WindowTreeClientRequest then |
| 34 // default), then after |root| is destroyed the connection is destroyed as | 34 // OnEmbedRootDestroyed() is called after the window is deleted. |
| 35 // well. | |
| 36 virtual void OnUnembed(Window* root); | 35 virtual void OnUnembed(Window* root); |
| 37 | 36 |
| 38 // Called from the destructor of WindowTreeClient after all the Windows have | 37 // Called when the embed root has been destroyed on the server side (or |
| 39 // been destroyed. |client| is no longer valid after this call. | 38 // another client was embedded in the same window). This is only called if the |
| 40 virtual void OnDidDestroyClient(WindowTreeClient* client) = 0; | 39 // WindowTreeClient was created from an InterfaceRequest. Generally when this |
| 40 // is called the delegate should delete the WindowTreeClient. |
| 41 virtual void OnEmbedRootDestroyed(Window* root) = 0; |
| 42 |
| 43 // Called when the connection to the window server has been lost. After this |
| 44 // call the windows are still valid, and you can still do things, but they |
| 45 // have no real effect. Generally when this is called clients should delete |
| 46 // the corresponding WindowTreeClient. |
| 47 virtual void OnLostConnection(WindowTreeClient* client) = 0; |
| 41 | 48 |
| 42 // Called when the WindowTreeClient receives an input event observed via | 49 // Called when the WindowTreeClient receives an input event observed via |
| 43 // StartPointerWatcher(). |target| may be null for events that were sent to | 50 // StartPointerWatcher(). |target| may be null for events that were sent to |
| 44 // windows owned by other processes. | 51 // windows owned by other processes. |
| 45 virtual void OnPointerEventObserved(const ui::PointerEvent& event, | 52 virtual void OnPointerEventObserved(const ui::PointerEvent& event, |
| 46 Window* target) = 0; | 53 Window* target) = 0; |
| 47 | 54 |
| 48 protected: | 55 protected: |
| 49 virtual ~WindowTreeClientDelegate() {} | 56 virtual ~WindowTreeClientDelegate() {} |
| 50 }; | 57 }; |
| 51 | 58 |
| 52 } // namespace ui | 59 } // namespace ui |
| 53 | 60 |
| 54 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ | 61 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ |
| OLD | NEW |