Chromium Code Reviews| 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 |
| 40 virtual void OnDidDestroyClient(WindowTreeClient* client) = 0; | 39 // client was embedded in the same window). This is only called if the |
|
sadrul
2016/09/02 17:04:15
unnecessary line-break
sky
2016/09/06 17:15:42
Done.
| |
| 40 // WindowTreeClient was created from an InterfaceRequest. Generally when this | |
| 41 // is called the delegate will delete the WindowTreeClient. | |
| 42 virtual void OnEmbedRootDestroyed(Window* root) = 0; | |
| 43 | |
| 44 // Called when the connection to the window server has been lost. After this | |
| 45 // call the windows are still valid, and you can still do things, but they | |
| 46 // have no real effect. Generally when this is called clients will turn around | |
| 47 // and delete the corresponding WindowTreeClient. | |
| 48 virtual void OnLostConnection(WindowTreeClient* client) = 0; | |
| 41 | 49 |
| 42 // Called when the WindowTreeClient receives an input event observed via | 50 // Called when the WindowTreeClient receives an input event observed via |
| 43 // StartPointerWatcher(). |target| may be null for events that were sent to | 51 // StartPointerWatcher(). |target| may be null for events that were sent to |
| 44 // windows owned by other processes. | 52 // windows owned by other processes. |
| 45 virtual void OnPointerEventObserved(const ui::PointerEvent& event, | 53 virtual void OnPointerEventObserved(const ui::PointerEvent& event, |
| 46 Window* target) = 0; | 54 Window* target) = 0; |
| 47 | 55 |
| 48 protected: | 56 protected: |
| 49 virtual ~WindowTreeClientDelegate() {} | 57 virtual ~WindowTreeClientDelegate() {} |
| 50 }; | 58 }; |
| 51 | 59 |
| 52 } // namespace ui | 60 } // namespace ui |
| 53 | 61 |
| 54 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ | 62 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ |
| OLD | NEW |