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 "mash/wm/window_manager_impl.h" | 5 #include "mash/wm/window_manager_impl.h" |
6 | 6 |
7 #include "components/mus/common/types.h" | 7 #include "components/mus/common/types.h" |
8 #include "components/mus/public/cpp/property_type_converters.h" | 8 #include "components/mus/public/cpp/property_type_converters.h" |
9 #include "components/mus/public/cpp/window.h" | 9 #include "components/mus/public/cpp/window.h" |
10 #include "components/mus/public/cpp/window_property.h" | 10 #include "components/mus/public/cpp/window_property.h" |
11 #include "components/mus/public/cpp/window_tree_connection.h" | 11 #include "components/mus/public/cpp/window_tree_connection.h" |
12 #include "components/mus/public/interfaces/input_events.mojom.h" | 12 #include "components/mus/public/interfaces/input_events.mojom.h" |
13 #include "mash/wm/move_loop.h" | |
14 #include "mash/wm/non_client_frame_controller.h" | 13 #include "mash/wm/non_client_frame_controller.h" |
15 #include "mash/wm/property_util.h" | 14 #include "mash/wm/property_util.h" |
16 #include "mash/wm/public/interfaces/container.mojom.h" | 15 #include "mash/wm/public/interfaces/container.mojom.h" |
17 #include "mash/wm/window_manager_application.h" | 16 #include "mash/wm/window_manager_application.h" |
18 #include "mojo/application/public/cpp/application_impl.h" | 17 #include "mojo/application/public/cpp/application_impl.h" |
19 #include "mojo/converters/geometry/geometry_type_converters.h" | 18 #include "mojo/converters/geometry/geometry_type_converters.h" |
20 | 19 |
21 namespace mojo { | 20 namespace mojo { |
22 | 21 |
23 template <> | 22 template <> |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 config->displays[0]->bounds->y = 0; | 117 config->displays[0]->bounds->y = 0; |
119 config->displays[0]->bounds->width = state_->root()->bounds().width(); | 118 config->displays[0]->bounds->width = state_->root()->bounds().width(); |
120 config->displays[0]->bounds->height = state_->root()->bounds().width(); | 119 config->displays[0]->bounds->height = state_->root()->bounds().width(); |
121 config->displays[0]->work_area = config->displays[0]->bounds.Clone(); | 120 config->displays[0]->work_area = config->displays[0]->bounds.Clone(); |
122 config->displays[0]->device_pixel_ratio = | 121 config->displays[0]->device_pixel_ratio = |
123 state_->root()->viewport_metrics().device_pixel_ratio; | 122 state_->root()->viewport_metrics().device_pixel_ratio; |
124 | 123 |
125 // The insets are roughly what is needed by CustomFrameView. The expectation | 124 // The insets are roughly what is needed by CustomFrameView. The expectation |
126 // is at some point we'll write our own NonClientFrameView and get the insets | 125 // is at some point we'll write our own NonClientFrameView and get the insets |
127 // from it. | 126 // from it. |
128 config->normal_client_area_insets = mojo::Insets::New(); | 127 const gfx::Insets client_area_insets = |
129 config->normal_client_area_insets->top = 23; | 128 NonClientFrameController::GetPreferredClientAreaInsets(); |
130 config->normal_client_area_insets->left = 5; | 129 config->normal_client_area_insets = mojo::Insets::From(client_area_insets); |
131 config->normal_client_area_insets->right = 5; | |
132 config->normal_client_area_insets->bottom = 5; | |
133 | 130 |
134 config->maximized_client_area_insets = mojo::Insets::New(); | 131 config->maximized_client_area_insets = mojo::Insets::From(client_area_insets); |
135 config->maximized_client_area_insets->top = 21; | |
136 config->maximized_client_area_insets->left = 0; | |
137 config->maximized_client_area_insets->right = 0; | |
138 config->maximized_client_area_insets->bottom = 0; | |
139 | 132 |
140 callback.Run(config.Pass()); | 133 callback.Run(config.Pass()); |
141 } | 134 } |
142 | 135 |
143 mus::Window* WindowManagerImpl::GetContainerForChild(mus::Window* child) { | 136 mus::Window* WindowManagerImpl::GetContainerForChild(mus::Window* child) { |
144 mash::wm::mojom::Container container = GetRequestedContainer(child); | 137 mash::wm::mojom::Container container = GetRequestedContainer(child); |
145 return state_->GetWindowForContainer(container); | 138 return state_->GetWindowForContainer(container); |
146 } | 139 } |
OLD | NEW |