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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 params.parent = parent; | 301 params.parent = parent; |
302 params.context = context; | 302 params.context = context; |
303 // TODO: properly set |params.activatable|. Should key off whether underlying | 303 // TODO: properly set |params.activatable|. Should key off whether underlying |
304 // (mus) window can have focus. | 304 // (mus) window can have focus. |
305 params.delegate = this; | 305 params.delegate = this; |
306 params.bounds = bounds; | 306 params.bounds = bounds; |
307 WmNativeWidgetAura* native_widget = new WmNativeWidgetAura( | 307 WmNativeWidgetAura* native_widget = new WmNativeWidgetAura( |
308 widget_, window_manager_client_, ShouldRemoveStandardFrame(*properties), | 308 widget_, window_manager_client_, ShouldRemoveStandardFrame(*properties), |
309 ShouldEnableImmersive(*properties)); | 309 ShouldEnableImmersive(*properties)); |
310 window_ = native_widget->GetNativeView(); | 310 window_ = native_widget->GetNativeView(); |
| 311 window_->SetProperty(kNonClientFrameControllerKey, this); |
311 window_->SetProperty(kWidgetCreationTypeKey, WidgetCreationType::FOR_CLIENT); | 312 window_->SetProperty(kWidgetCreationTypeKey, WidgetCreationType::FOR_CLIENT); |
312 window_->AddObserver(this); | 313 window_->AddObserver(this); |
313 params.native_widget = native_widget; | 314 params.native_widget = native_widget; |
314 aura::SetWindowType(window_, window_type); | 315 aura::SetWindowType(window_, window_type); |
315 aura::PropertyConverter* property_converter = | 316 aura::PropertyConverter* property_converter = |
316 window_manager->property_converter(); | 317 window_manager->property_converter(); |
317 for (auto& property_pair : *properties) { | 318 for (auto& property_pair : *properties) { |
318 property_converter->SetPropertyFromTransportValue( | 319 property_converter->SetPropertyFromTransportValue( |
319 window_, property_pair.first, &property_pair.second); | 320 window_, property_pair.first, &property_pair.second); |
320 } | 321 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 } | 450 } |
450 } | 451 } |
451 | 452 |
452 void NonClientFrameController::OnWindowDestroyed(aura::Window* window) { | 453 void NonClientFrameController::OnWindowDestroyed(aura::Window* window) { |
453 window_->RemoveObserver(this); | 454 window_->RemoveObserver(this); |
454 window_ = nullptr; | 455 window_ = nullptr; |
455 } | 456 } |
456 | 457 |
457 } // namespace mus | 458 } // namespace mus |
458 } // namespace ash | 459 } // namespace ash |
OLD | NEW |