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

Side by Side 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, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/macros.h"
6 #include "mojo/application/application_runner_chromium.h"
7 #include "mojo/public/c/system/main.h"
8 #include "mojo/public/cpp/application/application_connection.h"
9 #include "mojo/public/cpp/application/application_delegate.h"
10 #include "mojo/public/cpp/application/interface_factory.h"
11 #include "services/file_manager/file_manager.mojom.h"
12 #include "services/file_manager/file_manager_impl.h"
13
14 namespace mojo {
15 namespace files {
16
17 class FileManagerApp : public ApplicationDelegate,
18 public InterfaceFactory<FileManager> {
19 public:
20 FileManagerApp() {}
21 ~FileManagerApp() override {}
22
23 private:
24 // |ApplicationDelegate| override:
25 bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
26 connection->AddService<FileManager>(this);
27 return true;
28 }
29
30 // |InterfaceFactory<FileManager>| implementation:
31 void Create(ApplicationConnection* connection,
32 InterfaceRequest<FileManager> request) override {
33 new FileManagerImpl(connection, request.Pass());
34 }
35
36 DISALLOW_COPY_AND_ASSIGN(FileManagerApp);
37 };
38
39 } // namespace files
40 } // namespace mojo
41
42 MojoResult MojoMain(MojoHandle shell_handle) {
43 mojo::ApplicationRunnerChromium runner(new mojo::files::FileManagerApp());
44 return runner.Run(shell_handle);
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698