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

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: specify ownership in the Bind call 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/launcher/launcher.cc
diff --git a/mojo/services/launcher/launcher.cc b/mojo/services/launcher/launcher.cc
index 97a29c3f137042e25ecae8f3c119266cd3ba12b6..e2d6c7604dd0447b5d27ab88716837f02f1c7196 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/context_interface_provider.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 ContextInterfaceProvider<LauncherConnection, LauncherApp> {
public:
- LauncherApp() {
+ LauncherApp() : ContextInterfaceProvider(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->AddServiceProvider(this);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698