1 /*
2  * Copyright (c) 2022 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 ARK_SYSTEM_PROPERTIES_ADAPTER_WRAPPER_H
17 #define ARK_SYSTEM_PROPERTIES_ADAPTER_WRAPPER_H
18 #pragma once
19 
20 #include "adapter_base.h"
21 #include "ohos_adapter/include/ark_system_properties_adapter.h"
22 #include "system_properties_adapter.h"
23 
24 namespace OHOS::ArkWeb {
25 
26 class ArkSystemPropertiesAdapterWrapper : public OHOS::NWeb::SystemPropertiesAdapter {
27 public:
28     explicit ArkSystemPropertiesAdapterWrapper(ArkWebRefPtr<ArkSystemPropertiesAdapter>);
29 
30     bool GetResourceUseHapPathEnable() override;
31 
32     std::string GetDeviceInfoProductModel() override;
33 
34     std::string GetDeviceInfoBrand() override;
35 
36     int32_t GetDeviceInfoMajorVersion() override;
37 
38     OHOS::NWeb::ProductDeviceType GetProductDeviceType() override;
39 
40     bool GetWebOptimizationValue() override;
41 
42     bool IsAdvancedSecurityMode() override;
43 
44     std::string GetUserAgentOSName() override;
45 
46     std::string GetUserAgentOSVersion() override;
47 
48     std::string GetUserAgentBaseOSName() override;
49 
50     int32_t GetSoftwareMajorVersion() override;
51 
52     int32_t GetSoftwareSeniorVersion() override;
53 
54     std::string GetNetlogMode() override;
55 
56     bool GetTraceDebugEnable() override;
57 
58     std::string GetSiteIsolationMode() override;
59 
60     int32_t GetFlowBufMaxFd() override;
61 
62     bool GetOOPGPUEnable() override;
63 
64     void SetOOPGPUDisable() override;
65 
66     void AttachSysPropObserver(NWeb::PropertiesKey, NWeb::SystemPropertiesObserver* observer) override;
67 
68     void DetachSysPropObserver(NWeb::PropertiesKey, NWeb::SystemPropertiesObserver* observer) override;
69 
70     bool GetBoolParameter(const std::string& key, bool defaultValue) override;
71 
72     std::vector<NWeb::FrameRateSetting> GetLTPOConfig(const std::string& settingName) override;
73 
74     std::string GetOOPGPUStatus() override;
75 
76 private:
77     ArkWebRefPtr<ArkSystemPropertiesAdapter> ctocpp_;
78 };
79 
80 } // namespace OHOS::ArkWeb
81 
82 #endif // ARK_SYSTEM_PROPERTIES_ADAPTER_WRAPPER_H
83