mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-27 09:00:55 +00:00
!3986 支持isTransferringCaller
Merge pull request !3986 from Cooper/test_nolog
This commit is contained in:
commit
33fcd36a08
@ -1092,7 +1092,8 @@ public:
|
||||
* @return WMError
|
||||
*/
|
||||
virtual WMError NapiSetUIContent(const std::string& contentInfo, napi_env env,
|
||||
napi_value storage, bool isDistributed = false, AppExecFwk::Ability* ability = nullptr)
|
||||
napi_value storage, bool isDistributed = false, sptr<IRemoteObject> token = nullptr,
|
||||
AppExecFwk::Ability* ability = nullptr)
|
||||
{
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
|
@ -1520,7 +1520,8 @@ static void LoadContentTask(std::shared_ptr<NativeReference> contentStorage, std
|
||||
if (isLoadedByName) {
|
||||
ret = WM_JS_TO_ERROR_CODE_MAP.at(weakWindow->SetUIContentByName(contextUrl, env, nativeStorage, ability));
|
||||
} else {
|
||||
ret = WM_JS_TO_ERROR_CODE_MAP.at(weakWindow->NapiSetUIContent(contextUrl, env, nativeStorage, false, ability));
|
||||
ret = WM_JS_TO_ERROR_CODE_MAP.at(
|
||||
weakWindow->NapiSetUIContent(contextUrl, env, nativeStorage, false, nullptr, ability));
|
||||
}
|
||||
if (ret == WmErrorCode::WM_OK) {
|
||||
task.Resolve(env, NapiGetUndefined(env));
|
||||
|
@ -201,7 +201,8 @@ public:
|
||||
virtual void NotifyTouchDialogTarget() = 0;
|
||||
virtual void SetAceAbilityHandler(const sptr<IAceAbilityHandler>& handler) = 0;
|
||||
virtual WMError NapiSetUIContent(const std::string& contentInfo, napi_env env,
|
||||
napi_value storage, bool isDistributed = false, AppExecFwk::Ability* ability = nullptr) = 0;
|
||||
napi_value storage, bool isDistributed = false, sptr<IRemoteObject> token = nullptr,
|
||||
AppExecFwk::Ability* ability = nullptr) = 0;
|
||||
virtual WMError SetUIContentByName(const std::string& contentInfo, napi_env env, napi_value storage,
|
||||
AppExecFwk::Ability* ability = nullptr)
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ public:
|
||||
void NotifyTouchDialogTarget() override;
|
||||
|
||||
virtual WMError NapiSetUIContent(const std::string& contentInfo, napi_env env,
|
||||
napi_value storage, bool isdistributed, AppExecFwk::Ability* ability) override;
|
||||
napi_value storage, bool isdistributed, sptr<IRemoteObject> token, AppExecFwk::Ability* ability) override;
|
||||
virtual std::string GetContentInfo() override;
|
||||
virtual const std::shared_ptr<AbilityRuntime::Context> GetContext() const override;
|
||||
virtual Ace::UIContent* GetUIContent() const override;
|
||||
|
@ -232,7 +232,7 @@ void WindowImpl::OnNewWant(const AAFwk::Want& want)
|
||||
}
|
||||
|
||||
WMError WindowImpl::NapiSetUIContent(const std::string& contentInfo,
|
||||
napi_env env, napi_value storage, bool isdistributed, AppExecFwk::Ability* ability)
|
||||
napi_env env, napi_value storage, bool isdistributed, sptr<IRemoteObject> token, AppExecFwk::Ability* ability)
|
||||
{
|
||||
WLOGFD("NapiSetUIContent: %{public}s", contentInfo.c_str());
|
||||
if (uiContent_) {
|
||||
|
@ -69,6 +69,9 @@ public:
|
||||
MOCK_METHOD3(CreateModalUIExtension, int32_t(const AAFwk::Want& want,
|
||||
const ModalUIExtensionCallbacks& callbacks, const ModalUIExtensionConfig& config));
|
||||
MOCK_METHOD1(CloseModalUIExtension, void(int32_t sessionId));
|
||||
MOCK_METHOD1(SetParentToken, void(sptr<IRemoteObject> token));
|
||||
MOCK_METHOD0(GetParentToken, sptr<IRemoteObject>());
|
||||
|
||||
};
|
||||
} // namespace Ace
|
||||
} // namespace OHOS
|
||||
|
@ -157,6 +157,7 @@ struct SessionInfo {
|
||||
bool isSystem_ = false;
|
||||
uint32_t windowType_ = 1; // WINDOW_TYPE_APP_MAIN_WINDOW
|
||||
sptr<IRemoteObject> callerToken_ = nullptr;
|
||||
sptr<IRemoteObject> rootToken_ = nullptr;
|
||||
|
||||
mutable std::shared_ptr<AAFwk::Want> want; // want for ability start
|
||||
std::shared_ptr<AAFwk::Want> closeAbilityWant;
|
||||
|
@ -59,6 +59,7 @@ sptr<AAFwk::SessionInfo> ExtensionSessionManager::SetAbilitySessionInfo(const sp
|
||||
sptr<ISession> iSession(extSession);
|
||||
abilitySessionInfo->sessionToken = iSession->AsObject();
|
||||
abilitySessionInfo->callerToken = sessionInfo.callerToken_;
|
||||
abilitySessionInfo->parentToken = sessionInfo.rootToken_;
|
||||
abilitySessionInfo->persistentId = extSession->GetPersistentId();
|
||||
if (sessionInfo.want != nullptr) {
|
||||
abilitySessionInfo->want = *sessionInfo.want;
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
void RegisterTransferComponentDataListener(const NotifyTransferComponentDataFunc& func) override;
|
||||
WMError SetPrivacyMode(bool isPrivacyMode) override;
|
||||
WMError NapiSetUIContent(const std::string& contentInfo, napi_env env,
|
||||
napi_value storage, bool isdistributed, AppExecFwk::Ability* ability) override;
|
||||
napi_value storage, bool isdistributed, sptr<IRemoteObject> token, AppExecFwk::Ability* ability) override;
|
||||
WSError UpdateRect(const WSRect& rect, SizeChangeReason reason,
|
||||
const std::shared_ptr<RSTransaction>& rsTransaction = nullptr) override;
|
||||
|
||||
|
@ -264,7 +264,7 @@ public:
|
||||
void NotifyForegroundInteractiveStatus(bool interactive);
|
||||
|
||||
virtual WMError NapiSetUIContent(const std::string& contentInfo, napi_env env,
|
||||
napi_value storage, bool isdistributed, AppExecFwk::Ability* ability) override;
|
||||
napi_value storage, bool isdistributed, sptr<IRemoteObject> token, AppExecFwk::Ability* ability) override;
|
||||
virtual WMError SetUIContentByName(const std::string& contentInfo, napi_env env, napi_value storage,
|
||||
AppExecFwk::Ability* ability) override;
|
||||
virtual std::string GetContentInfo() override;
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
WMError Destroy() override;
|
||||
virtual WMError Destroy(bool needNotifyServer, bool needClearListener = true);
|
||||
WMError NapiSetUIContent(const std::string& contentInfo, napi_env env,
|
||||
napi_value storage, bool isdistributed, AppExecFwk::Ability* ability) override;
|
||||
napi_value storage, bool isdistributed, sptr<IRemoteObject> token, AppExecFwk::Ability* ability) override;
|
||||
WMError SetUIContentByName(const std::string& contentInfo, napi_env env, napi_value storage,
|
||||
AppExecFwk::Ability* ability) override;
|
||||
std::shared_ptr<RSSurfaceNode> GetSurfaceNode() const override;
|
||||
|
@ -163,7 +163,7 @@ void WindowExtensionSessionImpl::NotifyConfigurationUpdated()
|
||||
}
|
||||
|
||||
WMError WindowExtensionSessionImpl::NapiSetUIContent(const std::string& contentInfo,
|
||||
napi_env env, napi_value storage, bool isdistributed, AppExecFwk::Ability* ability)
|
||||
napi_env env, napi_value storage, bool isdistributed, sptr<IRemoteObject> token, AppExecFwk::Ability* ability)
|
||||
{
|
||||
WLOGFD("WindowExtensionSessionImpl NapiSetUIContent: %{public}s state:%{public}u", contentInfo.c_str(), state_);
|
||||
if (uiContent_) {
|
||||
@ -179,6 +179,7 @@ WMError WindowExtensionSessionImpl::NapiSetUIContent(const std::string& contentI
|
||||
WLOGFE("fail to NapiSetUIContent id: %{public}d", GetPersistentId());
|
||||
return WMError::WM_ERROR_NULLPTR;
|
||||
}
|
||||
uiContent->SetParentToken(token);
|
||||
uiContent->Initialize(this, contentInfo, storage, property_->GetParentId());
|
||||
// make uiContent available after Initialize/Restore
|
||||
uiContent_ = std::move(uiContent);
|
||||
|
@ -528,7 +528,7 @@ void WindowImpl::OnNewWant(const AAFwk::Want& want)
|
||||
}
|
||||
|
||||
WMError WindowImpl::NapiSetUIContent(const std::string& contentInfo, napi_env env, napi_value storage,
|
||||
bool isdistributed, AppExecFwk::Ability* ability)
|
||||
bool isdistributed, sptr<IRemoteObject> token, AppExecFwk::Ability* ability)
|
||||
{
|
||||
return SetUIContentInner(contentInfo, env, storage, isdistributed, false, ability);
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ void WindowSessionImpl::UpdateTitleButtonVisibility()
|
||||
}
|
||||
|
||||
WMError WindowSessionImpl::NapiSetUIContent(const std::string& contentInfo, napi_env env, napi_value storage,
|
||||
bool isdistributed, AppExecFwk::Ability* ability)
|
||||
bool isdistributed, sptr<IRemoteObject> token, AppExecFwk::Ability* ability)
|
||||
{
|
||||
return SetUIContentInner(contentInfo, env, storage, isdistributed, false, ability);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user