• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 MOCK_WINDOW_EXTENSION_SESSION_IMPL_H
17 #define MOCK_WINDOW_EXTENSION_SESSION_IMPL_H
18 
19 #include "mock_data_handler.h"
20 #include "window_extension_session_impl.h"
21 
22 namespace OHOS {
23 namespace Rosen {
24 class MockWindowExtensionSessionImpl : public WindowExtensionSessionImpl {
25 public:
MockWindowExtensionSessionImpl(const sptr<WindowOption> & option)26     MockWindowExtensionSessionImpl(const sptr<WindowOption>& option) : WindowExtensionSessionImpl(option) {}
~MockWindowExtensionSessionImpl()27     ~MockWindowExtensionSessionImpl() {}
28 
HideNonSecureWindows(bool shouldHide)29     WMError HideNonSecureWindows(bool shouldHide)
30     {
31         extensionWindowFlags_.hideNonSecureWindowsFlag = shouldHide;
32         return WMError::WM_OK;
33     }
34 
SetWaterMarkFlag(bool isEnable)35     WMError SetWaterMarkFlag(bool isEnable)
36     {
37         extensionWindowFlags_.waterMarkFlag = isEnable;
38         return WMError::WM_OK;
39     }
40 
IsPcWindow()41     bool IsPcWindow() const { return true; }
42 
IsPcOrPadFreeMultiWindowMode()43     bool IsPcOrPadFreeMultiWindowMode() const
44     {
45         return true;
46     }
47 
HidePrivacyContentForHost(bool needHide)48     WMError HidePrivacyContentForHost(bool needHide)
49     {
50         return WMError::WM_OK;
51     }
52 
GetExtensionDataHandler()53     std::shared_ptr<IDataHandler> GetExtensionDataHandler() const
54     {
55         return mockHandler_;
56     }
57 
58 private:
59     std::shared_ptr<IDataHandler> mockHandler_;
60 };
61 } // Rosen
62 } // OHOS
63 #endif