mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 15:10:30 +00:00
commit
f88aad36af
@ -588,6 +588,7 @@ void FormPattern::OnModifyDone()
|
||||
layoutProperty->UpdateRequestFormInfo(info);
|
||||
UpdateBackgroundColorWhenUnTrustForm();
|
||||
info.obscuredMode = isFormObscured_;
|
||||
info.obscuredMode |= CheckFormBundleForbidden(info.bundleName);
|
||||
HandleFormComponent(info);
|
||||
}
|
||||
|
||||
@ -615,6 +616,7 @@ bool FormPattern::OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, c
|
||||
|
||||
UpdateBackgroundColorWhenUnTrustForm();
|
||||
info.obscuredMode = isFormObscured_;
|
||||
info.obscuredMode |= CheckFormBundleForbidden(info.bundleName);
|
||||
HandleFormComponent(info);
|
||||
return false;
|
||||
}
|
||||
@ -680,7 +682,7 @@ void FormPattern::AddFormComponent(const RequestFormInfo& info)
|
||||
#else
|
||||
formManagerBridge_->AddForm(host->GetContextRefPtr(), info);
|
||||
#endif
|
||||
if (formManagerBridge_->CheckFormBundleForbidden(info.bundleName)) {
|
||||
if (CheckFormBundleForbidden(info.bundleName)) {
|
||||
LoadDisableFormStyle(info);
|
||||
}
|
||||
}
|
||||
@ -1893,4 +1895,10 @@ void FormPattern::UnregisterAccessibility()
|
||||
CHECK_NULL_VOID(formNode);
|
||||
formNode->ClearAccessibilityChildTreeRegisterFlag();
|
||||
}
|
||||
|
||||
bool FormPattern::CheckFormBundleForbidden(const std::string &bundleName)
|
||||
{
|
||||
CHECK_NULL_RETURN(formManagerBridge_, false);
|
||||
return formManagerBridge_->CheckFormBundleForbidden(bundleName);
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
||||
|
@ -208,6 +208,7 @@ private:
|
||||
bool IsMaskEnableForm(const RequestFormInfo &info);
|
||||
void UpdateChildNodeOpacity(FormChildNodeType formChildNodeType, double opacity);
|
||||
void SnapshotSurfaceNode();
|
||||
bool CheckFormBundleForbidden(const std::string &bundleName);
|
||||
// used by ArkTS Card, for RSSurfaceNode from FRS,
|
||||
RefPtr<RenderContext> externalRenderContext_;
|
||||
|
||||
|
@ -1526,4 +1526,18 @@ HWTEST_F(FormTestNg, SnapshotSurfaceNode, TestSize.Level1)
|
||||
pattern->SnapshotSurfaceNode();
|
||||
ASSERT_NE(host, nullptr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: CheckFormBundleForbidden
|
||||
* @tc.desc: Test CheckFormBundleForbidden in Form Pattern.
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(FormTestNg, CheckFormBundleForbidden, TestSize.Level1)
|
||||
{
|
||||
RefPtr<FrameNode> frameNode = CreateFromNode();
|
||||
auto pattern = frameNode->GetPattern<FormPattern>();
|
||||
ASSERT_NE(pattern, nullptr);
|
||||
bool isForbidden = pattern->CheckFormBundleForbidden("MyBundleName");
|
||||
ASSERT_EQ(isForbidden, false);
|
||||
}
|
||||
} // namespace OHOS::Ace::NG
|
||||
|
Loading…
Reference in New Issue
Block a user