// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SHELL_PLATFORM_IOS_PLATFORM_VIEW_IOS_H_ #define SHELL_PLATFORM_IOS_PLATFORM_VIEW_IOS_H_ #include #include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h" #include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" namespace shell { class PlatformViewIOS final : public PlatformView { public: explicit PlatformViewIOS(PlatformView::Delegate& delegate, blink::TaskRunners task_runners, FlutterViewController* owner_controller_, FlutterView* owner_view_); ~PlatformViewIOS() override; PlatformMessageRouter& GetPlatformMessageRouter(); FlutterViewController* GetOwnerViewController() const; void RegisterExternalTexture(int64_t id, NSObject* texture); fml::scoped_nsprotocol GetTextInputPlugin() const; void SetTextInputPlugin( fml::scoped_nsprotocol plugin); private: FlutterViewController* owner_controller_; // weak reference. FlutterView* owner_view_; // weak reference. std::unique_ptr ios_surface_; PlatformMessageRouter platform_message_router_; std::unique_ptr accessibility_bridge_; fml::scoped_nsprotocol text_input_plugin_; fxl::Closure firstFrameCallback_; // |shell::PlatformView| std::unique_ptr CreateRenderingSurface() override; // |shell::PlatformView| sk_sp CreateResourceContext() const override; // |shell::PlatformView| void SetSemanticsEnabled(bool enabled) override; // |shell::PlatformView| void HandlePlatformMessage( fxl::RefPtr message) override; // |shell::PlatformView| void UpdateSemantics(blink::SemanticsNodeUpdates update) override; // |shell::PlatformView| std::unique_ptr CreateVSyncWaiter() override; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewIOS); }; } // namespace shell #endif // SHELL_PLATFORM_IOS_PLATFORM_VIEW_IOS_H_