| 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/example/wm/window_manager_impl.h" | 5 #include "components/mus/example/wm/window_manager_impl.h" |
| 6 | 6 |
| 7 #include "components/mus/example/wm/container.h" | 7 #include "components/mus/example/wm/container.h" |
| 8 #include "components/mus/example/wm/window_manager_application.h" | 8 #include "components/mus/example/wm/window_manager_application.h" |
| 9 #include "components/mus/public/cpp/types.h" | 9 #include "components/mus/public/cpp/types.h" |
| 10 #include "components/mus/public/cpp/view.h" | 10 #include "components/mus/public/cpp/view.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 container_view->AddChild(child_view); | 48 container_view->AddChild(child_view); |
| 49 child_view->Embed(client.Pass()); | 49 child_view->Embed(client.Pass()); |
| 50 | 50 |
| 51 state_->IncrementWindowCount(); | 51 state_->IncrementWindowCount(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void WindowManagerImpl::CenterWindow(uint32_t view_id, mojo::SizePtr size) { | 54 void WindowManagerImpl::CenterWindow(uint32_t view_id, mojo::SizePtr size) { |
| 55 // TODO(beng): | 55 // TODO(beng): |
| 56 } | 56 } |
| 57 | 57 |
| 58 void WindowManagerImpl::GetDisplays(const GetDisplaysCallback& callback) { |
| 59 mojo::Array<mus::mojom::DisplayPtr> displays(1); |
| 60 displays[0] = mus::mojom::Display::New(); |
| 61 displays[0]->id = 2001; |
| 62 displays[0]->bounds = mojo::Rect::New(); |
| 63 displays[0]->bounds->y = 0; |
| 64 displays[0]->bounds->width = state_->root()->bounds().width; |
| 65 displays[0]->bounds->height = state_->root()->bounds().width; |
| 66 displays[0]->work_area = displays[0]->bounds.Clone(); |
| 67 displays[0]->device_pixel_ratio = |
| 68 state_->root()->viewport_metrics().device_pixel_ratio; |
| 69 callback.Run(displays.Pass()); |
| 70 } |
| OLD | NEW |