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