| Index: components/mus/example/wm/window_manager_impl.cc
|
| diff --git a/components/mus/example/wm/window_manager_impl.cc b/components/mus/example/wm/window_manager_impl.cc
|
| index 9525f2602f3d1285e1ec17b92d50920d189a63ea..603947264fb09b2034e4179279ceed5ec6b67c6a 100644
|
| --- a/components/mus/example/wm/window_manager_impl.cc
|
| +++ b/components/mus/example/wm/window_manager_impl.cc
|
| @@ -5,6 +5,7 @@
|
| #include "components/mus/example/wm/window_manager_impl.h"
|
|
|
| #include "components/mus/example/wm/move_loop.h"
|
| +#include "components/mus/example/wm/non_client_frame_controller.h"
|
| #include "components/mus/example/wm/property_util.h"
|
| #include "components/mus/example/wm/public/interfaces/container.mojom.h"
|
| #include "components/mus/example/wm/window_manager_application.h"
|
| @@ -14,6 +15,7 @@
|
| #include "components/mus/public/cpp/window_property.h"
|
| #include "components/mus/public/cpp/window_tree_connection.h"
|
| #include "components/mus/public/interfaces/input_events.mojom.h"
|
| +#include "mojo/application/public/cpp/application_impl.h"
|
| #include "mojo/converters/geometry/geometry_type_converters.h"
|
|
|
| namespace {
|
| @@ -73,6 +75,9 @@ void WindowManagerImpl::OpenWindow(
|
| child_window->Embed(client.Pass());
|
| child_window->AddObserver(this);
|
|
|
| + // NonClientFrameController deletes itself when the window is destroyed.
|
| + new NonClientFrameController(state_->app()->shell(), child_window);
|
| +
|
| state_->IncrementWindowCount();
|
| }
|
|
|
| @@ -105,18 +110,36 @@ void WindowManagerImpl::SetShowState(
|
| callback.Run(mus::mojom::WINDOW_MANAGER_ERROR_CODE_SUCCESS);
|
| }
|
|
|
| -void WindowManagerImpl::GetDisplays(const GetDisplaysCallback& callback) {
|
| - mojo::Array<mus::mojom::DisplayPtr> displays(1);
|
| - displays[0] = mus::mojom::Display::New();
|
| - displays[0]->id = 2001;
|
| - displays[0]->bounds = mojo::Rect::New();
|
| - displays[0]->bounds->y = 0;
|
| - displays[0]->bounds->width = state_->root()->bounds().width();
|
| - displays[0]->bounds->height = state_->root()->bounds().width();
|
| - displays[0]->work_area = displays[0]->bounds.Clone();
|
| - displays[0]->device_pixel_ratio =
|
| +void WindowManagerImpl::GetConfig(const GetConfigCallback& callback) {
|
| + mus::mojom::WindowManagerConfigPtr config(
|
| + mus::mojom::WindowManagerConfig::New());
|
| + config->displays = mojo::Array<mus::mojom::DisplayPtr>::New(1);
|
| + config->displays[0] = mus::mojom::Display::New();
|
| + config->displays[0]->id = 2001;
|
| + config->displays[0]->bounds = mojo::Rect::New();
|
| + config->displays[0]->bounds->y = 0;
|
| + config->displays[0]->bounds->width = state_->root()->bounds().width();
|
| + config->displays[0]->bounds->height = state_->root()->bounds().width();
|
| + config->displays[0]->work_area = config->displays[0]->bounds.Clone();
|
| + config->displays[0]->device_pixel_ratio =
|
| state_->root()->viewport_metrics().device_pixel_ratio;
|
| - callback.Run(displays.Pass());
|
| +
|
| + // The insets are roughly what is needed by CustomFrameView. The expectation
|
| + // is at some point we'll write our own NonClientFrameView and get the insets
|
| + // from it.
|
| + config->normal_client_area_insets = mojo::Insets::New();
|
| + config->normal_client_area_insets->top = 23;
|
| + config->normal_client_area_insets->left = 5;
|
| + config->normal_client_area_insets->right = 5;
|
| + config->normal_client_area_insets->bottom = 5;
|
| +
|
| + config->maximized_client_area_insets = mojo::Insets::New();
|
| + config->maximized_client_area_insets->top = 21;
|
| + config->maximized_client_area_insets->left = 0;
|
| + config->maximized_client_area_insets->right = 0;
|
| + config->maximized_client_area_insets->bottom = 0;
|
| +
|
| + callback.Run(config.Pass());
|
| }
|
|
|
| void WindowManagerImpl::OnWindowDestroyed(mus::Window* window) {
|
|
|