| 10 | FlutterWindow::~FlutterWindow() {} |
| 11 | |
| 12 | bool FlutterWindow::OnCreate() { |
| 13 | if (!Win32Window::OnCreate()) { |
| 14 | return false; |
| 15 | } |
| 16 | |
| 17 | RECT frame = GetClientArea(); |
| 18 | |
| 19 | // The size here must match the window dimensions to avoid unnecessary surface |
| 20 | // creation / destruction in the startup path. |
| 21 | flutter_controller_ = std::make_unique<flutter::FlutterViewController>( |
| 22 | frame.right - frame.left, frame.bottom - frame.top, project_); |
| 23 | // Ensure that basic setup of the controller was successful. |
| 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { |
| 25 | return false; |
| 26 | } |
| 27 | RegisterPlugins(flutter_controller_->engine()); |
| 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); |
| 29 | return true; |
| 30 | } |
| 31 | |
| 32 | void FlutterWindow::OnDestroy() { |
| 33 | if (flutter_controller_) { |
nothing calls this directly
no test coverage detected