OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "mojo/services/view_manager/root_view_manager.h" | 5 #include "mojo/services/view_manager/root_view_manager.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "mojo/aura/screen_mojo.h" | 8 #include "mojo/aura/screen_mojo.h" |
9 #include "mojo/aura/window_tree_host_mojo.h" | |
10 #include "mojo/public/cpp/application/connect.h" | 9 #include "mojo/public/cpp/application/connect.h" |
11 #include "mojo/services/view_manager/root_node_manager.h" | 10 #include "mojo/services/view_manager/root_node_manager.h" |
12 #include "mojo/services/view_manager/root_view_manager_delegate.h" | 11 #include "mojo/services/view_manager/root_view_manager_delegate.h" |
| 12 #include "mojo/services/view_manager/window_tree_host_impl.h" |
13 #include "ui/aura/client/default_capture_client.h" | 13 #include "ui/aura/client/default_capture_client.h" |
14 #include "ui/aura/client/window_tree_client.h" | 14 #include "ui/aura/client/window_tree_client.h" |
15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace view_manager { | 18 namespace view_manager { |
19 namespace service { | 19 namespace service { |
20 | 20 |
21 class WindowTreeClientImpl : public aura::client::WindowTreeClient { | 21 class WindowTreeClientImpl : public aura::client::WindowTreeClient { |
22 public: | 22 public: |
(...skipping 29 matching lines...) Expand all Loading... |
52 RootViewManagerDelegate* delegate) | 52 RootViewManagerDelegate* delegate) |
53 : delegate_(delegate), | 53 : delegate_(delegate), |
54 root_node_manager_(root_node), | 54 root_node_manager_(root_node), |
55 in_setup_(false) { | 55 in_setup_(false) { |
56 screen_.reset(ScreenMojo::Create()); | 56 screen_.reset(ScreenMojo::Create()); |
57 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 57 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
58 NativeViewportPtr viewport; | 58 NativeViewportPtr viewport; |
59 ConnectToService(service_provider, | 59 ConnectToService(service_provider, |
60 "mojo:mojo_native_viewport_service", | 60 "mojo:mojo_native_viewport_service", |
61 &viewport); | 61 &viewport); |
62 window_tree_host_.reset(new WindowTreeHostMojo( | 62 window_tree_host_.reset(new WindowTreeHostImpl( |
63 viewport.Pass(), | 63 viewport.Pass(), |
64 gfx::Rect(800, 600), | 64 gfx::Rect(800, 600), |
65 base::Bind(&RootViewManager::OnCompositorCreated, | 65 base::Bind(&RootViewManager::OnCompositorCreated, |
66 base::Unretained(this)))); | 66 base::Unretained(this)))); |
67 } | 67 } |
68 | 68 |
69 RootViewManager::~RootViewManager() { | 69 RootViewManager::~RootViewManager() { |
70 window_tree_client_.reset(); | 70 window_tree_client_.reset(); |
71 window_tree_host_.reset(); | 71 window_tree_host_.reset(); |
72 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, NULL); | 72 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, NULL); |
(...skipping 12 matching lines...) Expand all Loading... |
85 new WindowTreeClientImpl(window_tree_host_->window())); | 85 new WindowTreeClientImpl(window_tree_host_->window())); |
86 | 86 |
87 window_tree_host_->Show(); | 87 window_tree_host_->Show(); |
88 | 88 |
89 delegate_->OnRootViewManagerWindowTreeHostCreated(); | 89 delegate_->OnRootViewManagerWindowTreeHostCreated(); |
90 } | 90 } |
91 | 91 |
92 } // namespace service | 92 } // namespace service |
93 } // namespace view_manager | 93 } // namespace view_manager |
94 } // namespace mojo | 94 } // namespace mojo |
OLD | NEW |