| 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_IMPL_H_ | |
| 6 #define SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_IMPL_H_ | |
| 7 | |
| 8 #include "base/logging.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "mojo/public/cpp/bindings/binding.h" | |
| 11 #include "mojo/services/view_manager/cpp/types.h" | |
| 12 #include "mojo/services/window_manager/interfaces/window_manager.mojom.h" | |
| 13 | |
| 14 namespace window_manager { | |
| 15 | |
| 16 class WindowManagerRoot; | |
| 17 | |
| 18 class WindowManagerImpl : public mojo::WindowManager { | |
| 19 public: | |
| 20 // WindowManagerImpl is fully owned by WindowManagerRoot. | |
| 21 // |from_vm| is set to true when this service is connected from a view | |
| 22 // manager. | |
| 23 WindowManagerImpl(WindowManagerRoot* window_manager, | |
| 24 mojo::ScopedMessagePipeHandle window_manager_pipe, | |
| 25 bool from_vm); | |
| 26 ~WindowManagerImpl() override; | |
| 27 | |
| 28 void NotifyViewFocused(mojo::Id focused_id); | |
| 29 void NotifyWindowActivated(mojo::Id active_id); | |
| 30 void NotifyCaptureChanged(mojo::Id capture_id); | |
| 31 | |
| 32 private: | |
| 33 // mojo::WindowManager: | |
| 34 void Embed(const mojo::String& url, | |
| 35 mojo::InterfaceRequest<mojo::ServiceProvider> services, | |
| 36 mojo::ServiceProviderPtr exposed_services) override; | |
| 37 void SetCapture(uint32_t view_id, | |
| 38 const mojo::Callback<void(bool)>& callback) override; | |
| 39 void FocusWindow(uint32_t view_id, | |
| 40 const mojo::Callback<void(bool)>& callback) override; | |
| 41 void ActivateWindow(uint32_t view_id, | |
| 42 const mojo::Callback<void(bool)>& callback) override; | |
| 43 void GetFocusedAndActiveViews( | |
| 44 mojo::WindowManagerObserverPtr observer, | |
| 45 const mojo::WindowManager::GetFocusedAndActiveViewsCallback& callback) | |
| 46 override; | |
| 47 | |
| 48 WindowManagerRoot* window_manager_; | |
| 49 | |
| 50 // Whether this connection originated from the ViewManager. Connections that | |
| 51 // originate from the view manager are expected to have clients. Connections | |
| 52 // that don't originate from the view manager do not have clients. | |
| 53 const bool from_vm_; | |
| 54 | |
| 55 mojo::Binding<mojo::WindowManager> binding_; | |
| 56 mojo::WindowManagerObserverPtr observer_; | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(WindowManagerImpl); | |
| 59 }; | |
| 60 | |
| 61 } // namespace window_manager | |
| 62 | |
| 63 #endif // SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_IMPL_H_ | |
| OLD | NEW |