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 "ash/mus/non_client_frame_controller.h" | 5 #include "ash/mus/non_client_frame_controller.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void UpdateWindowTitle() override {} | 105 void UpdateWindowTitle() override {} |
106 void SizeConstraintsChanged() override {} | 106 void SizeConstraintsChanged() override {} |
107 | 107 |
108 private: | 108 private: |
109 DISALLOW_COPY_AND_ASSIGN(EmptyDraggableNonClientFrameView); | 109 DISALLOW_COPY_AND_ASSIGN(EmptyDraggableNonClientFrameView); |
110 }; | 110 }; |
111 | 111 |
112 class WmNativeWidgetMus : public views::NativeWidgetMus { | 112 class WmNativeWidgetMus : public views::NativeWidgetMus { |
113 public: | 113 public: |
114 WmNativeWidgetMus(views::internal::NativeWidgetDelegate* delegate, | 114 WmNativeWidgetMus(views::internal::NativeWidgetDelegate* delegate, |
115 shell::Connector* connector, | |
116 ui::Window* window, | 115 ui::Window* window, |
117 ui::WindowManagerClient* window_manager_client) | 116 ui::WindowManagerClient* window_manager_client) |
118 : NativeWidgetMus(delegate, | 117 : NativeWidgetMus(delegate, window, ui::mojom::SurfaceType::UNDERLAY), |
119 connector, | |
120 window, | |
121 ui::mojom::SurfaceType::UNDERLAY), | |
122 window_manager_client_(window_manager_client) {} | 118 window_manager_client_(window_manager_client) {} |
123 ~WmNativeWidgetMus() override {} | 119 ~WmNativeWidgetMus() override {} |
124 | 120 |
125 // NativeWidgetMus: | 121 // NativeWidgetMus: |
126 views::NonClientFrameView* CreateNonClientFrameView() override { | 122 views::NonClientFrameView* CreateNonClientFrameView() override { |
127 move_event_handler_.reset(new MoveEventHandler( | 123 move_event_handler_.reset(new MoveEventHandler( |
128 window(), window_manager_client_, GetNativeView())); | 124 window(), window_manager_client_, GetNativeView())); |
129 if (ShouldRemoveStandardFrame(window())) | 125 if (ShouldRemoveStandardFrame(window())) |
130 return new EmptyDraggableNonClientFrameView(); | 126 return new EmptyDraggableNonClientFrameView(); |
131 return new NonClientFrameViewMash(GetWidget(), window()); | 127 return new NonClientFrameViewMash(GetWidget(), window()); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 227 |
232 // To simplify things this code creates a Widget. While a Widget is created | 228 // To simplify things this code creates a Widget. While a Widget is created |
233 // we need to ensure we don't inadvertently change random properties of the | 229 // we need to ensure we don't inadvertently change random properties of the |
234 // underlying ui::Window. For example, showing the Widget shouldn't change | 230 // underlying ui::Window. For example, showing the Widget shouldn't change |
235 // the bounds of the ui::Window in anyway. | 231 // the bounds of the ui::Window in anyway. |
236 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 232 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
237 // We initiate focus at the mus level, not at the views level. | 233 // We initiate focus at the mus level, not at the views level. |
238 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; | 234 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; |
239 params.delegate = this; | 235 params.delegate = this; |
240 params.native_widget = | 236 params.native_widget = |
241 new WmNativeWidgetMus(widget_, connector, window, window_manager_client); | 237 new WmNativeWidgetMus(widget_, window, window_manager_client); |
242 widget_->Init(params); | 238 widget_->Init(params); |
243 | 239 |
244 parent->AddChild(window); | 240 parent->AddChild(window); |
245 | 241 |
246 widget_->ShowInactive(); | 242 widget_->ShowInactive(); |
247 | 243 |
248 const int shadow_inset = | 244 const int shadow_inset = |
249 Shadow::GetInteriorInsetForStyle(Shadow::STYLE_ACTIVE); | 245 Shadow::GetInteriorInsetForStyle(Shadow::STYLE_ACTIVE); |
250 const gfx::Insets extended_hit_region = | 246 const gfx::Insets extended_hit_region = |
251 wm_window->ShouldUseExtendedHitRegion() | 247 wm_window->ShouldUseExtendedHitRegion() |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 324 } |
329 } | 325 } |
330 | 326 |
331 void NonClientFrameController::OnWindowDestroyed(ui::Window* window) { | 327 void NonClientFrameController::OnWindowDestroyed(ui::Window* window) { |
332 window_->RemoveObserver(this); | 328 window_->RemoveObserver(this); |
333 window_ = nullptr; | 329 window_ = nullptr; |
334 } | 330 } |
335 | 331 |
336 } // namespace mus | 332 } // namespace mus |
337 } // namespace ash | 333 } // namespace ash |
OLD | NEW |