2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include "common/application_data.h"
22 #include "common/command_line.h"
23 #include "runtime/common/constants.h"
24 #include "runtime/browser/runtime.h"
25 #include "runtime/browser/ui_runtime.h"
26 #ifdef IME_FEATURE_SUPPORT
27 #include "runtime/browser/ime_runtime.h"
28 #endif // IME_FEATURE_SUPPORT
29 #ifdef WATCH_FACE_FEATURE_SUPPORT
30 #include "runtime/browser/watch_runtime.h"
31 #endif // WATCH_FACE_FEATURE_SUPPORT
38 std::unique_ptr<Runtime> Runtime::MakeRuntime(
39 common::ApplicationData* app_data) {
40 if (app_data->app_type() == common::ApplicationData::UI) {
41 return std::unique_ptr<Runtime>(new UiRuntime(app_data));
43 #ifdef IME_FEATURE_SUPPORT
44 else if (app_data->app_type() == common::ApplicationData::IME) {
45 return std::unique_ptr<Runtime>(new ImeRuntime(app_data));
47 #endif // IME_FEATURE_SUPPORT
48 #ifdef WATCH_FACE_FEATURE_SUPPORT
49 else if (app_data->app_type() == common::ApplicationData::WATCH) {
50 return std::unique_ptr<Runtime>(new WatchRuntime(app_data));
52 #endif // WATCH_FACE_FEATURE_SUPPORT
54 return std::unique_ptr<Runtime>(new UiRuntime(app_data));
59 } // namespace runtime