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

Unified Diff: mojo/services/view_manager/main.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: some InterfaceProvider impls for common cases Created 6 years, 5 months 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/main.cc
diff --git a/mojo/services/view_manager/main.cc b/mojo/services/view_manager/main.cc
index d5115055fc772e4b47b3880458051c1d5eb02291..04ca5281cb20101aa2947dc699c5e94e65cd7e2c 100644
--- a/mojo/services/view_manager/main.cc
+++ b/mojo/services/view_manager/main.cc
@@ -10,19 +10,26 @@ namespace mojo {
namespace view_manager {
namespace service {
-class ViewManagerApp : public ApplicationDelegate {
+class ViewManagerApp : public ApplicationDelegate,
+ public InterfaceProvider<ViewManagerInitService> {
public:
ViewManagerApp() {}
virtual ~ViewManagerApp() {}
- virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
- MOJO_OVERRIDE {
+ virtual bool ConfigureIncomingConnection(
+ ApplicationConnection* connection) OVERRIDE {
// TODO(sky): this needs some sort of authentication as well as making sure
// we only ever have one active at a time.
- connection->AddService<ViewManagerInitServiceImpl>();
+ connection->AddServiceProvider(this);
return true;
}
+ virtual void BindToRequest(
+ ApplicationConnection* connection,
+ InterfaceRequest<ViewManagerInitService> request) OVERRIDE {
+ mojo::BindToRequest(new ViewManagerInitServiceImpl(connection), &request);
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(ViewManagerApp);
};

Powered by Google App Engine
This is Rietveld 408576698