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); |
} |