| Flutter Windows Embedder |

flutter_windows_view_controller.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_VIEW_CONTROLLER_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_VIEW_CONTROLLER_H_
7
8 #include <memory>
9
10 #include "flutter_windows_engine.h"
11 #include "flutter_windows_view.h"
12
13 namespace flutter {
14
15 /// Controls a view that displays Flutter content.
16 class FlutterWindowsViewController {
17 public:
18 FlutterWindowsViewController(std::unique_ptr<FlutterWindowsEngine> engine,
19 std::unique_ptr<FlutterWindowsView> view)
20 : engine_(std::move(engine)), view_(std::move(view)) {}
21
22 FlutterWindowsEngine* engine() { return view_->GetEngine(); }
23 FlutterWindowsView* view() { return view_.get(); }
24
25 private:
26 // The engine owned by this view controller, if any.
27 //
28 // This is used only if the view controller was created
29 // using |FlutterDesktopViewControllerCreate| as that takes
30 // ownership of the engine. Destroying this view controller
31 // also destroys the engine.
32 //
33 // View controllers created using |FlutterDesktopEngineCreateViewController|
34 // do not take ownership of the engine and this will be null. Destroying
35 // this view controller does not destroy the engine.
36 std::unique_ptr<FlutterWindowsEngine> engine_;
37
38 std::unique_ptr<FlutterWindowsView> view_;
39 };
40
41 } // namespace flutter
42
43 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_WINDOWS_VIEW_CONTROLLER_H_
flutter::FlutterWindowsViewController::view
FlutterWindowsView * view()
Definition: flutter_windows_view_controller.h:23
flutter::FlutterWindowsView
Definition: flutter_windows_view.h:34
flutter::FlutterWindowsEngine
Definition: flutter_windows_engine.h:89
flutter::FlutterWindowsViewController::FlutterWindowsViewController
FlutterWindowsViewController(std::unique_ptr< FlutterWindowsEngine > engine, std::unique_ptr< FlutterWindowsView > view)
Definition: flutter_windows_view_controller.h:18
flutter::FlutterWindowsViewController::engine
FlutterWindowsEngine * engine()
Definition: flutter_windows_view_controller.h:22
flutter_windows_view.h
flutter::FlutterWindowsViewController
Controls a view that displays Flutter content.
Definition: flutter_windows_view_controller.h:16
flutter
Definition: accessibility_bridge_windows.cc:11
flutter_windows_engine.h