Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Unified Diff: services/window_manager/window_manager_impl.h

Issue 1536713004: Revert "Delete the ViewManager and WindowManager services." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/window_manager/window_manager_delegate.h ('k') | services/window_manager/window_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/window_manager/window_manager_impl.h
diff --git a/services/window_manager/window_manager_impl.h b/services/window_manager/window_manager_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..bf0c0ac975c3931eec2271d7424ed6d14b5d9304
--- /dev/null
+++ b/services/window_manager/window_manager_impl.h
@@ -0,0 +1,63 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_IMPL_H_
+#define SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_IMPL_H_
+
+#include "base/logging.h"
+#include "base/macros.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/services/view_manager/cpp/types.h"
+#include "mojo/services/window_manager/interfaces/window_manager.mojom.h"
+
+namespace window_manager {
+
+class WindowManagerRoot;
+
+class WindowManagerImpl : public mojo::WindowManager {
+ public:
+ // WindowManagerImpl is fully owned by WindowManagerRoot.
+ // |from_vm| is set to true when this service is connected from a view
+ // manager.
+ WindowManagerImpl(WindowManagerRoot* window_manager,
+ mojo::ScopedMessagePipeHandle window_manager_pipe,
+ bool from_vm);
+ ~WindowManagerImpl() override;
+
+ void NotifyViewFocused(mojo::Id focused_id);
+ void NotifyWindowActivated(mojo::Id active_id);
+ void NotifyCaptureChanged(mojo::Id capture_id);
+
+ private:
+ // mojo::WindowManager:
+ void Embed(const mojo::String& url,
+ mojo::InterfaceRequest<mojo::ServiceProvider> services,
+ mojo::ServiceProviderPtr exposed_services) override;
+ void SetCapture(uint32_t view_id,
+ const mojo::Callback<void(bool)>& callback) override;
+ void FocusWindow(uint32_t view_id,
+ const mojo::Callback<void(bool)>& callback) override;
+ void ActivateWindow(uint32_t view_id,
+ const mojo::Callback<void(bool)>& callback) override;
+ void GetFocusedAndActiveViews(
+ mojo::WindowManagerObserverPtr observer,
+ const mojo::WindowManager::GetFocusedAndActiveViewsCallback& callback)
+ override;
+
+ WindowManagerRoot* window_manager_;
+
+ // Whether this connection originated from the ViewManager. Connections that
+ // originate from the view manager are expected to have clients. Connections
+ // that don't originate from the view manager do not have clients.
+ const bool from_vm_;
+
+ mojo::Binding<mojo::WindowManager> binding_;
+ mojo::WindowManagerObserverPtr observer_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowManagerImpl);
+};
+
+} // namespace window_manager
+
+#endif // SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_IMPL_H_
« no previous file with comments | « services/window_manager/window_manager_delegate.h ('k') | services/window_manager/window_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698