| 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 COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ | |
| 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "components/mus/public/interfaces/window_tree.mojom.h" | |
| 11 #include "services/shell/public/interfaces/interface_provider.mojom.h" | |
| 12 | |
| 13 namespace ui { | |
| 14 class Event; | |
| 15 } | |
| 16 | |
| 17 namespace mus { | |
| 18 | |
| 19 class Window; | |
| 20 class WindowTreeClient; | |
| 21 | |
| 22 // Interface implemented by an application using mus. | |
| 23 class WindowTreeClientDelegate { | |
| 24 public: | |
| 25 // Called when the application implementing this interface is embedded at | |
| 26 // |root|. | |
| 27 // NOTE: this is only invoked if the WindowTreeClient is created with an | |
| 28 // InterfaceRequest. | |
| 29 virtual void OnEmbed(Window* root) = 0; | |
| 30 | |
| 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 | |
| 33 // and the connection is configured to delete when there are no roots (the | |
| 34 // default), then after |root| is destroyed the connection is destroyed as | |
| 35 // well. | |
| 36 virtual void OnUnembed(Window* root); | |
| 37 | |
| 38 // Called from the destructor of WindowTreeClient after all the Windows have | |
| 39 // been destroyed. |client| is no longer valid after this call. | |
| 40 virtual void OnDidDestroyClient(WindowTreeClient* client) = 0; | |
| 41 | |
| 42 // Called when the WindowTreeClient receives an input event observed via | |
| 43 // SetEventObserver(). |target| may be null for events that were sent to | |
| 44 // windows owned by other processes. | |
| 45 virtual void OnEventObserved(const ui::Event& event, Window* target) = 0; | |
| 46 | |
| 47 protected: | |
| 48 virtual ~WindowTreeClientDelegate() {} | |
| 49 }; | |
| 50 | |
| 51 } // namespace mus | |
| 52 | |
| 53 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CLIENT_DELEGATE_H_ | |
| OLD | NEW |