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

Unified Diff: services/file_manager/main.cc

Issue 875643004: Prototype of Files service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: wipwipwip Created 5 years, 11 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: services/file_manager/main.cc
diff --git a/services/file_manager/main.cc b/services/file_manager/main.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3aa32e779e97885fd745b07fb95d8dc8f2c17c5b
--- /dev/null
+++ b/services/file_manager/main.cc
@@ -0,0 +1,45 @@
+// Copyright 2015 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.
+
+#include "base/macros.h"
+#include "mojo/application/application_runner_chromium.h"
+#include "mojo/public/c/system/main.h"
+#include "mojo/public/cpp/application/application_connection.h"
+#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/interface_factory.h"
+#include "services/file_manager/file_manager.mojom.h"
+#include "services/file_manager/file_manager_impl.h"
+
+namespace mojo {
+namespace files {
+
+class FileManagerApp : public ApplicationDelegate,
+ public InterfaceFactory<FileManager> {
+ public:
+ FileManagerApp() {}
+ ~FileManagerApp() override {}
+
+ private:
+ // |ApplicationDelegate| override:
+ bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
+ connection->AddService<FileManager>(this);
+ return true;
+ }
+
+ // |InterfaceFactory<FileManager>| implementation:
+ void Create(ApplicationConnection* connection,
+ InterfaceRequest<FileManager> request) override {
+ new FileManagerImpl(connection, request.Pass());
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(FileManagerApp);
+};
+
+} // namespace files
+} // namespace mojo
+
+MojoResult MojoMain(MojoHandle shell_handle) {
+ mojo::ApplicationRunnerChromium runner(new mojo::files::FileManagerApp());
+ return runner.Run(shell_handle);
+}

Powered by Google App Engine
This is Rietveld 408576698