Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
500e60c
Define structs, class
yaakovschectman Feb 8, 2024
8dd4543
Define PV type registration runner API function
yaakovschectman Feb 8, 2024
ae0d049
Bare minimum PlatformViewHandler
yaakovschectman Feb 8, 2024
5f14af0
Compositor owns platform view manager
yaakovschectman Feb 8, 2024
200f13a
Set up for mocking
yaakovschectman Feb 8, 2024
ed90810
Add unit test
yaakovschectman Feb 13, 2024
5d410ff
Formatting
yaakovschectman Feb 13, 2024
484c8c1
License fix, await future
yaakovschectman Feb 13, 2024
b8fadd7
PR Feedback
yaakovschectman Feb 13, 2024
1d203f4
_internal header file
yaakovschectman Feb 14, 2024
b9acc1a
Wait to add manager to compositors
yaakovschectman Feb 14, 2024
35eb688
Rename fixture function
yaakovschectman Feb 14, 2024
659ebd6
Reorder parameters
yaakovschectman Feb 14, 2024
db2851b
Use constants
yaakovschectman Feb 14, 2024
db48ddd
Reorder params in test
yaakovschectman Feb 14, 2024
f87ed96
Format
yaakovschectman Feb 14, 2024
42f976e
License
yaakovschectman Feb 14, 2024
284b309
Break up PlatformViewManager
yaakovschectman Feb 16, 2024
e000930
PR Feedback
yaakovschectman Feb 16, 2024
676868f
Formatting
yaakovschectman Feb 16, 2024
6e6ef7e
PR Feedback
yaakovschectman Feb 16, 2024
22a9e46
Update shell/platform/windows/flutter_windows_engine_unittests.cc
yaakovschectman Feb 21, 2024
95a8498
Update shell/platform/windows/platform_view_manager.h
yaakovschectman Feb 21, 2024
1fa97f3
Update shell/platform/windows/public/flutter_windows.h
yaakovschectman Feb 21, 2024
5453b29
Update shell/platform/windows/flutter_windows_engine_unittests.cc
yaakovschectman Feb 21, 2024
dfa6b73
PR Feedback
yaakovschectman Feb 21, 2024
cde468e
Merge branch 'main' into win_pv_i
yaakovschectman Feb 21, 2024
585ca11
Include internal header
yaakovschectman Feb 22, 2024
54d91a3
Merge branch 'main' into win_pv_i
yaakovschectman Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PR Feedback
  • Loading branch information
yaakovschectman committed Feb 16, 2024
commit e000930bf65d3a359341b0674069a49f1cdc724d
4 changes: 4 additions & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -7293,6 +7293,8 @@ ORIGIN: ../../../flutter/shell/platform/windows/platform_handler.cc + ../../../f
ORIGIN: ../../../flutter/shell/platform/windows/platform_handler.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/windows/platform_view_manager.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/windows/platform_view_manager.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/windows/platform_view_plugin.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/windows/platform_view_plugin.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/windows/public/flutter_windows.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/windows/sequential_id_generator.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/windows/sequential_id_generator.h + ../../../flutter/LICENSE
Expand Down Expand Up @@ -10183,6 +10185,8 @@ FILE: ../../../flutter/shell/platform/windows/platform_handler.cc
FILE: ../../../flutter/shell/platform/windows/platform_handler.h
FILE: ../../../flutter/shell/platform/windows/platform_view_manager.cc
FILE: ../../../flutter/shell/platform/windows/platform_view_manager.h
FILE: ../../../flutter/shell/platform/windows/platform_view_plugin.cc
FILE: ../../../flutter/shell/platform/windows/platform_view_plugin.h
FILE: ../../../flutter/shell/platform/windows/public/flutter_windows.h
FILE: ../../../flutter/shell/platform/windows/sequential_id_generator.cc
FILE: ../../../flutter/shell/platform/windows/sequential_id_generator.h
Expand Down
19 changes: 11 additions & 8 deletions shell/platform/windows/platform_view_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,28 @@ enum class FocusChangeDirection {
kBackward // Keyboard focus moves backwards, e.g. Shift+TAB.
};

// Keeps track of registered platform view types and platform view instances,
// and is responsible for processing and responding to platform view related
// method invokations from the framework.
// The platform method handler for platform view related communication between
// the engine and the framework. This base class is derived by a concrete class
// (i.e. PlatformViewPlugin) to provide implementation of its abstract virtual
// methods.
class PlatformViewManager {
public:
PlatformViewManager(BinaryMessenger* binary_messenger);

virtual ~PlatformViewManager();

// Add a new platform view instance to be lazily instantiated when it is next
// composited.
// composited. The manager will invoke Success when this method returns true,
// and invoke Error otherwise.
virtual bool AddPlatformView(PlatformViewId id,
std::string_view type_name) = 0;
std::string_view type_name) = 0;

// The framework may invoke this method when keyboard focus must be given to
// the platform view.
// the platform view. The manager will invoke Success when this method returns
// true, and invoke Error otherwise.
virtual bool FocusPlatformView(PlatformViewId id,
FocusChangeDirection direction,
bool focus) = 0;
FocusChangeDirection direction,
bool focus) = 0;

private:
std::unique_ptr<MethodChannel<EncodableValue>> channel_;
Expand Down
16 changes: 13 additions & 3 deletions shell/platform/windows/platform_view_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace flutter {

// The concrete implementation of PlatformViewManager that keeps track of
// existing platform view types and instances, and handles their instantiation.
class PlatformViewPlugin : public PlatformViewManager {
public:
PlatformViewPlugin(BinaryMessenger* messenger, TaskRunner* task_runner);
Expand All @@ -23,18 +25,26 @@ class PlatformViewPlugin : public PlatformViewManager {
// has no associated platform view.
std::optional<HWND> GetNativeHandleForId(PlatformViewId id) const;

// Create a queued platform view instance.
void InstantiatePlatformView(PlatformViewId id);

// The runner-facing API calls this method to register a window type
// corresponding to a platform view identifier supplied to the widget tree.
void RegisterPlatformViewType(std::string_view type_name,
const FlutterPlatformViewTypeEntry& type);

// Create a queued platform view instance after it has been added.
// id must correspond to an identifier that has already been added with
// AddPlatformView.
// This method will create the platform view within a task queued to the
// engine's TaskRunner, which will run on the UI thread.
void InstantiatePlatformView(PlatformViewId id);

// | PlatformViewManager |
// type_name must correspond to a string that has already been registered
// with RegisterPlatformViewType.
bool AddPlatformView(PlatformViewId id, std::string_view type_name) override;

// | PlatformViewManager |
// id must correspond to an identifier that has already been added with
// AddPlatformView.
bool FocusPlatformView(PlatformViewId id, FocusChangeDirection direction, bool focus) override;

private:
Expand Down