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, |
119 connector, | |
120 window, | 118 window, |
121 ::ui::mojom::SurfaceType::UNDERLAY), | 119 ::ui::mojom::SurfaceType::UNDERLAY), |
122 window_manager_client_(window_manager_client) {} | 120 window_manager_client_(window_manager_client) {} |
123 ~WmNativeWidgetMus() override {} | 121 ~WmNativeWidgetMus() override {} |
124 | 122 |
125 // NativeWidgetMus: | 123 // NativeWidgetMus: |
126 views::NonClientFrameView* CreateNonClientFrameView() override { | 124 views::NonClientFrameView* CreateNonClientFrameView() override { |
127 move_event_handler_.reset(new MoveEventHandler( | 125 move_event_handler_.reset(new MoveEventHandler( |
128 window(), window_manager_client_, GetNativeView())); | 126 window(), window_manager_client_, GetNativeView())); |
129 if (ShouldRemoveStandardFrame(window())) | 127 if (ShouldRemoveStandardFrame(window())) |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 229 |
232 // To simplify things this code creates a Widget. While a Widget is created | 230 // 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 | 231 // 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 | 232 // underlying ui::Window. For example, showing the Widget shouldn't change |
235 // the bounds of the ui::Window in anyway. | 233 // the bounds of the ui::Window in anyway. |
236 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 234 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
237 // We initiate focus at the mus level, not at the views level. | 235 // We initiate focus at the mus level, not at the views level. |
238 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; | 236 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; |
239 params.delegate = this; | 237 params.delegate = this; |
240 params.native_widget = | 238 params.native_widget = |
241 new WmNativeWidgetMus(widget_, connector, window, window_manager_client); | 239 new WmNativeWidgetMus(widget_, window, window_manager_client); |
242 widget_->Init(params); | 240 widget_->Init(params); |
243 | 241 |
244 parent->AddChild(window); | 242 parent->AddChild(window); |
245 | 243 |
246 widget_->ShowInactive(); | 244 widget_->ShowInactive(); |
247 | 245 |
248 const int shadow_inset = | 246 const int shadow_inset = |
249 Shadow::GetInteriorInsetForStyle(Shadow::STYLE_ACTIVE); | 247 Shadow::GetInteriorInsetForStyle(Shadow::STYLE_ACTIVE); |
250 const gfx::Insets extended_hit_region = | 248 const gfx::Insets extended_hit_region = |
251 wm_window->ShouldUseExtendedHitRegion() | 249 wm_window->ShouldUseExtendedHitRegion() |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 327 } |
330 } | 328 } |
331 | 329 |
332 void NonClientFrameController::OnWindowDestroyed(::ui::Window* window) { | 330 void NonClientFrameController::OnWindowDestroyed(::ui::Window* window) { |
333 window_->RemoveObserver(this); | 331 window_->RemoveObserver(this); |
334 window_ = nullptr; | 332 window_ = nullptr; |
335 } | 333 } |
336 | 334 |
337 } // namespace mus | 335 } // namespace mus |
338 } // namespace ash | 336 } // namespace ash |
OLD | NEW |