1e0dac50fSopenharmony_ci/*
2e0dac50fSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
3e0dac50fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4e0dac50fSopenharmony_ci * you may not use this file except in compliance with the License.
5e0dac50fSopenharmony_ci * You may obtain a copy of the License at
6e0dac50fSopenharmony_ci *
7e0dac50fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8e0dac50fSopenharmony_ci *
9e0dac50fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10e0dac50fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11e0dac50fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12e0dac50fSopenharmony_ci * See the License for the specific language governing permissions and
13e0dac50fSopenharmony_ci * limitations under the License.
14e0dac50fSopenharmony_ci */
15e0dac50fSopenharmony_ci
16e0dac50fSopenharmony_ci#include "extension_window_impl.h"
17e0dac50fSopenharmony_ci#include "window_manager_hilog.h"
18e0dac50fSopenharmony_ci#include "wm_common.h"
19e0dac50fSopenharmony_ci
20e0dac50fSopenharmony_cinamespace OHOS {
21e0dac50fSopenharmony_cinamespace Rosen {
22e0dac50fSopenharmony_cinamespace {
23e0dac50fSopenharmony_ciconstexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "ExtensionWindowImpl"};
24e0dac50fSopenharmony_ci}
25e0dac50fSopenharmony_ci
26e0dac50fSopenharmony_ciRosen::ExtensionWindowImpl::ExtensionWindowImpl(sptr<Window> sessionImpl)
27e0dac50fSopenharmony_ci    : windowExtensionSessionImpl_(sessionImpl) {
28e0dac50fSopenharmony_ci}
29e0dac50fSopenharmony_ci
30e0dac50fSopenharmony_ciExtensionWindowImpl::~ExtensionWindowImpl() {}
31e0dac50fSopenharmony_ci
32e0dac50fSopenharmony_ciWMError ExtensionWindowImpl::GetAvoidAreaByType(AvoidAreaType type, AvoidArea& avoidArea)
33e0dac50fSopenharmony_ci{
34e0dac50fSopenharmony_ci    WLOGI("GetAvoidAreaByType is called");
35e0dac50fSopenharmony_ci    return windowExtensionSessionImpl_->GetAvoidAreaByType(type, avoidArea);
36e0dac50fSopenharmony_ci}
37e0dac50fSopenharmony_ci
38e0dac50fSopenharmony_cisptr<Window> ExtensionWindowImpl::GetWindow()
39e0dac50fSopenharmony_ci{
40e0dac50fSopenharmony_ci    return windowExtensionSessionImpl_;
41e0dac50fSopenharmony_ci}
42e0dac50fSopenharmony_ci
43e0dac50fSopenharmony_ciWMError ExtensionWindowImpl::HideNonSecureWindows(bool shouldHide)
44e0dac50fSopenharmony_ci{
45e0dac50fSopenharmony_ci    TLOGI(WmsLogTag::WMS_UIEXT, "HideNonSecureWindows is called");
46e0dac50fSopenharmony_ci    return windowExtensionSessionImpl_->HideNonSecureWindows(shouldHide);
47e0dac50fSopenharmony_ci}
48e0dac50fSopenharmony_ci
49e0dac50fSopenharmony_ciWMError ExtensionWindowImpl::SetWaterMarkFlag(bool isEnable)
50e0dac50fSopenharmony_ci{
51e0dac50fSopenharmony_ci    TLOGI(WmsLogTag::WMS_UIEXT, "SetWaterMarkFlag is called");
52e0dac50fSopenharmony_ci    return windowExtensionSessionImpl_->SetWaterMarkFlag(isEnable);
53e0dac50fSopenharmony_ci}
54e0dac50fSopenharmony_ci
55e0dac50fSopenharmony_cibool ExtensionWindowImpl::IsPcOrPadFreeMultiWindowMode() const
56e0dac50fSopenharmony_ci{
57e0dac50fSopenharmony_ci    TLOGI(WmsLogTag::WMS_UIEXT, "in");
58e0dac50fSopenharmony_ci    return windowExtensionSessionImpl_->IsPcOrPadFreeMultiWindowMode();
59e0dac50fSopenharmony_ci}
60e0dac50fSopenharmony_ci
61e0dac50fSopenharmony_ciWMError ExtensionWindowImpl::HidePrivacyContentForHost(bool needHide)
62e0dac50fSopenharmony_ci{
63e0dac50fSopenharmony_ci    TLOGD(WmsLogTag::WMS_UIEXT, "enter");
64e0dac50fSopenharmony_ci    return windowExtensionSessionImpl_->HidePrivacyContentForHost(needHide);
65e0dac50fSopenharmony_ci}
66e0dac50fSopenharmony_ci
67e0dac50fSopenharmony_ci} // namespace Rosen
68e0dac50fSopenharmony_ci} // namespace OHOS
69