| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 int NonClientFrameController::GetMaxTitleBarButtonWidth() { | 197 int NonClientFrameController::GetMaxTitleBarButtonWidth() { |
| 198 return NonClientFrameViewMash::GetMaxTitleBarButtonWidth(); | 198 return NonClientFrameViewMash::GetMaxTitleBarButtonWidth(); |
| 199 } | 199 } |
| 200 | 200 |
| 201 NonClientFrameController::NonClientFrameController( | 201 NonClientFrameController::NonClientFrameController( |
| 202 shell::Connector* connector, | 202 shell::Connector* connector, |
| 203 mus::Window* parent, | 203 mus::Window* parent, |
| 204 mus::Window* window, | 204 mus::Window* window, |
| 205 mus::WindowManagerClient* window_manager_client) | 205 mus::WindowManagerClient* window_manager_client) |
| 206 : widget_(new views::Widget), window_(window) { | 206 : widget_(new views::Widget), window_(window) { |
| 207 WmWindowMus::Get(window)->set_widget(widget_); | 207 WmWindowMus::Get(window)->set_widget( |
| 208 widget_, WmWindowMus::WidgetCreationType::FOR_CLIENT); |
| 208 window_->AddObserver(this); | 209 window_->AddObserver(this); |
| 209 | 210 |
| 210 // To simplify things this code creates a Widget. While a Widget is created | 211 // To simplify things this code creates a Widget. While a Widget is created |
| 211 // we need to ensure we don't inadvertently change random properties of the | 212 // we need to ensure we don't inadvertently change random properties of the |
| 212 // underlying mus::Window. For example, showing the Widget shouldn't change | 213 // underlying mus::Window. For example, showing the Widget shouldn't change |
| 213 // the bounds of the mus::Window in anyway. | 214 // the bounds of the mus::Window in anyway. |
| 214 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 215 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| 215 // We initiate focus at the mus level, not at the views level. | 216 // We initiate focus at the mus level, not at the views level. |
| 216 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; | 217 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; |
| 217 params.delegate = this; | 218 params.delegate = this; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } | 305 } |
| 305 } | 306 } |
| 306 | 307 |
| 307 void NonClientFrameController::OnWindowDestroyed(mus::Window* window) { | 308 void NonClientFrameController::OnWindowDestroyed(mus::Window* window) { |
| 308 window_->RemoveObserver(this); | 309 window_->RemoveObserver(this); |
| 309 window_ = nullptr; | 310 window_ = nullptr; |
| 310 } | 311 } |
| 311 | 312 |
| 312 } // namespace wm | 313 } // namespace wm |
| 313 } // namespace mash | 314 } // namespace mash |
| OLD | NEW |