base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON().
[chromium-blink-merge.git] / mojo / services / html_viewer / mojo_blink_platform_impl.cc
blob40419b1ec7ab30c9c3136558ab38d9542aff9a17
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
3 // found in the LICENSE file.
5 #include "mojo/services/html_viewer/mojo_blink_platform_impl.h"
7 #include "mojo/public/cpp/application/application_impl.h"
8 #include "mojo/services/html_viewer/webclipboard_impl.h"
9 #include "mojo/services/html_viewer/webcookiejar_impl.h"
10 #include "mojo/services/html_viewer/websockethandle_impl.h"
11 #include "mojo/services/html_viewer/weburlloader_impl.h"
13 namespace html_viewer {
15 MojoBlinkPlatformImpl::MojoBlinkPlatformImpl(mojo::ApplicationImpl* app) {
16 app->ConnectToService("mojo:network_service", &network_service_);
18 mojo::CookieStorePtr cookie_store;
19 network_service_->GetCookieStore(GetProxy(&cookie_store));
20 cookie_jar_.reset(new WebCookieJarImpl(cookie_store.Pass()));
22 mojo::ClipboardPtr clipboard;
23 app->ConnectToService("mojo:clipboard", &clipboard);
24 clipboard_.reset(new WebClipboardImpl(clipboard.Pass()));
27 MojoBlinkPlatformImpl::~MojoBlinkPlatformImpl() {
30 blink::WebURLLoader* MojoBlinkPlatformImpl::createURLLoader() {
31 return new WebURLLoaderImpl(network_service_.get());
34 blink::WebSocketHandle* MojoBlinkPlatformImpl::createWebSocketHandle() {
35 return new WebSocketHandleImpl(network_service_.get());
38 } // namespace html_viewer