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/platform_view.h" | 5 #include "sky/shell/platform_view.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "sky/shell/shell.h" | 8 #include "sky/shell/shell.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 | 10 |
11 namespace sky { | 11 namespace sky { |
12 namespace shell { | 12 namespace shell { |
13 | 13 |
14 PlatformView::Config::Config() { | 14 PlatformView::Config::Config() { |
15 } | 15 } |
16 | 16 |
17 PlatformView::Config::~Config() { | 17 PlatformView::Config::~Config() { |
18 } | 18 } |
19 | 19 |
20 PlatformView::PlatformView(const PlatformView::Config& config) | 20 PlatformView::PlatformView(const PlatformView::Config& config) |
21 : config_(config), window_(0) { | 21 : config_(config), window_(0) { |
22 } | 22 } |
23 | 23 |
24 PlatformView::~PlatformView() { | 24 PlatformView::~PlatformView() { |
25 } | 25 } |
26 | 26 |
27 void PlatformView::ConnectToViewportObserver( | 27 void PlatformView::ConnectToEngine( |
28 mojo::InterfaceRequest<ViewportObserver> request) { | 28 mojo::InterfaceRequest<SkyEngine> request) { |
29 config_.ui_task_runner->PostTask( | 29 config_.ui_task_runner->PostTask( |
30 FROM_HERE, base::Bind(&UIDelegate::ConnectToViewportObserver, | 30 FROM_HERE, base::Bind(&UIDelegate::ConnectToEngine, |
31 config_.ui_delegate, base::Passed(&request))); | 31 config_.ui_delegate, base::Passed(&request))); |
32 } | 32 } |
33 | 33 |
34 void PlatformView::SurfaceWasCreated() { | 34 void PlatformView::SurfaceWasCreated() { |
35 config_.ui_task_runner->PostTask( | 35 config_.ui_task_runner->PostTask( |
36 FROM_HERE, base::Bind(&UIDelegate::OnAcceleratedWidgetAvailable, | 36 FROM_HERE, base::Bind(&UIDelegate::OnAcceleratedWidgetAvailable, |
37 config_.ui_delegate, window_)); | 37 config_.ui_delegate, window_)); |
38 } | 38 } |
39 | 39 |
40 void PlatformView::SurfaceWasDestroyed() { | 40 void PlatformView::SurfaceWasDestroyed() { |
41 config_.ui_task_runner->PostTask( | 41 config_.ui_task_runner->PostTask( |
42 FROM_HERE, | 42 FROM_HERE, |
43 base::Bind(&UIDelegate::OnOutputSurfaceDestroyed, config_.ui_delegate)); | 43 base::Bind(&UIDelegate::OnOutputSurfaceDestroyed, config_.ui_delegate)); |
44 } | 44 } |
45 | 45 |
46 } // namespace shell | 46 } // namespace shell |
47 } // namespace sky | 47 } // namespace sky |
OLD | NEW |