Index: mojo/services/html_viewer/mojo_blink_platform_impl.cc |
diff --git a/mojo/services/html_viewer/mojo_blink_platform_impl.cc b/mojo/services/html_viewer/mojo_blink_platform_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3b9dab33e008b1fe393dd97ae5ba39d13c5eb030 |
--- /dev/null |
+++ b/mojo/services/html_viewer/mojo_blink_platform_impl.cc |
@@ -0,0 +1,38 @@ |
+// 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 "mojo/services/html_viewer/mojo_blink_platform_impl.h" |
+ |
+#include "mojo/public/cpp/application/application_impl.h" |
+#include "mojo/services/html_viewer/webclipboard_impl.h" |
+#include "mojo/services/html_viewer/webcookiejar_impl.h" |
+#include "mojo/services/html_viewer/websockethandle_impl.h" |
+#include "mojo/services/html_viewer/weburlloader_impl.h" |
+ |
+namespace mojo { |
+ |
+MojoBlinkPlatformImpl::MojoBlinkPlatformImpl(ApplicationImpl* app) { |
+ app->ConnectToService("mojo:network_service", &network_service_); |
+ |
+ CookieStorePtr cookie_store; |
+ network_service_->GetCookieStore(GetProxy(&cookie_store)); |
+ cookie_jar_.reset(new WebCookieJarImpl(cookie_store.Pass())); |
+ |
+ ClipboardPtr clipboard; |
+ app->ConnectToService("mojo:clipboard", &clipboard); |
+ clipboard_.reset(new WebClipboardImpl(clipboard.Pass())); |
+} |
+ |
+MojoBlinkPlatformImpl::~MojoBlinkPlatformImpl() { |
+} |
+ |
+blink::WebURLLoader* MojoBlinkPlatformImpl::createURLLoader() { |
+ return new WebURLLoaderImpl(network_service_.get()); |
+} |
+ |
+blink::WebSocketHandle* MojoBlinkPlatformImpl::createWebSocketHandle() { |
+ return new WebSocketHandleImpl(network_service_.get()); |
+} |
+ |
+} // namespace mojo |