Index: ash/mus/wm/window_manager_impl.cc |
diff --git a/mash/wm/window_manager_impl.cc b/ash/mus/wm/window_manager_impl.cc |
similarity index 79% |
copy from mash/wm/window_manager_impl.cc |
copy to ash/mus/wm/window_manager_impl.cc |
index ad225248af0599f232105f14c10e3a270bdfd8c2..f7883a1262c5ba959d66ecb851bc9c98ee4fe668 100644 |
--- a/mash/wm/window_manager_impl.cc |
+++ b/ash/mus/wm/window_manager_impl.cc |
@@ -2,11 +2,13 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "mash/wm/window_manager_impl.h" |
+#include "ash/mus/wm/window_manager_impl.h" |
#include <stdint.h> |
#include <utility> |
+#include "ash/mus/wm/non_client_frame_controller.h" |
+#include "ash/mus/wm/window_manager_application.h" |
#include "components/mus/common/types.h" |
#include "components/mus/public/cpp/window.h" |
#include "components/mus/public/cpp/window_property.h" |
@@ -14,15 +16,11 @@ |
#include "components/mus/public/interfaces/input_events.mojom.h" |
#include "components/mus/public/interfaces/mus_constants.mojom.h" |
#include "components/mus/public/interfaces/window_manager.mojom.h" |
-#include "mash/wm/non_client_frame_controller.h" |
-#include "mash/wm/property_util.h" |
-#include "mash/wm/public/interfaces/container.mojom.h" |
-#include "mash/wm/window_manager_application.h" |
#include "mojo/converters/geometry/geometry_type_converters.h" |
#include "mojo/shell/public/cpp/application_impl.h" |
-namespace mash { |
-namespace wm { |
+namespace ash { |
+namespace muswm { |
WindowManagerImpl::WindowManagerImpl() |
: state_(nullptr), window_manager_client_(nullptr) {} |
@@ -48,19 +46,12 @@ void WindowManagerImpl::Initialize(WindowManagerApplication* state) { |
child->AddObserver(this); |
} |
- // 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. |
+ // XXX(sad): satiate the WS |
mus::mojom::FrameDecorationValuesPtr frame_decoration_values = |
mus::mojom::FrameDecorationValues::New(); |
- const gfx::Insets client_area_insets = |
- NonClientFrameController::GetPreferredClientAreaInsets(); |
- frame_decoration_values->normal_client_area_insets = |
- mojo::Insets::From(client_area_insets); |
- frame_decoration_values->maximized_client_area_insets = |
- mojo::Insets::From(client_area_insets); |
- frame_decoration_values->max_title_bar_button_width = |
- NonClientFrameController::GetMaxTitleBarButtonWidth(); |
+ frame_decoration_values->normal_client_area_insets = mojo::Insets::New(); |
+ frame_decoration_values->maximized_client_area_insets = mojo::Insets::New(); |
+ frame_decoration_values->max_title_bar_button_width = 0u; |
window_manager_client_->SetFrameDecorationValues( |
std::move(frame_decoration_values)); |
} |
@@ -68,7 +59,7 @@ void WindowManagerImpl::Initialize(WindowManagerApplication* state) { |
gfx::Rect WindowManagerImpl::CalculateDefaultBounds(mus::Window* window) const { |
DCHECK(state_); |
int width, height; |
- const gfx::Size pref = GetWindowPreferredSize(window); |
+ const gfx::Size pref = gfx::Size(); |
const mus::Window* root = state_->root(); |
if (pref.IsEmpty()) { |
width = root->bounds().width() - 240; |
@@ -95,8 +86,7 @@ mus::Window* WindowManagerImpl::NewTopLevelWindow( |
mus::Window* root = state_->root(); |
DCHECK(root); |
- const bool provide_non_client_frame = |
- GetWindowType(*properties) == mus::mojom::WindowType::WINDOW; |
+ const bool provide_non_client_frame = true; // XXX(sad): |
if (provide_non_client_frame) |
(*properties)[mus::mojom::kWaitForUnderlay_Property].clear(); |
@@ -104,16 +94,15 @@ mus::Window* WindowManagerImpl::NewTopLevelWindow( |
mus::Window* window = root->connection()->NewWindow(properties); |
window->SetBounds(CalculateDefaultBounds(window)); |
- mojom::Container container = GetRequestedContainer(window); |
- state_->GetWindowForContainer(container)->AddChild(window); |
+ state_->root()->AddChild(window); |
if (client) |
window->Embed(std::move(client)); |
- |
if (provide_non_client_frame) { |
// NonClientFrameController deletes itself when |window| is destroyed. |
new NonClientFrameController(state_->app()->shell(), window, |
- state_->window_tree_host()); |
+ state_->window_tree_host(), |
+ state_->aura_root()); |
} |
state_->IncrementWindowCount(); |
@@ -123,10 +112,12 @@ mus::Window* WindowManagerImpl::NewTopLevelWindow( |
void WindowManagerImpl::OnTreeChanging(const TreeChangeParams& params) { |
DCHECK(state_); |
+#if 0 |
if (state_->WindowIsContainer(params.old_parent)) |
params.target->RemoveObserver(this); |
else if (state_->WindowIsContainer(params.new_parent)) |
params.target->AddObserver(this); |
+#endif |
} |
void WindowManagerImpl::OnWindowEmbeddedAppDisconnected(mus::Window* window) { |
@@ -168,5 +159,5 @@ mus::Window* WindowManagerImpl::OnWmCreateTopLevelWindow( |
return NewTopLevelWindow(properties, nullptr); |
} |
-} // namespace wm |
-} // namespace mash |
+} // namespace muswm |
+} // namespace ash |