1/* 2 * Copyright (c) 2023 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#include "extension_window_impl.h" 17#include "window_manager_hilog.h" 18#include "wm_common.h" 19 20namespace OHOS { 21namespace Rosen { 22namespace { 23constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "ExtensionWindowImpl"}; 24} 25 26Rosen::ExtensionWindowImpl::ExtensionWindowImpl(sptr<Window> sessionImpl) 27 : windowExtensionSessionImpl_(sessionImpl) { 28} 29 30ExtensionWindowImpl::~ExtensionWindowImpl() {} 31 32WMError ExtensionWindowImpl::GetAvoidAreaByType(AvoidAreaType type, AvoidArea& avoidArea) 33{ 34 WLOGI("GetAvoidAreaByType is called"); 35 return windowExtensionSessionImpl_->GetAvoidAreaByType(type, avoidArea); 36} 37 38sptr<Window> ExtensionWindowImpl::GetWindow() 39{ 40 return windowExtensionSessionImpl_; 41} 42 43WMError ExtensionWindowImpl::HideNonSecureWindows(bool shouldHide) 44{ 45 TLOGI(WmsLogTag::WMS_UIEXT, "HideNonSecureWindows is called"); 46 return windowExtensionSessionImpl_->HideNonSecureWindows(shouldHide); 47} 48 49WMError ExtensionWindowImpl::SetWaterMarkFlag(bool isEnable) 50{ 51 TLOGI(WmsLogTag::WMS_UIEXT, "SetWaterMarkFlag is called"); 52 return windowExtensionSessionImpl_->SetWaterMarkFlag(isEnable); 53} 54 55bool ExtensionWindowImpl::IsPcOrPadFreeMultiWindowMode() const 56{ 57 TLOGI(WmsLogTag::WMS_UIEXT, "in"); 58 return windowExtensionSessionImpl_->IsPcOrPadFreeMultiWindowMode(); 59} 60 61WMError ExtensionWindowImpl::HidePrivacyContentForHost(bool needHide) 62{ 63 TLOGD(WmsLogTag::WMS_UIEXT, "enter"); 64 return windowExtensionSessionImpl_->HidePrivacyContentForHost(needHide); 65} 66 67} // namespace Rosen 68} // namespace OHOS 69