| 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 "base/scoped_observer.h" | 8 #include "base/scoped_observer.h" |
| 9 #include "mojo/public/cpp/application/application_connection.h" | 9 #include "mojo/public/cpp/application/application_connection.h" |
| 10 #include "mojo/services/view_manager/root_node_manager.h" | 10 #include "mojo/services/view_manager/root_node_manager.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 root_node_manager_(root_node), | 123 root_node_manager_(root_node), |
| 124 in_setup_(false) { | 124 in_setup_(false) { |
| 125 screen_.reset(ScreenImpl::Create()); | 125 screen_.reset(ScreenImpl::Create()); |
| 126 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 126 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
| 127 NativeViewportPtr viewport; | 127 NativeViewportPtr viewport; |
| 128 app_connection->ConnectToService( | 128 app_connection->ConnectToService( |
| 129 "mojo:mojo_native_viewport_service", &viewport); | 129 "mojo:mojo_native_viewport_service", &viewport); |
| 130 window_tree_host_.reset(new WindowTreeHostImpl( | 130 window_tree_host_.reset(new WindowTreeHostImpl( |
| 131 viewport.Pass(), | 131 viewport.Pass(), |
| 132 gfx::Rect(800, 600), | 132 gfx::Rect(800, 600), |
| 133 root_node, |
| 133 base::Bind(&RootViewManager::OnCompositorCreated, | 134 base::Bind(&RootViewManager::OnCompositorCreated, |
| 134 base::Unretained(this)))); | 135 base::Unretained(this)))); |
| 135 } | 136 } |
| 136 | 137 |
| 137 RootViewManager::~RootViewManager() { | 138 RootViewManager::~RootViewManager() { |
| 138 window_tree_client_.reset(); | 139 window_tree_client_.reset(); |
| 139 window_tree_host_.reset(); | 140 window_tree_host_.reset(); |
| 140 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, NULL); | 141 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, NULL); |
| 141 } | 142 } |
| 142 | 143 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 158 focus_client_->AddObserver(root_node_manager_); | 159 focus_client_->AddObserver(root_node_manager_); |
| 159 | 160 |
| 160 window_tree_host_->Show(); | 161 window_tree_host_->Show(); |
| 161 | 162 |
| 162 delegate_->OnRootViewManagerWindowTreeHostCreated(); | 163 delegate_->OnRootViewManagerWindowTreeHostCreated(); |
| 163 } | 164 } |
| 164 | 165 |
| 165 } // namespace service | 166 } // namespace service |
| 166 } // namespace view_manager | 167 } // namespace view_manager |
| 167 } // namespace mojo | 168 } // namespace mojo |
| OLD | NEW |