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

Side by Side Diff: components/clipboard/main.cc

Issue 1115363002: mojo: Use ContentHandlers to bundle multiple Applications into a module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename redirect -> alias Created 5 years, 7 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/clipboard/clipboard_standalone_impl.h" 5 #include "components/clipboard/clipboard_application_delegate.h"
6 #include "mojo/application/application_runner_chromium.h" 6 #include "mojo/application/application_runner_chromium.h"
7 #include "third_party/mojo/src/mojo/public/c/system/main.h" 7 #include "third_party/mojo/src/mojo/public/c/system/main.h"
8 #include "third_party/mojo/src/mojo/public/cpp/application/application_connectio n.h"
9 #include "third_party/mojo/src/mojo/public/cpp/application/application_delegate. h"
10 #include "third_party/mojo/src/mojo/public/cpp/application/interface_factory.h"
11
12 class Delegate : public mojo::ApplicationDelegate,
13 public mojo::InterfaceFactory<mojo::Clipboard> {
14 public:
15 Delegate() {}
16 ~Delegate() override {}
17
18 // mojo::ApplicationDelegate implementation.
19 bool ConfigureIncomingConnection(
20 mojo::ApplicationConnection* connection) override {
21 connection->AddService(this);
22 return true;
23 }
24
25 // mojo::InterfaceFactory<mojo::Clipboard> implementation.
26 void Create(mojo::ApplicationConnection* connection,
27 mojo::InterfaceRequest<mojo::Clipboard> request) override {
28 // TODO(erg): Write native implementations of the clipboard. For now, we
29 // just build a clipboard which doesn't interact with the system.
30 new clipboard::ClipboardStandaloneImpl(request.Pass());
31 }
32 };
33 8
34 MojoResult MojoMain(MojoHandle shell_handle) { 9 MojoResult MojoMain(MojoHandle shell_handle) {
35 mojo::ApplicationRunnerChromium runner(new Delegate); 10 mojo::ApplicationRunnerChromium runner(
11 new clipboard::ClipboardApplicationDelegate);
36 return runner.Run(shell_handle); 12 return runner.Run(shell_handle);
37 } 13 }
OLDNEW
« no previous file with comments | « components/clipboard/clipboard_application_delegate.cc ('k') | components/core_services/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698