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/non_client_frame_controller.h" | 5 #include "mash/wm/non_client_frame_controller.h" |
6 | 6 |
7 #include "components/mus/public/cpp/window.h" | 7 #include "components/mus/public/cpp/window.h" |
8 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 8 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
9 #include "mash/wm/frame/frame_border_hit_test_controller.h" | 9 #include "mash/wm/frame/frame_border_hit_test_controller.h" |
10 #include "mash/wm/frame/move_event_handler.h" | 10 #include "mash/wm/frame/move_event_handler.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 aura::Window* root_window = GetNativeView()->GetHost()->window(); | 110 aura::Window* root_window = GetNativeView()->GetHost()->window(); |
111 move_event_handler_.reset(new MoveEventHandler(window(), GetNativeView())); | 111 move_event_handler_.reset(new MoveEventHandler(window(), GetNativeView())); |
112 root_window->AddPreTargetHandler(move_event_handler_.get()); | 112 root_window->AddPreTargetHandler(move_event_handler_.get()); |
113 return frame_view; | 113 return frame_view; |
114 } | 114 } |
115 void InitNativeWidget(const views::Widget::InitParams& params) override { | 115 void InitNativeWidget(const views::Widget::InitParams& params) override { |
116 views::NativeWidgetMus::InitNativeWidget(params); | 116 views::NativeWidgetMus::InitNativeWidget(params); |
117 aura::WindowTreeHost* window_tree_host = GetNativeView()->GetHost(); | 117 aura::WindowTreeHost* window_tree_host = GetNativeView()->GetHost(); |
118 // TODO(sky): shadow should be determined by window type. | 118 // TODO(sky): shadow should be determined by window type. |
119 shadow_.reset(new Shadow); | 119 shadow_.reset(new Shadow); |
120 shadow_->Init(Shadow::STYLE_ACTIVE); | 120 shadow_->Init(Shadow::STYLE_INACTIVE); |
| 121 SetShadow(window(), shadow_.get()); |
121 ContentWindowLayoutManager* layout_manager = new ContentWindowLayoutManager( | 122 ContentWindowLayoutManager* layout_manager = new ContentWindowLayoutManager( |
122 window_tree_host->window(), ShadowStyle::NORMAL, shadow_.get()); | 123 window_tree_host->window(), ShadowStyle::NORMAL, shadow_.get()); |
123 window_tree_host->window()->SetLayoutManager(layout_manager); | 124 window_tree_host->window()->SetLayoutManager(layout_manager); |
124 const int inset = Shadow::GetInteriorInsetForStyle(Shadow::STYLE_ACTIVE); | 125 const int inset = Shadow::GetInteriorInsetForStyle(Shadow::STYLE_ACTIVE); |
125 window_tree_host->SetOutputSurfacePadding( | 126 window_tree_host->SetOutputSurfacePadding( |
126 gfx::Insets(inset, inset, inset, inset)); | 127 gfx::Insets(inset, inset, inset, inset)); |
127 window_tree_host->window()->layer()->Add(shadow_->layer()); | 128 window_tree_host->window()->layer()->Add(shadow_->layer()); |
128 shadow_->layer()->parent()->StackAtBottom(shadow_->layer()); | 129 shadow_->layer()->parent()->StackAtBottom(shadow_->layer()); |
129 } | 130 } |
130 void CenterWindow(const gfx::Size& size) override { | 131 void CenterWindow(const gfx::Size& size) override { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 widget_->OnSizeConstraintsChanged(); | 216 widget_->OnSizeConstraintsChanged(); |
216 } | 217 } |
217 | 218 |
218 void NonClientFrameController::OnWindowDestroyed(mus::Window* window) { | 219 void NonClientFrameController::OnWindowDestroyed(mus::Window* window) { |
219 window_->RemoveObserver(this); | 220 window_->RemoveObserver(this); |
220 window_ = nullptr; | 221 window_ = nullptr; |
221 } | 222 } |
222 | 223 |
223 } // namespace wm | 224 } // namespace wm |
224 } // namespace mash | 225 } // namespace mash |
OLD | NEW |