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 #include "window_extension_module_loader.h"
17
18 #include "window_extension.h"
19 #include "window_manager_hilog.h"
20
21 namespace OHOS::Rosen {
22 namespace {
23 constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowExtensionStub"};
24 }
25 WindowExtensionModuleLoader::WindowExtensionModuleLoader() = default;
26 WindowExtensionModuleLoader::~WindowExtensionModuleLoader() = default;
27
Create(const std::unique_ptr<AbilityRuntime::Runtime> & runtime) const28 AbilityRuntime::Extension *WindowExtensionModuleLoader::Create(
29 const std::unique_ptr<AbilityRuntime::Runtime>& runtime) const
30 {
31 WLOGI("called");
32 return WindowExtension::Create(runtime);
33 }
34
GetParams()35 std::map<std::string, std::string> WindowExtensionModuleLoader::GetParams()
36 {
37 std::map<std::string, std::string> params;
38 // type means extension type in ExtensionAbilityType of extension_ability_info.h, 10 means window.
39 params.insert(std::pair<std::string, std::string>("type", "10"));
40 // extension name
41 params.insert(std::pair<std::string, std::string>("name", "WindowExtension"));
42 WLOGI("called");
43 return params;
44 }
45
OHOS_EXTENSION_GetExtensionModule()46 extern "C" __attribute__((visibility("default"))) void* OHOS_EXTENSION_GetExtensionModule()
47 {
48 WLOGI("called");
49 return &WindowExtensionModuleLoader::GetInstance();
50 }
51 } // namespace OHOS::Window
52
53