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

Unified Diff: mojo/services/clipboard/main.cc

Issue 562483002: mojo: Create a basic clipboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes to the gn files. Created 6 years, 3 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
« no previous file with comments | « mojo/services/clipboard/clipboard_standalone_unittest.cc ('k') | mojo/services/html_viewer/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/clipboard/main.cc
diff --git a/mojo/services/network/main.cc b/mojo/services/clipboard/main.cc
similarity index 58%
copy from mojo/services/network/main.cc
copy to mojo/services/clipboard/main.cc
index 8d637acf4f62ccf3dc69d9ff3f1bf4c103b3bef2..423aca0bbaa979eabdb2962cc408242530a208eb 100644
--- a/mojo/services/network/main.cc
+++ b/mojo/services/clipboard/main.cc
@@ -14,43 +14,32 @@
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/interface_factory.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"
-#include "mojo/services/network/network_context.h"
-#include "mojo/services/network/network_service_impl.h"
+#include "mojo/services/clipboard/clipboard_standalone_impl.h"
class Delegate : public mojo::ApplicationDelegate,
- public mojo::InterfaceFactory<mojo::NetworkService> {
+ public mojo::InterfaceFactory<mojo::Clipboard> {
public:
Delegate() {}
-
- virtual void Initialize(mojo::ApplicationImpl* app) OVERRIDE {
- base::FilePath base_path;
- CHECK(PathService::Get(base::DIR_TEMP, &base_path));
- base_path = base_path.Append(FILE_PATH_LITERAL("network_service"));
- context_.reset(new mojo::NetworkContext(base_path));
- }
+ virtual ~Delegate() {}
// mojo::ApplicationDelegate implementation.
virtual bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) OVERRIDE {
- DCHECK(context_);
connection->AddService(this);
return true;
}
- // mojo::InterfaceFactory<mojo::NetworkService> implementation.
+ // mojo::InterfaceFactory<mojo::Clipboard> implementation.
virtual void Create(
mojo::ApplicationConnection* connection,
- mojo::InterfaceRequest<mojo::NetworkService> request) OVERRIDE {
- mojo::BindToRequest(
- new mojo::NetworkServiceImpl(connection, context_.get()), &request);
+ 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.
+ mojo::BindToRequest(new mojo::ClipboardStandaloneImpl(), &request);
}
-
- private:
- scoped_ptr<mojo::NetworkContext> context_;
};
MojoResult MojoMain(MojoHandle shell_handle) {
mojo::ApplicationRunnerChromium runner(new Delegate);
- runner.set_message_loop_type(base::MessageLoop::TYPE_IO);
return runner.Run(shell_handle);
}
« no previous file with comments | « mojo/services/clipboard/clipboard_standalone_unittest.cc ('k') | mojo/services/html_viewer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698