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

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

Issue 1975993002: Change InterfaceFactory<I>::Create() to take a ConnectionContext instead of an ApplicationConnectio… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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
« no previous file with comments | « services/authentication/main.cc ('k') | services/device_info/device_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "mojo/application/application_runner_chromium.h" 5 #include "mojo/application/application_runner_chromium.h"
6 #include "mojo/public/c/system/main.h" 6 #include "mojo/public/c/system/main.h"
7 #include "mojo/public/cpp/application/application_connection.h" 7 #include "mojo/public/cpp/application/application_connection.h"
8 #include "mojo/public/cpp/application/application_delegate.h" 8 #include "mojo/public/cpp/application/application_delegate.h"
9 #include "mojo/public/cpp/application/interface_factory.h" 9 #include "mojo/public/cpp/application/interface_factory.h"
10 #include "services/clipboard/clipboard_standalone_impl.h" 10 #include "services/clipboard/clipboard_standalone_impl.h"
11 11
12 class Delegate : public mojo::ApplicationDelegate, 12 class Delegate : public mojo::ApplicationDelegate,
13 public mojo::InterfaceFactory<mojo::Clipboard> { 13 public mojo::InterfaceFactory<mojo::Clipboard> {
14 public: 14 public:
15 Delegate() {} 15 Delegate() {}
16 ~Delegate() override {} 16 ~Delegate() override {}
17 17
18 // mojo::ApplicationDelegate implementation. 18 // mojo::ApplicationDelegate implementation.
19 bool ConfigureIncomingConnection( 19 bool ConfigureIncomingConnection(
20 mojo::ApplicationConnection* connection) override { 20 mojo::ApplicationConnection* connection) override {
21 connection->AddService(this); 21 connection->AddService(this);
22 return true; 22 return true;
23 } 23 }
24 24
25 // mojo::InterfaceFactory<mojo::Clipboard> implementation. 25 // mojo::InterfaceFactory<mojo::Clipboard> implementation.
26 void Create(mojo::ApplicationConnection* connection, 26 void Create(const mojo::ConnectionContext& connection_context,
27 mojo::InterfaceRequest<mojo::Clipboard> request) override { 27 mojo::InterfaceRequest<mojo::Clipboard> request) override {
28 // TODO(erg): Write native implementations of the clipboard. For now, we 28 // TODO(erg): Write native implementations of the clipboard. For now, we
29 // just build a clipboard which doesn't interact with the system. 29 // just build a clipboard which doesn't interact with the system.
30 new clipboard::ClipboardStandaloneImpl(request.Pass()); 30 new clipboard::ClipboardStandaloneImpl(request.Pass());
31 } 31 }
32 }; 32 };
33 33
34 MojoResult MojoMain(MojoHandle application_request) { 34 MojoResult MojoMain(MojoHandle application_request) {
35 mojo::ApplicationRunnerChromium runner(new Delegate); 35 mojo::ApplicationRunnerChromium runner(new Delegate);
36 return runner.Run(application_request); 36 return runner.Run(application_request);
37 } 37 }
OLDNEW
« no previous file with comments | « services/authentication/main.cc ('k') | services/device_info/device_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698