OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "sky/shell/ui/platform_impl.h" | 5 #include "sky/shell/ui/platform_impl.h" |
6 | 6 |
| 7 #include "mojo/public/cpp/application/connect.h" |
| 8 |
7 namespace sky { | 9 namespace sky { |
8 namespace shell { | 10 namespace shell { |
9 | 11 |
10 PlatformImpl::PlatformImpl() | 12 PlatformImpl::PlatformImpl(mojo::ServiceProviderPtr service_provider) |
11 : main_thread_task_runner_(base::MessageLoop::current()->task_runner()) { | 13 : main_thread_task_runner_(base::MessageLoop::current()->task_runner()), |
| 14 service_provider_(service_provider.Pass()) { |
| 15 mojo::ConnectToService(service_provider_.get(), &network_service_); |
12 } | 16 } |
13 | 17 |
14 PlatformImpl::~PlatformImpl() { | 18 PlatformImpl::~PlatformImpl() { |
15 } | 19 } |
16 | 20 |
17 blink::WebString PlatformImpl::defaultLocale() { | 21 blink::WebString PlatformImpl::defaultLocale() { |
18 return blink::WebString::fromUTF8("en-US"); | 22 return blink::WebString::fromUTF8("en-US"); |
19 } | 23 } |
20 | 24 |
21 base::SingleThreadTaskRunner* PlatformImpl::mainThreadTaskRunner() { | 25 base::SingleThreadTaskRunner* PlatformImpl::mainThreadTaskRunner() { |
22 return main_thread_task_runner_.get(); | 26 return main_thread_task_runner_.get(); |
23 } | 27 } |
24 | 28 |
| 29 mojo::NetworkService* PlatformImpl::networkService() { |
| 30 return network_service_.get(); |
| 31 } |
| 32 |
25 } // namespace shell | 33 } // namespace shell |
26 } // namespace sky | 34 } // namespace sky |
OLD | NEW |