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

Unified Diff: mojo/services/launcher/launcher.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader 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
« no previous file with comments | « mojo/services/html_viewer/html_viewer.cc ('k') | mojo/services/native_viewport/native_viewport_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/launcher/launcher.cc
diff --git a/mojo/services/launcher/launcher.cc b/mojo/services/launcher/launcher.cc
index 76d4d8f68f8c2bcf149fac9417c190ec2a33dff7..374d91222b1da1a32833742aab95fb1e7bd60b91 100644
--- a/mojo/services/launcher/launcher.cc
+++ b/mojo/services/launcher/launcher.cc
@@ -10,6 +10,7 @@
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/application/interface_factory_with_context.h"
#include "mojo/services/public/cpp/view_manager/types.h"
#include "mojo/services/public/interfaces/launcher/launcher.mojom.h"
#include "mojo/services/public/interfaces/network/network_service.mojom.h"
@@ -30,8 +31,7 @@ class LauncherApp;
class LauncherConnection : public InterfaceImpl<Launcher> {
public:
- LauncherConnection(ApplicationConnection* connection, LauncherApp* app)
- : app_(app) {}
+ explicit LauncherConnection(LauncherApp* app) : app_(app) {}
virtual ~LauncherConnection() {}
private:
@@ -86,9 +86,11 @@ class LaunchInstance {
DISALLOW_COPY_AND_ASSIGN(LaunchInstance);
};
-class LauncherApp : public ApplicationDelegate {
+class LauncherApp
+ : public ApplicationDelegate,
+ public InterfaceFactoryWithContext<LauncherConnection, LauncherApp> {
public:
- LauncherApp() {
+ LauncherApp() : InterfaceFactoryWithContext(this) {
handler_map_["text/html"] = "mojo:mojo_html_viewer";
handler_map_["image/png"] = "mojo:mojo_media_viewer";
}
@@ -115,7 +117,7 @@ class LauncherApp : public ApplicationDelegate {
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
MOJO_OVERRIDE {
- connection->AddService<LauncherConnection>(this);
+ connection->AddService(this);
return true;
}
« no previous file with comments | « mojo/services/html_viewer/html_viewer.cc ('k') | mojo/services/native_viewport/native_viewport_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698