• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_WEB_WEB_COMPONENT_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_WEB_WEB_COMPONENT_H
18 
19 #include <string>
20 #include <tuple>
21 #include <utility>
22 
23 #include "base/geometry/size.h"
24 #include "base/log/log.h"
25 #include "base/utils/utils.h"
26 #include "core/components/box/drag_drop_event.h"
27 #include "core/components/declaration/common/declaration.h"
28 #include "core/components/declaration/web/web_client.h"
29 #include "core/components/declaration/web/web_declaration.h"
30 #include "core/components/web/resource/web_javascript_value.h"
31 #include "core/components/web/web_event.h"
32 #include "core/components/web/web_property.h"
33 #include "core/components_v2/common/common_def.h"
34 #include "core/event/key_event.h"
35 #include "core/focus/focus_node.h"
36 #include "core/pipeline/base/element.h"
37 
38 namespace OHOS::Ace {
39 
40 // A component can show HTML5 webpages.
41 class ACE_EXPORT WebComponent : public RenderComponent {
42     DECLARE_ACE_TYPE(WebComponent, RenderComponent);
43 
44 public:
45     using CreatedCallback = std::function<void()>;
46     using ReleasedCallback = std::function<void(bool)>;
47     using ErrorCallback = std::function<void(const std::string&, const std::string&)>;
48     using MethodCall = std::function<void(const std::string&)>;
49     using Method = std::string;
50     using SetWebIdCallback = std::function<void(int32_t)>;
51     using SetHapPathCallback = std::function<void(const std::string&)>;
52     using JsProxyCallback = std::function<void()>;
53     using PreKeyEventCallback = std::function<bool(KeyEventInfo& keyEventInfo)>;
54 
55     WebComponent() = default;
56     explicit WebComponent(const std::string& type);
57     ~WebComponent() override = default;
58 
59     RefPtr<RenderNode> CreateRenderNode() override;
60     RefPtr<Element> CreateElement() override;
61 
SetType(const std::string & type)62     void SetType(const std::string& type)
63     {
64         type_ = type;
65     }
66 
GetType()67     const std::string& GetType() const
68     {
69         return type_;
70     }
71 
SetIncognitoMode(const bool incognitoMode)72     void SetIncognitoMode(const bool incognitoMode)
73     {
74         incognitoMode_ = incognitoMode;
75     }
76 
GetIncognitoMode()77     bool GetIncognitoMode() const
78     {
79         return incognitoMode_;
80     }
81 
SetSrc(const std::string & src)82     void SetSrc(const std::string& src)
83     {
84         CHECK_NULL_VOID(declaration_);
85         declaration_->SetWebSrc(src);
86     }
87 
GetSrc()88     const std::string& GetSrc() const
89     {
90         return declaration_->GetWebSrc();
91     }
92 
SetPopup(bool popup)93     void SetPopup(bool popup)
94     {
95         isPopup_ = popup;
96     }
97 
SetParentNWebId(int32_t parentNWebId)98     void SetParentNWebId(int32_t parentNWebId)
99     {
100         parentNWebId_ = parentNWebId;
101     }
102 
SetSharedRenderProcessToken(const std::string & sharedRenderProcessToken)103     void SetSharedRenderProcessToken(const std::string& sharedRenderProcessToken)
104     {
105         shared_render_process_token_ = sharedRenderProcessToken;
106     }
107 
GetSharedRenderProcessToken()108     const std::string& GetSharedRenderProcessToken() const
109     {
110         return shared_render_process_token_;
111     }
112 
SetData(const std::string & data)113     void SetData(const std::string& data)
114     {
115         CHECK_NULL_VOID(declaration_);
116         declaration_->SetWebData(data);
117     }
118 
GetData()119     const std::string& GetData() const
120     {
121         return declaration_->GetWebData();
122     }
123 
SetPageStartedEventId(const EventMarker & pageStartedEventId)124     void SetPageStartedEventId(const EventMarker& pageStartedEventId)
125     {
126         CHECK_NULL_VOID(declaration_);
127         declaration_->SetPageStartedEventId(pageStartedEventId);
128     }
129 
GetPageStartedEventId()130     const EventMarker& GetPageStartedEventId() const
131     {
132         return declaration_->GetPageStartedEventId();
133     }
134 
SetPageFinishedEventId(const EventMarker & pageFinishedEventId)135     void SetPageFinishedEventId(const EventMarker& pageFinishedEventId)
136     {
137         CHECK_NULL_VOID(declaration_);
138         declaration_->SetPageFinishedEventId(pageFinishedEventId);
139     }
140 
GetPageFinishedEventId()141     const EventMarker& GetPageFinishedEventId() const
142     {
143         return declaration_->GetPageFinishedEventId();
144     }
145 
146     using OnProgressChangeImpl = std::function<void(const BaseEventInfo* info)>;
OnProgressChange(const BaseEventInfo * info)147     void OnProgressChange(const BaseEventInfo* info) const
148     {
149         if (onProgressChangeImpl_) {
150             onProgressChangeImpl_(info);
151         }
152     }
SetProgressChangeImpl(OnProgressChangeImpl && onProgressChangeImpl)153     void SetProgressChangeImpl(OnProgressChangeImpl&& onProgressChangeImpl)
154     {
155         if (onProgressChangeImpl == nullptr) {
156             return;
157         }
158         onProgressChangeImpl_ = std::move(onProgressChangeImpl);
159     }
160 
SetTitleReceiveEventId(const EventMarker & titleReceiveEventId)161     void SetTitleReceiveEventId(const EventMarker& titleReceiveEventId)
162     {
163         CHECK_NULL_VOID(declaration_);
164         declaration_->SetTitleReceiveEventId(titleReceiveEventId);
165     }
166 
GetTitleReceiveEventId()167     const EventMarker& GetTitleReceiveEventId() const
168     {
169         return declaration_->GetTitleReceiveEventId();
170     }
171 
SetOnFullScreenExitEventId(const EventMarker & fullScreenExitEventId)172     void SetOnFullScreenExitEventId(const EventMarker& fullScreenExitEventId)
173     {
174         CHECK_NULL_VOID(declaration_);
175         declaration_->SetOnFullScreenExitEventId(fullScreenExitEventId);
176     }
177 
GetOnFullScreenExitEventId()178     const EventMarker& GetOnFullScreenExitEventId() const
179     {
180         return declaration_->GetOnFullScreenExitEventId();
181     }
182 
SetGeolocationHideEventId(const EventMarker & geolocationHideEventId)183     void SetGeolocationHideEventId(const EventMarker& geolocationHideEventId)
184     {
185         CHECK_NULL_VOID(declaration_);
186         declaration_->SetGeolocationHideEventId(geolocationHideEventId);
187     }
188 
GetGeolocationHideEventId()189     const EventMarker& GetGeolocationHideEventId() const
190     {
191         return declaration_->GetGeolocationHideEventId();
192     }
193 
SetGeolocationShowEventId(const EventMarker & geolocationShowEventId)194     void SetGeolocationShowEventId(const EventMarker& geolocationShowEventId)
195     {
196         CHECK_NULL_VOID(declaration_);
197         declaration_->SetGeolocationShowEventId(geolocationShowEventId);
198     }
199 
GetGeolocationShowEventId()200     const EventMarker& GetGeolocationShowEventId() const
201     {
202         return declaration_->GetGeolocationShowEventId();
203     }
204 
SetRequestFocusEventId(const EventMarker & requestFocusEventId)205     void SetRequestFocusEventId(const EventMarker& requestFocusEventId)
206     {
207         CHECK_NULL_VOID(declaration_);
208         declaration_->SetRequestFocusEventId(requestFocusEventId);
209     }
210 
GetRequestFocusEventId()211     const EventMarker& GetRequestFocusEventId() const
212     {
213         return declaration_->GetRequestFocusEventId();
214     }
215 
SetDownloadStartEventId(const EventMarker & downloadStartEventId)216     void SetDownloadStartEventId(const EventMarker& downloadStartEventId)
217     {
218         CHECK_NULL_VOID(declaration_);
219         declaration_->SetDownloadStartEventId(downloadStartEventId);
220     }
221 
GetDownloadStartEventId()222     const EventMarker& GetDownloadStartEventId() const
223     {
224         return declaration_->GetDownloadStartEventId();
225     }
226 
SetPageErrorEventId(const EventMarker & pageErrorEventId)227     void SetPageErrorEventId(const EventMarker& pageErrorEventId)
228     {
229         CHECK_NULL_VOID(declaration_);
230         declaration_->SetPageErrorEventId(pageErrorEventId);
231     }
232 
GetPageErrorEventId()233     const EventMarker& GetPageErrorEventId() const
234     {
235         return declaration_->GetPageErrorEventId();
236     }
237 
SetHttpErrorEventId(const EventMarker & httpErrorEventId)238     void SetHttpErrorEventId(const EventMarker& httpErrorEventId)
239     {
240         CHECK_NULL_VOID(declaration_);
241         declaration_->SetHttpErrorEventId(httpErrorEventId);
242     }
243 
GetHttpErrorEventId()244     const EventMarker& GetHttpErrorEventId() const
245     {
246         return declaration_->GetHttpErrorEventId();
247     }
248 
SetMessageEventId(const EventMarker & messageEventId)249     void SetMessageEventId(const EventMarker& messageEventId)
250     {
251         CHECK_NULL_VOID(declaration_);
252         declaration_->SetMessageEventId(messageEventId);
253     }
254 
GetMessageEventId()255     const EventMarker& GetMessageEventId() const
256     {
257         return declaration_->GetMessageEventId();
258     }
259 
SetRenderExitedId(const EventMarker & renderExitedId)260     void SetRenderExitedId(const EventMarker& renderExitedId)
261     {
262         CHECK_NULL_VOID(declaration_);
263         declaration_->SetRenderExitedId(renderExitedId);
264     }
265 
GetRenderExitedId()266     const EventMarker& GetRenderExitedId() const
267     {
268         return declaration_->GetRenderExitedId();
269     }
270 
SetRefreshAccessedHistoryId(const EventMarker & refreshAccessedHistoryId)271     void SetRefreshAccessedHistoryId(const EventMarker& refreshAccessedHistoryId)
272     {
273         CHECK_NULL_VOID(declaration_);
274         declaration_->SetRefreshAccessedHistoryId(refreshAccessedHistoryId);
275     }
276 
GetRefreshAccessedHistoryId()277     const EventMarker& GetRefreshAccessedHistoryId() const
278     {
279         return declaration_->GetRefreshAccessedHistoryId();
280     }
281 
SetResourceLoadId(const EventMarker & resourceLoadId)282     void SetResourceLoadId(const EventMarker& resourceLoadId)
283     {
284         CHECK_NULL_VOID(declaration_);
285         declaration_->SetResourceLoadId(resourceLoadId);
286     }
287 
GetResourceLoadId()288     const EventMarker& GetResourceLoadId() const
289     {
290         return declaration_->GetResourceLoadId();
291     }
292 
SetScaleChangeId(const EventMarker & scaleChangeId)293     void SetScaleChangeId(const EventMarker& scaleChangeId)
294     {
295         CHECK_NULL_VOID(declaration_);
296         declaration_->SetScaleChangeId(scaleChangeId);
297     }
298 
GetScaleChangeId()299     const EventMarker& GetScaleChangeId() const
300     {
301         return declaration_->GetScaleChangeId();
302     }
303 
SetScrollId(const EventMarker & scrollId)304     void SetScrollId(const EventMarker& scrollId)
305     {
306         CHECK_NULL_VOID(declaration_);
307         declaration_->SetScrollId(scrollId);
308     }
309 
GetScrollId()310     const EventMarker& GetScrollId() const
311     {
312         return declaration_->GetScrollId();
313     }
314 
SetPermissionRequestEventId(const EventMarker & permissionRequestEventId)315     void SetPermissionRequestEventId(const EventMarker& permissionRequestEventId)
316     {
317         CHECK_NULL_VOID(declaration_);
318         declaration_->SetPermissionRequestEventId(permissionRequestEventId);
319     }
320 
GetPermissionRequestEventId()321     const EventMarker& GetPermissionRequestEventId() const
322     {
323         return declaration_->GetPermissionRequestEventId();
324     }
325 
326     using OnWindowNewImpl = std::function<void(const std::shared_ptr<BaseEventInfo>& info)>;
SetWindowNewEvent(OnWindowNewImpl && onWindowNewImpl)327     void SetWindowNewEvent(OnWindowNewImpl && onWindowNewImpl)
328     {
329         if (onWindowNewImpl == nullptr) {
330             return;
331         }
332         onWindowNewImpl_ = std::move(onWindowNewImpl);
333     }
334 
OnWindowNewEvent(const std::shared_ptr<BaseEventInfo> & info)335     void OnWindowNewEvent(const std::shared_ptr<BaseEventInfo>& info) const
336     {
337         if (onWindowNewImpl_) {
338             onWindowNewImpl_(info);
339         }
340     }
341 
SetWindowExitEventId(const EventMarker & windowExitEventId)342     void SetWindowExitEventId(const EventMarker& windowExitEventId)
343     {
344         CHECK_NULL_VOID(declaration_);
345         declaration_->SetWindowExitEventId(windowExitEventId);
346     }
347 
GetWindowExitEventId()348     const EventMarker& GetWindowExitEventId() const
349     {
350         return declaration_->GetWindowExitEventId();
351     }
352 
SetDeclaration(const RefPtr<WebDeclaration> & declaration)353     void SetDeclaration(const RefPtr<WebDeclaration>& declaration)
354     {
355         if (declaration) {
356             declaration_ = declaration;
357         }
358     }
359 
GetController()360     RefPtr<WebController> GetController() const
361     {
362         return webController_;
363     }
364 
SetWebController(const RefPtr<WebController> & webController)365     void SetWebController(const RefPtr<WebController>& webController)
366     {
367         webController_ = webController;
368     }
369 
SetSetWebIdCallback(SetWebIdCallback && SetIdCallback)370     void SetSetWebIdCallback(SetWebIdCallback&& SetIdCallback)
371     {
372         setWebIdCallback_ = std::move(SetIdCallback);
373     }
374 
GetSetWebIdCallback()375     SetWebIdCallback GetSetWebIdCallback() const
376     {
377         return setWebIdCallback_;
378     }
379 
SetSetHapPathCallback(SetHapPathCallback && callback)380     void SetSetHapPathCallback(SetHapPathCallback&& callback)
381     {
382         setHapPathCallback_ = std::move(callback);
383     }
384 
GetSetHapPathCallback()385     SetHapPathCallback GetSetHapPathCallback() const
386     {
387         return setHapPathCallback_;
388     }
389 
GetJsEnabled()390     bool GetJsEnabled() const
391     {
392         return isJsEnabled_;
393     }
394 
SetJsEnabled(bool isEnabled)395     void SetJsEnabled(bool isEnabled)
396     {
397         isJsEnabled_ = isEnabled;
398     }
399 
GetUserAgent()400     std::string GetUserAgent() const
401     {
402         return userAgent_;
403     }
404 
SetUserAgent(std::string userAgent)405     void SetUserAgent(std::string userAgent)
406     {
407         userAgent_ = std::move(userAgent);
408     }
409 
GetCustomScheme()410     std::string GetCustomScheme() const
411     {
412         return customScheme_;
413     }
414 
SetCustomScheme(std::string cmdLine)415     void SetCustomScheme(std::string cmdLine)
416     {
417         customScheme_ = std::move(cmdLine);
418     }
419 
GetContentAccessEnabled()420     bool GetContentAccessEnabled() const
421     {
422         return isContentAccessEnabled_;
423     }
424 
SetContentAccessEnabled(bool isEnabled)425     void SetContentAccessEnabled(bool isEnabled)
426     {
427         isContentAccessEnabled_ = isEnabled;
428     }
429 
GetFileAccessEnabled()430     bool GetFileAccessEnabled() const
431     {
432         return isFileAccessEnabled_;
433     }
434 
SetFileAccessEnabled(bool isEnabled)435     void SetFileAccessEnabled(bool isEnabled)
436     {
437         isFileAccessEnabled_ = isEnabled;
438     }
GetOnLineImageAccessEnabled()439     bool GetOnLineImageAccessEnabled() const
440     {
441         return isOnLineImageAccessEnabled_;
442     }
443 
SetOnLineImageAccessEnabled(bool isEnabled)444     void SetOnLineImageAccessEnabled(bool isEnabled)
445     {
446         isOnLineImageAccessEnabled_ = isEnabled;
447     }
448 
GetDomStorageAccessEnabled()449     bool GetDomStorageAccessEnabled() const
450     {
451         return isDomStorageAccessEnabled_;
452     }
453 
SetDomStorageAccessEnabled(bool isEnabled)454     void SetDomStorageAccessEnabled(bool isEnabled)
455     {
456         isDomStorageAccessEnabled_ = isEnabled;
457     }
458 
GetImageAccessEnabled()459     bool GetImageAccessEnabled() const
460     {
461         return isImageAccessEnabled_;
462     }
463 
SetImageAccessEnabled(bool isEnabled)464     void SetImageAccessEnabled(bool isEnabled)
465     {
466         isImageAccessEnabled_ = isEnabled;
467     }
468 
GetMixedMode()469     MixedModeContent GetMixedMode() const
470     {
471         return mixedContentMode_;
472     }
473 
SetMixedMode(MixedModeContent mixedModeNum)474     void SetMixedMode(MixedModeContent mixedModeNum)
475     {
476         mixedContentMode_ = mixedModeNum;
477     }
478 
GetZoomAccessEnabled()479     bool GetZoomAccessEnabled() const
480     {
481         return isZoomAccessEnabled_;
482     }
483 
SetZoomAccessEnabled(bool isEnabled)484     void SetZoomAccessEnabled(bool isEnabled)
485     {
486         isZoomAccessEnabled_ = isEnabled;
487     }
488 
GetGeolocationAccessEnabled()489     bool GetGeolocationAccessEnabled() const
490     {
491         return isGeolocationAccessEnabled_;
492     }
493 
SetGeolocationAccessEnabled(bool isEnabled)494     void SetGeolocationAccessEnabled(bool isEnabled)
495     {
496         isGeolocationAccessEnabled_ = isEnabled;
497     }
498 
GetCacheMode()499     WebCacheMode GetCacheMode()
500     {
501         return cacheMode_;
502     }
503 
SetCacheMode(WebCacheMode mode)504     void SetCacheMode(WebCacheMode mode)
505     {
506         cacheMode_ = mode;
507     }
508 
GetOverScrollMode()509     OverScrollMode GetOverScrollMode() const
510     {
511         return OverScrollMode_;
512     }
513 
SetOverScrollMode(OverScrollMode mode)514     void SetOverScrollMode(OverScrollMode mode)
515     {
516         OverScrollMode_ = mode;
517     }
518 
GetCopyOptionMode()519     CopyOptions GetCopyOptionMode() const
520     {
521         return CopyOptionMode_;
522     }
523 
SetCopyOptionMode(CopyOptions mode)524     void SetCopyOptionMode(CopyOptions mode)
525     {
526         CopyOptionMode_ = mode;
527     }
528 
GetOverviewModeAccessEnabled()529     bool GetOverviewModeAccessEnabled() const
530     {
531         return isOverviewModeAccessEnabled_;
532     }
533 
SetOverviewModeAccessEnabled(bool isEnabled)534     void SetOverviewModeAccessEnabled(bool isEnabled)
535     {
536         isOverviewModeAccessEnabled_ = isEnabled;
537     }
538 
GetFileFromUrlAccessEnabled()539     bool GetFileFromUrlAccessEnabled() const
540     {
541         return isFileFromUrlAccessEnabled_;
542     }
543 
SetFileFromUrlAccessEnabled(bool isEnabled)544     void SetFileFromUrlAccessEnabled(bool isEnabled)
545     {
546         isFileFromUrlAccessEnabled_ = isEnabled;
547     }
548 
GetDatabaseAccessEnabled()549     bool GetDatabaseAccessEnabled() const
550     {
551         return isDatabaseAccessEnabled_;
552     }
553 
SetDatabaseAccessEnabled(bool isEnabled)554     void SetDatabaseAccessEnabled(bool isEnabled)
555     {
556         isDatabaseAccessEnabled_ = isEnabled;
557     }
558 
GetWebDebuggingAccessEnabled()559     bool GetWebDebuggingAccessEnabled() const
560     {
561         return isWebDebuggingAccessEnabled_;
562     }
563 
SetWebDebuggingAccessEnabled(bool isEnabled)564     void SetWebDebuggingAccessEnabled(bool isEnabled)
565     {
566         isWebDebuggingAccessEnabled_ = isEnabled;
567     }
568 
GetPinchSmoothModeEnabled()569     bool GetPinchSmoothModeEnabled() const
570     {
571         return isPinchSmoothModeEnabled_;
572     }
573 
SetPinchSmoothModeEnabled(bool isEnabled)574     void SetPinchSmoothModeEnabled(bool isEnabled)
575     {
576         isPinchSmoothModeEnabled_ = isEnabled;
577     }
578 
GetMultiWindowAccessEnabled()579     bool GetMultiWindowAccessEnabled() const
580     {
581         return isMultiWindowAccessEnabled_;
582     }
583 
SetMultiWindowAccessEnabled(bool isEnabled)584     void SetMultiWindowAccessEnabled(bool isEnabled)
585     {
586         isMultiWindowAccessEnabled_ = isEnabled;
587     }
588 
GetAllowWindowOpenMethod()589     bool GetAllowWindowOpenMethod() const
590     {
591         return isAllowWindowOpenMethod_;
592     }
593 
SetAllowWindowOpenMethod(bool isEnabled)594     void SetAllowWindowOpenMethod(bool isEnabled)
595     {
596         isAllowWindowOpenMethod_ = isEnabled;
597     }
598 
GetIsInitialScaleSet()599     bool GetIsInitialScaleSet() const
600     {
601         return isInitialScaleSet_;
602     }
603 
GetInitialScale()604     float GetInitialScale() const
605     {
606         return initialScale_;
607     }
608 
SetInitialScale(float scale)609     void SetInitialScale(float scale)
610     {
611         initialScale_ = scale;
612         isInitialScaleSet_ = true;
613     }
614 
GetBackgroundColorEnabled()615     bool GetBackgroundColorEnabled() const
616     {
617         return isBackgroundColor_;
618     }
619 
GetBackgroundColor()620     int32_t GetBackgroundColor() const
621     {
622         return backgroundColor_;
623     }
624 
SetBackgroundColor(int32_t backgroundColor)625     void SetBackgroundColor(int32_t backgroundColor)
626     {
627         backgroundColor_ = backgroundColor;
628         isBackgroundColor_ = true;
629     }
630 
GetTextZoomRatio()631     int32_t GetTextZoomRatio() const
632     {
633         return textZoomRatioNum_;
634     }
635 
SetTextZoomRatio(int32_t ratio)636     void SetTextZoomRatio(int32_t ratio)
637     {
638         textZoomRatioNum_ = ratio;
639     }
640 
SetNativeEmbedModeEnabled(bool isEnabled)641     void SetNativeEmbedModeEnabled(bool isEnabled)
642     {
643         isNativeEmbedMode_ = isEnabled;
644     }
645 
SetIntrinsicSizeEnabled(bool isEnabled)646     void SetIntrinsicSizeEnabled(bool isEnabled)
647     {
648         isIntrinsicSize_ = isEnabled;
649     }
650 
GetNativeVideoPlayerConfig()651     const std::tuple<bool, bool>& GetNativeVideoPlayerConfig() const
652     {
653         return native_video_player_config_;
654     }
655 
SetNativeVideoPlayerConfig(bool enable,bool shouldOverlay)656     void SetNativeVideoPlayerConfig(bool enable, bool shouldOverlay)
657     {
658         native_video_player_config_ = std::make_tuple(enable, shouldOverlay);
659     }
660 
RegisterNativeEmbedRule(const std::string & tag,const std::string & type)661     void RegisterNativeEmbedRule(const std::string& tag, const std::string& type)
662     {
663         tag_ = tag;
664         tag_type_ = type;
665     }
666 
667     using OnCommonDialogImpl = std::function<bool(const BaseEventInfo* info)>;
OnCommonDialog(const BaseEventInfo * info,DialogEventType dialogEventType)668     bool OnCommonDialog(const BaseEventInfo* info, DialogEventType dialogEventType) const
669     {
670         if (dialogEventType == DialogEventType::DIALOG_EVENT_ALERT && onAlertImpl_) {
671             return onAlertImpl_(info);
672         }
673         if (dialogEventType == DialogEventType::DIALOG_EVENT_CONFIRM && onConfirmImpl_) {
674             return onConfirmImpl_(info);
675         }
676         if (dialogEventType == DialogEventType::DIALOG_EVENT_PROMPT && onPromptImpl_) {
677             return onPromptImpl_(info);
678         }
679         if (dialogEventType == DialogEventType::DIALOG_EVENT_BEFORE_UNLOAD && onBeforeUnloadImpl_) {
680             return onBeforeUnloadImpl_(info);
681         }
682         return false;
683     }
SetOnCommonDialogImpl(OnCommonDialogImpl && onCommonDialogImpl,DialogEventType dialogEventType)684     void SetOnCommonDialogImpl(OnCommonDialogImpl&& onCommonDialogImpl, DialogEventType dialogEventType)
685     {
686         if (onCommonDialogImpl == nullptr) {
687             return;
688         }
689 
690         switch (dialogEventType) {
691             case DialogEventType::DIALOG_EVENT_ALERT:
692                 onAlertImpl_ = std::move(onCommonDialogImpl);
693                 break;
694             case DialogEventType::DIALOG_EVENT_CONFIRM:
695                 onConfirmImpl_ = std::move(onCommonDialogImpl);
696                 break;
697             case DialogEventType::DIALOG_EVENT_PROMPT:
698                 onPromptImpl_ = std::move(onCommonDialogImpl);
699                 break;
700             case DialogEventType::DIALOG_EVENT_BEFORE_UNLOAD:
701                 onBeforeUnloadImpl_ = std::move(onCommonDialogImpl);
702                 break;
703             default:
704                 break;
705         }
706     }
707 
708     using OnFullScreenEnterImpl = std::function<void(const BaseEventInfo* info)>;
OnFullScreenEnter(const BaseEventInfo * info)709     void OnFullScreenEnter(const BaseEventInfo* info) const
710     {
711         if (onFullScreenEnterImpl_) {
712             onFullScreenEnterImpl_(info);
713         }
714     }
SetOnFullScreenEnterImpl(OnFullScreenEnterImpl && onFullScreenEnterImpl)715     void SetOnFullScreenEnterImpl(OnFullScreenEnterImpl&& onFullScreenEnterImpl)
716     {
717         onFullScreenEnterImpl_ = std::move(onFullScreenEnterImpl);
718     }
719 
720     using OnHttpAuthRequestImpl = std::function<bool(const BaseEventInfo* info)>;
OnHttpAuthRequest(const BaseEventInfo * info)721     bool OnHttpAuthRequest(const BaseEventInfo* info) const
722     {
723         if (onHttpAuthRequestImpl_) {
724             return onHttpAuthRequestImpl_(info);
725         }
726         return false;
727     }
SetOnHttpAuthRequestImpl(OnHttpAuthRequestImpl && onHttpAuthRequestImpl)728     void SetOnHttpAuthRequestImpl(OnHttpAuthRequestImpl&& onHttpAuthRequestImpl)
729     {
730         if (onHttpAuthRequestImpl == nullptr) {
731             return;
732         }
733         onHttpAuthRequestImpl_ = std::move(onHttpAuthRequestImpl);
734     }
735 
736     using OnSslErrorRequestImpl = std::function<bool(const BaseEventInfo* info)>;
OnSslErrorRequest(const BaseEventInfo * info)737     bool OnSslErrorRequest(const BaseEventInfo* info) const
738     {
739         if (onSslErrorRequestImpl_) {
740             return onSslErrorRequestImpl_(info);
741         }
742         return false;
743     }
SetOnSslErrorRequestImpl(OnSslErrorRequestImpl && onSslErrorRequestImpl)744     void SetOnSslErrorRequestImpl(OnSslErrorRequestImpl && onSslErrorRequestImpl)
745     {
746         if (onSslErrorRequestImpl == nullptr) {
747             return;
748         }
749         onSslErrorRequestImpl_ = std::move(onSslErrorRequestImpl);
750     }
751 
752     using OnAllSslErrorRequestImpl = std::function<bool(const BaseEventInfo* info)>;
OnAllSslErrorRequest(const BaseEventInfo * info)753     bool OnAllSslErrorRequest(const BaseEventInfo* info) const
754     {
755         if (onAllSslErrorRequestImpl_) {
756             return onAllSslErrorRequestImpl_(info);
757         }
758         return false;
759     }
760 
SetOnAllSslErrorRequestImpl(OnAllSslErrorRequestImpl && onAllSslErrorRequestImpl)761     void SetOnAllSslErrorRequestImpl(OnAllSslErrorRequestImpl && onAllSslErrorRequestImpl)
762     {
763         if (onAllSslErrorRequestImpl == nullptr) {
764             return;
765         }
766         onAllSslErrorRequestImpl_ = std::move(onAllSslErrorRequestImpl);
767     }
768 
769     using OnSslSelectCertRequestImpl = std::function<bool(const BaseEventInfo* info)>;
OnSslSelectCertRequest(const BaseEventInfo * info)770     bool OnSslSelectCertRequest(const BaseEventInfo* info) const
771     {
772         if (onSslSelectCertRequestImpl_) {
773             return onSslSelectCertRequestImpl_(info);
774         }
775         return false;
776     }
SetOnSslSelectCertRequestImpl(OnSslSelectCertRequestImpl && impl)777     void SetOnSslSelectCertRequestImpl(OnSslSelectCertRequestImpl && impl)
778     {
779         if (!impl) {
780             return;
781         }
782         onSslSelectCertRequestImpl_ = std::move(impl);
783     }
784 
785     bool RequestFocus();
786 
787     using OnConsoleImpl = std::function<bool(const BaseEventInfo* info)>;
OnConsole(const BaseEventInfo * info)788     bool OnConsole(const BaseEventInfo* info) const
789     {
790         if (consoleImpl_) {
791             return consoleImpl_(info);
792         }
793         return false;
794     }
795 
SetOnConsoleImpl(OnConsoleImpl && consoleImpl)796     void SetOnConsoleImpl(OnConsoleImpl&& consoleImpl)
797     {
798         consoleImpl_ = std::move(consoleImpl);
799     }
800 
SetFocusElement(const WeakPtr<FocusNode> & focusElement)801     void SetFocusElement(const WeakPtr<FocusNode>& focusElement)
802     {
803         focusElement_ = focusElement;
804     }
805 
806     using OnFileSelectorShowImpl = std::function<bool(const BaseEventInfo* info)>;
OnFileSelectorShow(const BaseEventInfo * info)807     bool OnFileSelectorShow(const BaseEventInfo* info) const
808     {
809         if (onFileSelectorShowImpl_) {
810             return onFileSelectorShowImpl_(info);
811         }
812         return false;
813     }
SetOnFileSelectorShow(OnFileSelectorShowImpl && onFileSelectorShowImpl)814     void SetOnFileSelectorShow(OnFileSelectorShowImpl&& onFileSelectorShowImpl)
815     {
816         if (onFileSelectorShowImpl == nullptr) {
817             return;
818         }
819 
820         onFileSelectorShowImpl_ = onFileSelectorShowImpl;
821     }
822 
823     using OnContextMenuImpl = std::function<bool(const BaseEventInfo* info)>;
OnContextMenuShow(const BaseEventInfo * info)824     bool OnContextMenuShow(const BaseEventInfo* info) const
825     {
826         if (onContextMenuImpl_) {
827             return onContextMenuImpl_(info);
828         }
829         return false;
830     }
SetOnContextMenuShow(OnContextMenuImpl && onContextMenuImpl)831     void SetOnContextMenuShow(OnContextMenuImpl&& onContextMenuImpl)
832     {
833         if (onContextMenuImpl == nullptr) {
834             return;
835         }
836         onContextMenuImpl_ = std::move(onContextMenuImpl);
837     }
838 
839     using OnContextMenuHideImpl = std::function<void(const BaseEventInfo* info)>;
OnContextMenuHide(const BaseEventInfo * info)840     void OnContextMenuHide(const BaseEventInfo* info) const
841     {
842         if (onContextMenuHideImpl_) {
843             onContextMenuHideImpl_(info);
844         }
845     }
SetOnContextMenuHide(OnContextMenuHideImpl && onContextMenuHideImpl)846     void SetOnContextMenuHide(OnContextMenuHideImpl&& onContextMenuHideImpl)
847     {
848         if (onContextMenuHideImpl == nullptr) {
849             return;
850         }
851         onContextMenuHideImpl_ = std::move(onContextMenuHideImpl);
852     }
853 
854     using OnUrlLoadInterceptImpl = std::function<bool(const BaseEventInfo* info)>;
OnUrlLoadIntercept(const BaseEventInfo * info)855     bool OnUrlLoadIntercept(const BaseEventInfo* info) const
856     {
857         if (onUrlLoadInterceptImpl_) {
858             return onUrlLoadInterceptImpl_(info);
859         }
860         return false;
861     }
SetOnUrlLoadIntercept(OnUrlLoadInterceptImpl && onUrlLoadInterceptImpl)862     void SetOnUrlLoadIntercept(OnUrlLoadInterceptImpl&& onUrlLoadInterceptImpl)
863     {
864         if (onUrlLoadInterceptImpl == nullptr) {
865             return;
866         }
867 
868         onUrlLoadInterceptImpl_ = onUrlLoadInterceptImpl;
869     }
870 
871     using OnLoadInterceptImpl = std::function<bool(const BaseEventInfo* info)>;
OnLoadIntercept(const BaseEventInfo * info)872     bool OnLoadIntercept(const BaseEventInfo* info) const
873     {
874         if (onLoadInterceptImpl_) {
875             return onLoadInterceptImpl_(info);
876         }
877         return false;
878     }
SetOnLoadIntercept(OnLoadInterceptImpl && onLoadInterceptImpl)879     void SetOnLoadIntercept(OnLoadInterceptImpl&& onLoadInterceptImpl)
880     {
881         if (onLoadInterceptImpl == nullptr) {
882             return;
883         }
884 
885         onLoadInterceptImpl_ = onLoadInterceptImpl;
886     }
887 
888     using OnOverrideUrlLoadingImpl = std::function<bool(const BaseEventInfo* info)>;
OnOverrideUrlLoading(const BaseEventInfo * info)889     bool OnOverrideUrlLoading(const BaseEventInfo* info) const
890     {
891         if (onOverrideUrlLoadingImpl_) {
892             return onOverrideUrlLoadingImpl_(info);
893         }
894         return false;
895     }
SetOnOverrideUrlLoading(OnOverrideUrlLoadingImpl && onOverrideUrlLoadingImpl)896     void SetOnOverrideUrlLoading(OnOverrideUrlLoadingImpl&& onOverrideUrlLoadingImpl)
897     {
898         if (onOverrideUrlLoadingImpl == nullptr) {
899             return;
900         }
901 
902         onOverrideUrlLoadingImpl_ = onOverrideUrlLoadingImpl;
903     }
904 
905     using OnInterceptRequestImpl = std::function<RefPtr<WebResponse>(const BaseEventInfo* info)>;
OnInterceptRequest(const BaseEventInfo * info)906     RefPtr<WebResponse> OnInterceptRequest(const BaseEventInfo* info) const
907     {
908         if (onInterceptRequestImpl_) {
909             return onInterceptRequestImpl_(info);
910         }
911         return nullptr;
912     }
913 
IsEmptyOnInterceptRequest()914     bool IsEmptyOnInterceptRequest() const
915     {
916         return onInterceptRequestImpl_ == nullptr;
917     }
918 
SetOnInterceptRequest(OnInterceptRequestImpl && onInterceptRequestImpl)919     void SetOnInterceptRequest(OnInterceptRequestImpl&& onInterceptRequestImpl)
920     {
921         if (onInterceptRequestImpl == nullptr) {
922             return;
923         }
924         onInterceptRequestImpl_ = std::move(onInterceptRequestImpl);
925     }
926 
SetOnMouseEventCallback(const OnMouseCallback & onMouseId)927     void SetOnMouseEventCallback(const OnMouseCallback& onMouseId)
928     {
929         onMouseEvent_ = onMouseId;
930     }
931 
GetOnMouseEventCallback()932     OnMouseCallback GetOnMouseEventCallback() const
933     {
934         return onMouseEvent_;
935     }
936 
SetOnKeyEventCallback(const OnKeyEventCallback & onKeyEventId)937     void SetOnKeyEventCallback(const OnKeyEventCallback& onKeyEventId)
938     {
939         onKeyEvent_ = onKeyEventId;
940     }
941 
GetOnKeyEventCallback()942     OnKeyEventCallback GetOnKeyEventCallback() const
943     {
944         return onKeyEvent_;
945     }
946 
SetSearchResultReceiveEventId(const EventMarker & searchResultReceiveEventId)947     void SetSearchResultReceiveEventId(const EventMarker& searchResultReceiveEventId)
948     {
949         CHECK_NULL_VOID(declaration_);
950         declaration_->SetSearchResultReceiveEventId(searchResultReceiveEventId);
951     }
952 
GetSearchResultReceiveEventId()953     const EventMarker& GetSearchResultReceiveEventId() const
954     {
955         return declaration_->GetSearchResultReceiveEventId();
956     }
957 
SetMediaPlayGestureAccess(bool isNeedGestureAccess)958     void SetMediaPlayGestureAccess(bool isNeedGestureAccess)
959     {
960         isNeedGestureAccess_ = isNeedGestureAccess;
961     }
962 
IsMediaPlayGestureAccess()963     bool IsMediaPlayGestureAccess() const
964     {
965         return isNeedGestureAccess_;
966     }
967 
GetOnDragStartId()968     const OnDragFunc& GetOnDragStartId() const
969     {
970         return onDragStartId_;
971     }
972 
SetOnDragStartId(const OnDragFunc & onDragStartId)973     void SetOnDragStartId(const OnDragFunc& onDragStartId)
974     {
975         onDragStartId_ = onDragStartId;
976     }
977 
GetOnDragEnterId()978     const OnDropFunc& GetOnDragEnterId() const
979     {
980         return onDragEnterId_;
981     }
982 
SetOnDragEnterId(const OnDropFunc & onDragEnterId)983     void SetOnDragEnterId(const OnDropFunc& onDragEnterId)
984     {
985         onDragEnterId_ = onDragEnterId;
986     }
987 
GetOnDragMoveId()988     const OnDropFunc& GetOnDragMoveId() const
989     {
990         return onDragMoveId_;
991     }
992 
SetOnDragMoveId(const OnDropFunc & onDragMoveId)993     void SetOnDragMoveId(const OnDropFunc& onDragMoveId)
994     {
995         onDragMoveId_ = onDragMoveId;
996     }
997 
GetOnDragLeaveId()998     const OnDropFunc& GetOnDragLeaveId() const
999     {
1000         return onDragLeaveId_;
1001     }
1002 
SetOnDragLeaveId(const OnDropFunc & onDragLeaveId)1003     void SetOnDragLeaveId(const OnDropFunc& onDragLeaveId)
1004     {
1005         onDragLeaveId_ = onDragLeaveId;
1006     }
1007 
GetOnDropId()1008     const OnDropFunc& GetOnDropId() const
1009     {
1010         return onDropId_;
1011     }
1012 
SetOnDropId(const OnDropFunc & onDropId)1013     void SetOnDropId(const OnDropFunc& onDropId)
1014     {
1015         onDropId_ = onDropId;
1016     }
1017 
SetJsProxyCallback(JsProxyCallback && jsProxyCallback)1018     void SetJsProxyCallback(JsProxyCallback&& jsProxyCallback)
1019     {
1020         jsProxyCallback_ = std::move(jsProxyCallback);
1021     }
1022 
CallJsProxyCallback()1023     void CallJsProxyCallback()
1024     {
1025         if (jsProxyCallback_) {
1026             jsProxyCallback_();
1027         }
1028     }
1029 
SetOnInterceptKeyEventCallback(const PreKeyEventCallback & onPreKeyEventId)1030     void SetOnInterceptKeyEventCallback(const PreKeyEventCallback& onPreKeyEventId)
1031     {
1032         onPreKeyEvent_ = onPreKeyEventId;
1033     }
1034 
GetOnInterceptKeyEventCallback()1035     PreKeyEventCallback GetOnInterceptKeyEventCallback() const
1036     {
1037         return onPreKeyEvent_;
1038     }
1039 
SetOverScrollId(const EventMarker & overScrollId)1040     void SetOverScrollId(const EventMarker& overScrollId)
1041     {
1042         CHECK_NULL_VOID(declaration_);
1043         declaration_->SetOverScrollId(overScrollId);
1044     }
1045 
GetOverScrollId()1046     const EventMarker& GetOverScrollId() const
1047     {
1048         return declaration_->GetOverScrollId();
1049     }
1050 
SetNativeEmbedLifecycleChangeId(const EventMarker & embedLifecycleChangeId)1051     void SetNativeEmbedLifecycleChangeId(const EventMarker& embedLifecycleChangeId)
1052     {
1053         CHECK_NULL_VOID(declaration_);
1054         declaration_->SetNativeEmbedLifecycleChangeId(embedLifecycleChangeId);
1055     }
1056 
GetNativeEmbedLifecycleChangeId()1057     const EventMarker& GetNativeEmbedLifecycleChangeId() const
1058     {
1059         return declaration_->GetNativeEmbedLifecycleChangeId();
1060     }
1061 
SetNativeEmbedVisibilityChangeId(const EventMarker & embedVisibilityChangeId)1062     void SetNativeEmbedVisibilityChangeId(const EventMarker& embedVisibilityChangeId)
1063     {
1064         CHECK_NULL_VOID(declaration_);
1065         declaration_->SetNativeEmbedVisibilityChangeId(embedVisibilityChangeId);
1066     }
1067 
GetNativeEmbedVisibilityChangeId()1068     const EventMarker& GetNativeEmbedVisibilityChangeId() const
1069     {
1070         return declaration_->GetNativeEmbedVisibilityChangeId();
1071     }
1072 
SetNativeEmbedGestureEventId(const EventMarker & embedGestureEventId)1073     void SetNativeEmbedGestureEventId(const EventMarker& embedGestureEventId)
1074     {
1075         CHECK_NULL_VOID(declaration_);
1076         declaration_->SetNativeEmbedGestureEventId(embedGestureEventId);
1077     }
1078 
GetNativeEmbedGestureEventId()1079     const EventMarker& GetNativeEmbedGestureEventId() const
1080     {
1081         return declaration_->GetNativeEmbedGestureEventId();
1082     }
1083 
SetRenderProcessNotRespondingId(const EventMarker & renderNotRespondingId)1084     void SetRenderProcessNotRespondingId(const EventMarker& renderNotRespondingId)
1085     {
1086         CHECK_NULL_VOID(declaration_);
1087         declaration_->SetRenderProcessNotRespondingId(renderNotRespondingId);
1088     }
1089 
GetRenderProcessNotRespondingId()1090     const EventMarker& GetRenderProcessNotRespondingId() const
1091     {
1092         return declaration_->GetRenderProcessNotRespondingId();
1093     }
1094 
SetRenderProcessRespondingId(const EventMarker & renderRespondingId)1095     void SetRenderProcessRespondingId(const EventMarker& renderRespondingId)
1096     {
1097         CHECK_NULL_VOID(declaration_);
1098         declaration_->SetRenderProcessRespondingId(renderRespondingId);
1099     }
1100 
GetRenderProcessRespondingId()1101     const EventMarker& GetRenderProcessRespondingId() const
1102     {
1103         return declaration_->GetRenderProcessRespondingId();
1104     }
1105 
SetViewportFitChangedId(const EventMarker & viewportFitId)1106     void SetViewportFitChangedId(const EventMarker& viewportFitId)
1107     {
1108         CHECK_NULL_VOID(declaration_);
1109         declaration_->SetViewportFitChangedId(viewportFitId);
1110     }
1111 
GetViewportFitChangedId()1112     const EventMarker& GetViewportFitChangedId() const
1113     {
1114         return declaration_->GetViewportFitChangedId();
1115     }
1116 
SetAdsBlockedEventId(const EventMarker & adsBlockedEventId)1117     void SetAdsBlockedEventId(const EventMarker& adsBlockedEventId)
1118     {
1119         CHECK_NULL_VOID(declaration_);
1120         declaration_->SetAdsBlockedEventId(adsBlockedEventId);
1121     }
1122 
GetAdsBlockedEventId()1123     const EventMarker& GetAdsBlockedEventId() const
1124     {
1125         return declaration_->GetAdsBlockedEventId();
1126     }
1127 
SetOptimizeParserBudgetEnabled(bool enable)1128     void SetOptimizeParserBudgetEnabled(bool enable)
1129     {
1130         isParserBudgetOptimized_ = enable;
1131     }
1132 
GetOptimizeParserBudgetEnabled()1133     bool GetOptimizeParserBudgetEnabled() const
1134     {
1135         return isParserBudgetOptimized_;
1136     }
1137 
1138 private:
1139     RefPtr<WebDeclaration> declaration_;
1140     CreatedCallback createdCallback_ = nullptr;
1141     ReleasedCallback releasedCallback_ = nullptr;
1142     ErrorCallback errorCallback_ = nullptr;
1143     SetWebIdCallback setWebIdCallback_ = nullptr;
1144     SetHapPathCallback setHapPathCallback_ = nullptr;
1145     JsProxyCallback jsProxyCallback_ = nullptr;
1146     RefPtr<WebDelegate> delegate_;
1147     RefPtr<WebController> webController_;
1148     OnCommonDialogImpl onAlertImpl_;
1149     OnCommonDialogImpl onConfirmImpl_;
1150     OnCommonDialogImpl onPromptImpl_;
1151     OnCommonDialogImpl onBeforeUnloadImpl_;
1152     OnConsoleImpl consoleImpl_;
1153     OnFileSelectorShowImpl onFileSelectorShowImpl_;
1154     OnFullScreenEnterImpl onFullScreenEnterImpl_;
1155     OnUrlLoadInterceptImpl onUrlLoadInterceptImpl_;
1156     OnLoadInterceptImpl onLoadInterceptImpl_;
1157     OnOverrideUrlLoadingImpl onOverrideUrlLoadingImpl_;
1158     OnHttpAuthRequestImpl onHttpAuthRequestImpl_;
1159     OnSslErrorRequestImpl onSslErrorRequestImpl_;
1160     OnAllSslErrorRequestImpl onAllSslErrorRequestImpl_;
1161     OnSslSelectCertRequestImpl onSslSelectCertRequestImpl_;
1162     OnContextMenuImpl onContextMenuImpl_;
1163     OnContextMenuHideImpl onContextMenuHideImpl_;
1164     OnInterceptRequestImpl onInterceptRequestImpl_ = nullptr;
1165     OnProgressChangeImpl onProgressChangeImpl_ = nullptr;
1166     OnWindowNewImpl onWindowNewImpl_ = nullptr;
1167 
1168     std::string type_;
1169     bool incognitoMode_ = false;
1170     bool isJsEnabled_ = true;
1171     bool isContentAccessEnabled_ = true;
1172     bool isFileAccessEnabled_ = true;
1173     std::string userAgent_;
1174     std::string customScheme_;
1175     WeakPtr<FocusNode> focusElement_;
1176     bool isOnLineImageAccessEnabled_ = false;
1177     bool isDomStorageAccessEnabled_ = false;
1178     bool isImageAccessEnabled_ = true;
1179     MixedModeContent mixedContentMode_ = MixedModeContent::MIXED_CONTENT_NEVER_ALLOW;
1180     bool isZoomAccessEnabled_ = true;
1181     bool isGeolocationAccessEnabled_ = true;
1182     bool isOverviewModeAccessEnabled_ = true;
1183     bool isFileFromUrlAccessEnabled_ = false;
1184     bool isDatabaseAccessEnabled_ = false;
1185     int32_t textZoomRatioNum_ = DEFAULT_TEXT_ZOOM_RATIO;
1186     WebCacheMode cacheMode_ = WebCacheMode::DEFAULT;
1187     bool isWebDebuggingAccessEnabled_ = false;
1188     bool isMultiWindowAccessEnabled_ = false;
1189     bool isAllowWindowOpenMethod_ = false;
1190     OnMouseCallback onMouseEvent_;
1191     OnKeyEventCallback onKeyEvent_;
1192     float initialScale_ = 0;
1193     bool isInitialScaleSet_ = false;
1194     int32_t backgroundColor_ = 0;
1195     bool isBackgroundColor_ = false;
1196     bool isNeedGestureAccess_ = true;
1197     bool isNativeEmbedMode_ = false;
1198     bool isIntrinsicSize_ = false;
1199     std::string tag_;
1200     std::string tag_type_;
1201     OnDragFunc onDragStartId_;
1202     OnDropFunc onDragEnterId_;
1203     OnDropFunc onDragMoveId_;
1204     OnDropFunc onDragLeaveId_;
1205     OnDropFunc onDropId_;
1206     bool isPinchSmoothModeEnabled_ = false;
1207     PreKeyEventCallback onPreKeyEvent_;
1208     bool isPopup_ = false;
1209     int32_t parentNWebId_ = -1;
1210     OverScrollMode OverScrollMode_ = OverScrollMode::NEVER;
1211     CopyOptions CopyOptionMode_ = CopyOptions::Distributed;
1212     std::tuple<bool, bool> native_video_player_config_{false, false};
1213     std::string shared_render_process_token_;
1214     bool isParserBudgetOptimized_ = false;
1215 };
1216 
1217 } // namespace OHOS::Ace
1218 
1219 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_WEB_WEB_COMPONENT_H
1220