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

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: convert everything over, remove ApplicationConnection::AddService 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..06c2003750253b15a5b68756d3ef80a3cb620e73 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 InterfaceFactory<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->AddServiceFactory(this);
return true;
}
+ virtual void Create(
+ 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