summaryrefslogtreecommitdiffstats
path: root/components/clipboard/main.cc
diff options
context:
space:
mode:
authorsky <sky@chromium.org>2015-04-20 16:44:51 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-20 23:45:39 +0000
commit8327ac08ec2c80f26c73a83b75a66eae7b27e3cc (patch)
treea68b6bbfba04c1fa98f081533a7100847d834d0d /components/clipboard/main.cc
parent638ab71c6b28552e6adb7fd195ce50195b24725a (diff)
downloadchromium_src-8327ac08ec2c80f26c73a83b75a66eae7b27e3cc.zip
chromium_src-8327ac08ec2c80f26c73a83b75a66eae7b27e3cc.tar.gz
chromium_src-8327ac08ec2c80f26c73a83b75a66eae7b27e3cc.tar.bz2
Moves mojo/services/* to components/* part 1
I'm splitting this up in chunks so I can actually use the cq. R=ben@chromium.org Review URL: https://codereview.chromium.org/1097183002 Cr-Commit-Position: refs/heads/master@{#325942}
Diffstat (limited to 'components/clipboard/main.cc')
-rw-r--r--components/clipboard/main.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/components/clipboard/main.cc b/components/clipboard/main.cc
new file mode 100644
index 0000000..75667d1
--- /dev/null
+++ b/components/clipboard/main.cc
@@ -0,0 +1,37 @@
+// Copyright 2014 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 "components/clipboard/clipboard_standalone_impl.h"
+#include "mojo/application/application_runner_chromium.h"
+#include "third_party/mojo/src/mojo/public/c/system/main.h"
+#include "third_party/mojo/src/mojo/public/cpp/application/application_connection.h"
+#include "third_party/mojo/src/mojo/public/cpp/application/application_delegate.h"
+#include "third_party/mojo/src/mojo/public/cpp/application/interface_factory.h"
+
+class Delegate : public mojo::ApplicationDelegate,
+ public mojo::InterfaceFactory<mojo::Clipboard> {
+ public:
+ Delegate() {}
+ ~Delegate() override {}
+
+ // mojo::ApplicationDelegate implementation.
+ bool ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) override {
+ connection->AddService(this);
+ return true;
+ }
+
+ // mojo::InterfaceFactory<mojo::Clipboard> implementation.
+ void Create(mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<mojo::Clipboard> request) override {
+ // TODO(erg): Write native implementations of the clipboard. For now, we
+ // just build a clipboard which doesn't interact with the system.
+ new clipboard::ClipboardStandaloneImpl(request.Pass());
+ }
+};
+
+MojoResult MojoMain(MojoHandle shell_handle) {
+ mojo::ApplicationRunnerChromium runner(new Delegate);
+ return runner.Run(shell_handle);
+}