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 "components/mus/ws/window_tree_host_impl.h" | 5 #include "components/mus/ws/window_tree_host_impl.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "components/mus/common/types.h" | 8 #include "components/mus/common/types.h" |
9 #include "components/mus/ws/connection_manager.h" | 9 #include "components/mus/ws/connection_manager.h" |
10 #include "components/mus/ws/display_manager.h" | 10 #include "components/mus/ws/display_manager.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void WindowTreeHostImpl::OnDisplayClosed() { | 157 void WindowTreeHostImpl::OnDisplayClosed() { |
158 if (delegate_) | 158 if (delegate_) |
159 delegate_->OnDisplayClosed(); | 159 delegate_->OnDisplayClosed(); |
160 } | 160 } |
161 | 161 |
162 void WindowTreeHostImpl::OnViewportMetricsChanged( | 162 void WindowTreeHostImpl::OnViewportMetricsChanged( |
163 const mojom::ViewportMetrics& old_metrics, | 163 const mojom::ViewportMetrics& old_metrics, |
164 const mojom::ViewportMetrics& new_metrics) { | 164 const mojom::ViewportMetrics& new_metrics) { |
165 if (!root_) { | 165 if (!root_) { |
166 root_.reset(connection_manager_->CreateServerWindow( | 166 root_.reset(connection_manager_->CreateServerWindow( |
167 RootWindowId(connection_manager_->GetAndAdvanceNextHostId()))); | 167 RootWindowId(connection_manager_->GetAndAdvanceNextHostId()), |
| 168 ServerWindow::Properties())); |
168 root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels.To<gfx::Size>())); | 169 root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels.To<gfx::Size>())); |
169 root_->SetVisible(true); | 170 root_->SetVisible(true); |
170 if (delegate_) | 171 if (delegate_) |
171 delegate_->OnDisplayInitialized(); | 172 delegate_->OnDisplayInitialized(); |
172 event_dispatcher_.set_root(root_.get()); | 173 event_dispatcher_.set_root(root_.get()); |
173 } else { | 174 } else { |
174 root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels.To<gfx::Size>())); | 175 root_->SetBounds(gfx::Rect(new_metrics.size_in_pixels.To<gfx::Size>())); |
175 } | 176 } |
176 connection_manager_->ProcessViewportMetricsChanged(old_metrics, new_metrics); | 177 connection_manager_->ProcessViewportMetricsChanged(old_metrics, new_metrics); |
177 } | 178 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 base::Bind(&base::DoNothing)); | 287 base::Bind(&base::DoNothing)); |
287 } | 288 } |
288 | 289 |
289 void WindowTreeHostImpl::OnWindowDestroyed(ServerWindow* window) { | 290 void WindowTreeHostImpl::OnWindowDestroyed(ServerWindow* window) { |
290 windows_needing_frame_destruction_.erase(window); | 291 windows_needing_frame_destruction_.erase(window); |
291 window->RemoveObserver(this); | 292 window->RemoveObserver(this); |
292 } | 293 } |
293 | 294 |
294 } // namespace ws | 295 } // namespace ws |
295 } // namespace mus | 296 } // namespace mus |
OLD | NEW |