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

Unified Diff: mojo/services/view_manager/cpp/view_manager_delegate.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
Index: mojo/services/view_manager/cpp/view_manager_delegate.h
diff --git a/mojo/services/view_manager/cpp/view_manager_delegate.h b/mojo/services/view_manager/cpp/view_manager_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..35775cded561b2089b31d616e7c5ce154733c233
--- /dev/null
+++ b/mojo/services/view_manager/cpp/view_manager_delegate.h
@@ -0,0 +1,52 @@
+// 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 MOJO_SERVICES_VIEW_MANAGER_CPP_VIEW_MANAGER_DELEGATE_H_
+#define MOJO_SERVICES_VIEW_MANAGER_CPP_VIEW_MANAGER_DELEGATE_H_
+
+#include <string>
+
+#include "mojo/public/interfaces/application/service_provider.mojom.h"
+
+namespace mojo {
+
+class View;
+class ViewManager;
+
+// Interface implemented by an application using the view manager.
+class ViewManagerDelegate {
+ public:
+ // Called when the application implementing this interface is embedded at
+ // |root|. Every embed results in a new ViewManager and root View being
+ // created. |root| and it's corresponding ViewManager are valid until
+ // OnViewManagerDisconnected() is called with the same object.
+ //
+ // |services| exposes the services offered by the embedder to the delegate.
+ //
+ // |exposed_services| is an object that the delegate can add services to
+ // expose to the embedder.
+ //
+ // Note that if a different application is subsequently embedded at |root|,
+ // the pipes connecting |services| and |exposed_services| to the embedder and
+ // any services obtained from them are not broken and will continue to be
+ // valid.
+ virtual void OnEmbed(View* root,
+ InterfaceRequest<ServiceProvider> services,
+ ServiceProviderPtr exposed_services) = 0;
+
+ // Called when a connection to the view manager service is closed.
+ // |view_manager| is not valid after this function returns.
+ virtual void OnViewManagerDisconnected(ViewManager* view_manager) = 0;
+
+ // Asks the delegate to perform the specified action.
+ // TODO(sky): nuke! See comments in view_manager.mojom for details.
+ virtual bool OnPerformAction(View* view, const std::string& action);
+
+ protected:
+ virtual ~ViewManagerDelegate() {}
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_VIEW_MANAGER_CPP_VIEW_MANAGER_DELEGATE_H_
« no previous file with comments | « mojo/services/view_manager/cpp/view_manager_context.h ('k') | mojo/services/view_manager/cpp/view_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698