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_WINDOW_MANAGER_WINDOW_MANAGER_DELEGATE_H_ | |
6 #define SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_DELEGATE_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "mojo/public/cpp/bindings/string.h" | |
10 #include "mojo/public/interfaces/application/service_provider.mojom.h" | |
11 #include "mojo/services/view_manager/cpp/view_manager_delegate.h" | |
12 | |
13 namespace mojo { | |
14 class ApplicationConnection; | |
15 } | |
16 | |
17 namespace window_manager { | |
18 | |
19 class WindowManagerRoot; | |
20 | |
21 class WindowManagerDelegate { | |
22 public: | |
23 // See WindowManager::Embed() for details. | |
24 virtual void Embed(const mojo::String& url, | |
25 mojo::InterfaceRequest<mojo::ServiceProvider> services, | |
26 mojo::ServiceProviderPtr exposed_services) = 0; | |
27 | |
28 protected: | |
29 virtual ~WindowManagerDelegate() {} | |
30 }; | |
31 | |
32 // Controls a single instance of WindowManagerRoot, representing one native | |
33 // window and all its Mojo-controlled views inside it. Instances of this object | |
34 // are owned by the WindowManagerRoot they control. | |
35 class WindowManagerController : public WindowManagerDelegate, | |
36 public mojo::ViewManagerDelegate {}; | |
37 | |
38 // Creates WindowManagerControllers. | |
39 // This class should be implemented by window managers and passed to the | |
40 // WindowManagerApp object. | |
41 class WindowManagerControllerFactory { | |
42 public: | |
43 // CreateWindowManagerController() is called by WindowManagerRoot to create | |
44 // its controller. The WindowManagerRoot passed to this method is guaranteed | |
45 // to remain valid for the entire lifetime of the created | |
46 // WindowManagerController. | |
47 virtual scoped_ptr<WindowManagerController> CreateWindowManagerController( | |
48 mojo::ApplicationConnection* connection, | |
49 WindowManagerRoot* wm_root_) = 0; | |
50 }; | |
51 | |
52 } // namespace mojo | |
53 | |
54 #endif // SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_DELEGATE_H_ | |
OLD | NEW |