}
#endif
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
pid_t ZygoteCommunication::GetZygotePid() {
return pid_;
}
void DropProcessPrivileges(const std::string& app_id);
#endif
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
pid_t GetZygotePid();
#endif
#include "wrt/src/app/runtime.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#include "build/build_config.h"
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/app/tv/ui_runtime_tv.h"
#else
#include "wrt/src/app/ime_runtime.h"
// static
std::unique_ptr<Runtime> Runtime::MakeRuntime() {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
return std::unique_ptr<Runtime>(new UiRuntimeTV());
#else
auto& app_data = ApplicationData::GetInstance();
void UiRuntime::OnTerminate() {
LOG(INFO) << "OnTerminate()";
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
for (auto* window : electron::WindowList::GetWindows())
window->SetEnabled(true);
#endif
#include "wrt/src/common/application_data.h"
#include "wrt/src/common/constants.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/app/tv/wrt_main_delegate_tv.h"
#else
#include "wrt/src/app/wrt_main_delegate.h"
const char* appid, const char* pkgid,
const char* pkg_type, void* user_data) {
LOG(INFO) << "loader prelaunch";
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
base::CommandLine::ForCurrentProcess()->SetProgram(
base::FilePath(app_path));
auto* content_main = static_cast<Loader*>(user_data)->content_main_;
};
WRTContentMain::WRTContentMain()
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
: main_delegate_(new WRTMainDelegateTV) {}
#else
: main_delegate_(new WRTMainDelegate) {}
#include <cstdlib>
#include <system_info.h>
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include <usb-device.h>
#include "base/logging.h"
namespace {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
const int kDiskCacheSizeUnit = 1048576; // MB
const int k8KPanelWidth = 7680;
const int k8KPanelHeight = 4320;
return profile;
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
bool HasSystemMultitaskingSupport() {
bool systemSupport = true;
if (SYSTEM_INFO_ERROR_NONE != system_info_get_custom_bool(
#include <list>
#include <string>
+#include "build/build_config.h"
+
namespace wrt {
enum ProfileType {
enum ProfileType GetProfile();
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
bool HasSystemMultitaskingSupport();
int GetProductDiskCacheSize();
bool GetPanelResolution(int* width, int* height);
#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
#include "v8/include/v8.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include <autoinput.h>
#undef SUCCESS
#include <message_port.h>
namespace {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
const char* kDefaultBrowserApp = "org.tizen.browser";
const char* kServiceBrokerApp = "org.tizen.wrt.service.broker-app-service";
const char* kServiceBrokerPort = "message.port.wrt-service-broker";
app_control_destroy(appHandle);
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void MDEExtension::InitVirtualEventGenerator(int type) {
if (type == 0) {
VirtualKey_Initialize(nullptr);
gin::ObjectTemplateBuilder MDEExtension::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<MDEExtension>::GetObjectTemplateBuilder(isolate)
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
.SetMethod("initVirtualEventGenerator",
&MDEExtension::InitVirtualEventGenerator)
.SetMethod("deInitVirtualEventGenerator",
private:
void LaunchBrowserFromUrl(const std::string& url);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void InitVirtualEventGenerator(int type);
void DeInitVirtualEventGenerator(int type);
void GenerateVirtualKeyEvent(int keycode, int state);
#include "wrt/src/browser/wrt_web_contents.h"
#include "wrt/src/common/application_data.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/popup.h"
#include "wrt/src/browser/tv/native_web_runtime_delegate_tv.h"
#endif
const std::u16string& message,
int32_t line_no,
const std::u16string& source_id) {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
return false;
#else
return Emit("console-message", static_cast<int32_t>(level), message, line_no,
#if !defined(WRT_JS_BRINGUP)
void WebContents::WillDraw(int new_rotation, gfx::Size frame_data_output_size) {
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
if (!IsMobileProfile())
return;
#endif
}
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void WebContents::ShowMicOpenedNotification(bool show) {
if (show) {
auto pcm_title =
#if !defined(WRT_JS_BRINGUP)
void WillDraw(int new_rotation, gfx::Size frame_data_output_size) override;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void ShowMicOpenedNotification(bool show) override;
#endif
#endif
#include "wrt/src/browser/api/wrt_api_da_extension.h"
#endif
#include "wrt/src/browser/api/wrt_api_mde_extension.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/api/tv/wrt_api_tv_extension.h"
#endif
std::string host = origin.host();
if (host.empty())
host = popup_string::kPopupBodyLocalHost;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
std::string body_text =
popup_string::GetText(popup_string::kPopupBodyWebNotification);
#else
return "wearable";
#endif
else if (IsTvProfile())
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
return "product_tv";
#else
return "tv";
return v8::Local<v8::Value>::New(isolate, security_extension_);
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
v8::Local<v8::Value> WebRuntime::TVExtension(v8::Isolate* isolate) {
if (tv_extension_.IsEmpty()) {
auto handle = TVExtension::Create(isolate);
#endif
object_builder.SetProperty("mde", &WebRuntime::MDEExtension);
object_builder.SetProperty("security", &WebRuntime::SecurityExtension);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
object_builder.SetProperty("tv", &WebRuntime::TVExtension);
#endif
WebRuntimeCommon::UpdateObjectTemplateBuilder(object_builder);
v8::Local<v8::Value> SecurityExtension(v8::Isolate* isolate);
v8::Global<v8::Value> security_extension_;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
v8::Local<v8::Value> TVExtension(v8::Isolate* isolate);
v8::Global<v8::Value> tv_extension_;
#endif
#include "wrt/src/base/file_utils.h"
#include "wrt/src/base/string_utils.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
#include "wrt/src/common/application_data.h"
#endif
}
bool NativeAppControl::SendLaunchRequest() {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
auto& app_data = ApplicationData::GetInstance();
std::string vconfValue = "AppID:" + app_data.app_id() + ", URL is blocked.";
LOG(ERROR) << "key: rtc/memory/WebApp/LaunchFail value: " << vconfValue;
#include "wrt/src/common/wrt_profile_delegate.h"
#include "wrt/xwalk_extensions/browser/xwalk_extension_manager.h"
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/vibration_manager.h"
#endif
extension_manager->LoadUserExtensions(app_data.application_path());
#endif
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
VibrationManager::CreateInstance();
SetupTizenCompatibility();
#endif
} // namespace
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
std::vector<std::string> allowed_path_list;
std::vector<std::string> allowed_sub_path_list;
WRTFileURLLoader() = default;
~WRTFileURLLoader() override = default;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
bool IsAllowedPath(const base::FilePath& path) {
for (auto allowed_path : allowed_path_list) {
if (base::StartsWith(path.value(), allowed_path,
return;
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
if (!IsAllowedPath(path)) {
OnClientComplete(net::ERR_ACCESS_DENIED);
return;
};
void InitializeWRTFileURLLoader() {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
SetAllowedPath();
#endif
}
#include "content/browser/data_url_loader_factory.h"
#include "wrt/src/browser/net/wrt_file_url_loader.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/net/tv/encrypted_file_url_loader.h"
#endif
namespace {
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
WRTProxyingURL ParseURLInternal(const GURL& url) {
std::string url_str = url.possibly_invalid_spec();
std::string orignal_str = url_str;
<< "] was blocked by WARP";
return GURL("about:blank");
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
return ParseEncryptedURL(url);
#else
return ParseURLInternal(url);
if (parsed_url.is_valid())
request.url = parsed_url;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
if (proxying_url.encrypted()) {
CreateEncryptedFileURLLoader(
request, std::move(loader), std::move(client));
#include "wrt/src/browser/popup_string.h"
#include "wrt/src/common/constants.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include <aul.h>
#include <algorithm>
#include <memory>
const char* kContentTitle = "title,text";
const char* kContentText = nullptr;
-#ifdef OS_TIZEN_TV_PRODUCT
+#if BUILDFLAG(IS_TIZEN_TV)
const char* kStylePopup = "C_PopupBasic_WhiteBottom";
const char* kStyleCheck = "C_Checkbox_WhiteText";
#else
const char* kStylePopup = "default";
const char* kStyleCheck = "default";
-#endif // OS_TIZEN_TV_PRODUCT
+#endif // IS_TIZEN_TV
const char* kStyleButtonLeft = "popup";
const char* kStyleButtonRight = "popup";
#endif // OS_TIZEN_WEARABLE_PRODUCT
const char* kStateActivated = "activated";
const char* kStateClicked = "clicked";
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
const char* kStateFocused = "focused";
const char* kWRTEdjeFile = "wrtjs_tizen.edj";
const unsigned int kTimeout = 60; // second
std::vector<std::unique_ptr<Popup>> opened_popups;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
int syspopup_pid_ = -1;
static void EntryKeyDownCallback(void* data,
Evas_Object* check = elm_check_add(parent);
elm_object_style_set(check, kStyleCheck);
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
-#if !defined(OS_TIZEN_WEARABLE_PRODUCT) && !defined(OS_TIZEN_TV_PRODUCT)
+#if !defined(OS_TIZEN_WEARABLE_PRODUCT) && !BUILDFLAG(IS_TIZEN_TV)
elm_object_style_set(check, "multiline");
-#endif // OS_TIZEN_WEARABLE_PRODUCT and OS_TIZEN_TV_PRODUCT
+#endif // OS_TIZEN_WEARABLE_PRODUCT and IS_TIZEN_TV
elm_check_state_set(check, EINA_FALSE);
return check;
}
// static
std::unique_ptr<Popup> Popup::CreatePopup(Evas_Object* window) {
Evas_Object* popup = elm_popup_add(window);
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
#endif
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
#ifdef OS_TIZEN_WEARABLE_PRODUCT
elm_object_part_content_set(layout, "elm.swallow.content", box);
-#elif OS_TIZEN_TV_PRODUCT
+#elif BUILDFLAG(IS_TIZEN_TV)
Evas_Object* table = elm_table_add(popup);
if (!table) {
LOG(ERROR) << "Failed to Create Table";
void Popup::Show(std::unique_ptr<Popup> popup) {
evas_object_show(popup->popup_);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
(popup->timeout_timer_)
.Start(FROM_HERE, base::Seconds(kTimeout), popup.get(), &Popup::Timeout);
#endif
break;
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
if (button2_) {
auto focused_callback = [](void* instance, Evas_Object* button,
void* /*eventInfo*/) {
elm_object_signal_emit(entry, kSignalEdit, "");
elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_NONE);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN,
EntryKeyDownCallback, this);
#endif
evas_object_show(entry);
Evas_Object* layout = elm_layout_add(box_);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
base::FilePath edje_dir;
base::PathService::Get(PathsEfl::EDJE_RESOURCE_DIR, &edje_dir);
elm_layout_file_set(layout, (edje_dir.value() + "/" + kWRTEdjeFile).c_str(),
std::move(handler_).Run(is_positive, is_checked, entry1, entry2);
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void Popup::ShowVoiceRecognitionToast(const std::string& app_title) {
bool font_except = false;
std::string lang = LocaleManager::GetSystemLocale();
#include "base/callback.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "base/timer/timer.h"
#endif
void SetResultHandler(ResultHandler handler);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
static void ShowVoiceRecognitionToast(const std::string& app_title);
static void HideVoiceRecognitionToast();
void Hide();
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void Timeout();
base::OneShotTimer timeout_timer_;
#include "wrt/src/common/constants.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/base/string_utils.h"
#endif
namespace wrt {
namespace popup_string {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
const char kPopupTitleAuthRequest[] = "COM_MRMS_CBAGT_MAIN";
const char kPopupTitleCert[] = "COM_SID_WEBAPP_CERTIFICATE_INFO";
const char kPopupTitleWebNotification[] = "COM_SID_WEBAPP_WEB_NOTIFICATION";
return dgettext(kTextDomainRuntime, msg_id.c_str());
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
std::string GetTextAndReplace(const std::string& msg_id,
const std::string& replacement) {
std::string text = dgettext(kTextDomainRuntime, msg_id.c_str());
#include <initializer_list>
#include <string>
+#include "build/build_config.h"
+
namespace wrt {
namespace popup_string {
extern const char kPopupButtonDeny[];
extern const char kPopupBodyLocalHost[];
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
extern const char kPressButtonSearch[];
extern const char kSpeechRecognition[];
extern const char kMicIcon[];
std::string GetText(const std::string& msg_id);
std::string replacePS(std::initializer_list<std::string> strs);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
std::string GetTextAndReplace(const std::string& msg_id,
const std::string& replacement);
#endif
#include "wrt/src/browser/wrt_native_window.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/tv/video_splash_screen.h"
#endif
splash_screen_->SetBackground(screen_data, window, dimensions, app_path);
splash_screen_->SetImage(screen_data, window, dimensions, app_path);
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
if (app_data.video_splash_screen_info().HasVideoSplashScreenData() &&
VideoSplashScreen::IsVSSPlaying()) {
splash_screen_.reset(new VideoSplashScreen);
#include "content/browser/accessibility/browser_accessibility_state_impl.h"
#endif
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/tv/native_web_runtime_delegate_tv.h"
#endif
wrt_web_contents->HidePopupMenuImpl();
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
bool WRTSelectPickerTv::GetSpatialNavigationSettings() {
return NativeWebRuntimeDelegateTV::GetInstance()
.IsSpatialNavigationMetaTagSet();
// SelectPickerTvBase
void HidePopupMenu() override;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
bool GetSpatialNavigationSettings() override;
#endif
Eina_Rectangle GetLastUsedViewPortArea() override;
#include "extensions/browser/extension_registry.h"
#endif
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "url/url_constants.h"
#endif
#if !defined(WRT_JS_BRINGUP)
-#if defined(OS_TIZEN_TV_PRODUCT) || defined(ENABLE_TIZEN_SOCKETS)
+#if BUILDFLAG(IS_TIZEN_TV) || defined(ENABLE_TIZEN_SOCKETS)
#include "tizen_src/chromium_impl/services/sockets/public/cpp/manifest.h"
#include "tizen_src/chromium_impl/services/sockets/public/mojom/constants.mojom.h"
#include "tizen_src/chromium_impl/services/sockets/public/mojom/host_resolver_tizen.mojom.h"
apply_pref(prefs->ai_zoom_default_animation, kAiZoomAnimationKey);
#endif
-#if defined(OS_TIZEN_TV_PRODUCT) && !defined(WRT_JS_BRINGUP)
+#if BUILDFLAG(IS_TIZEN_TV) && !defined(WRT_JS_BRINGUP)
if (!ApplicationData::GetInstance().IsElectronApp()) {
prefs->additional_shared_array_buffer_schemes.emplace_back(url::kFileScheme);
}
content::RenderProcessHost* render_process_host,
mojo::GenericPendingReceiver receiver) {
#if !defined(WRT_JS_BRINGUP)
-#if defined(OS_TIZEN_TV_PRODUCT) || defined(ENABLE_TIZEN_SOCKETS)
+#if BUILDFLAG(IS_TIZEN_TV) || defined(ENABLE_TIZEN_SOCKETS)
if (auto r = receiver.As<sockets::mojom::SocketFactoryTizen>()) {
sockets::BindSocketFactoryTizen(std::move(r));
return;
sockets::BindHostResolverTizen(std::move(r));
return;
}
-#endif // defined(OS_TIZEN_TV_PRODUCT) || defined(ENABLE_TIZEN_SOCKETS)
+#endif // BUILDFLAG(IS_TIZEN_TV) || defined(ENABLE_TIZEN_SOCKETS)
#endif
#if defined(SAMSUNG_ELEMENTARY_MEDIA_STREAM_SOURCE)
base::Value::Dict options)
: electron::ElectronBrowserContext(
partition, in_memory, std::move(options))
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
,
web_cache_manager_(this)
#endif
base::BindOnce([](uint32_t num_deleted) {}));
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void WRTBrowserContext::ClearWebCache() {
web_cache_manager_.ClearCache();
}
#include "electron/shell/browser/electron_browser_context.h"
#include "extensions/buildflags/buildflags.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "tizen_src/ewk/efl_integration/browser/web_cache_efl/web_cache_manager_efl.h"
#endif
WRTSpecialStoragePolicy* GetWRTSpecialStoragePolicy();
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void ClearWebCache();
#endif
scoped_refptr<WRTSpecialStoragePolicy> wrt_special_storage_policy_;
std::unique_ptr<content::BackgroundSyncController>
background_sync_controller_;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
WebCacheManagerEfl web_cache_manager_;
#endif
};
params_.media_type == blink::mojom::ContextMenuDataMediaType::kNone);
GetProposedContextMenu();
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
return true;
#else
if (!CreateContextMenu(params))
#include "wrt/src/browser/wrt_devtools_manager_delegate.h"
-#if defined(OS_TIZEN_TV_PRODUCT) && !defined(WRT_JS_BRINGUP)
+#if BUILDFLAG(IS_TIZEN_TV) && !defined(WRT_JS_BRINGUP)
#include "tizen_src/chromium_impl/content/browser/inspector/devtools_util_manager.h"
#endif
return true;
}
-#if defined(OS_TIZEN_TV_PRODUCT) && !defined(WRT_JS_BRINGUP)
+#if BUILDFLAG(IS_TIZEN_TV) && !defined(WRT_JS_BRINGUP)
void WRTDevToolsManagerDelegate::ReleasePort() {
content::DevToolsUtilManager::GetInstance()->ReleasePort();
}
= delete;
// Chromium DevToolsHttpHandler::Delegate overrides.
-#if defined(OS_TIZEN_TV_PRODUCT) && !defined(WRT_JS_BRINGUP)
+#if BUILDFLAG(IS_TIZEN_TV) && !defined(WRT_JS_BRINGUP)
void ReleasePort() override;
#endif
#include "wrt/src/browser/wrt_native_window.h"
#include "wrt/src/common/application_data.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/native_web_runtime.h"
#endif
}
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void WRTJavaScriptDialogManager::CancelDialogs(
content::WebContents* web_contents, bool reset_state) {
if (dialog_)
bool is_reload,
DialogClosedCallback callback) override;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void CancelDialogs(content::WebContents* web_contents,
bool reset_state) override;
#if defined(WRT_JS_BRINGUP)
#include "wrt/src/common/application_data.h"
#include "wrt/src/common/wrt_profile_delegate.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "base/path_service.h"
#include "tizen_src/chromium_impl/content/common/paths_efl.h"
#include "wrt/src/browser/tv/wrt_native_window_tv.h"
#else
#include <inputmethod.h>
#include <watch_app_efl.h>
-#endif // defined(OS_TIZEN_TV_PRODUCT)
+#endif // BUILDFLAG(IS_TIZEN_TV)
#if defined(TIZEN_ATK_SUPPORT)
#include "tizen_src/ewk/efl_integration/eweb_accessibility.h"
#include "tizen_src/ewk/efl_integration/eweb_accessibility_util.h"
#endif
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
using WRTNativeWindowType = wrt::WRTNativeWindowTV;
#else
using WRTNativeWindowType = wrt::WRTNativeWindow;
-1, // ANY
};
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
const char* kEdjeFile = "wrtjs_tizen.edj";
#else
const char* kEdjePath = "/usr/share/edje/wrtjs/wrtjs_tizen.edj";
return window_;
CHECK(host && !use_onscreen_rendering);
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
auto& app_data = ApplicationData::GetInstance();
if (app_data.app_type() == ApplicationData::WATCH) {
elm_config_accel_preference_set("opengl");
window_ = elm_win_util_standard_add("", "");
elm_win_autodel_set(window_, EINA_TRUE);
-#if defined(OS_TIZEN_DA_PRODUCT) || defined(OS_TIZEN_TV_PRODUCT)
+#if defined(OS_TIZEN_DA_PRODUCT) || BUILDFLAG(IS_TIZEN_TV)
elm_win_indicator_mode_set(window_, ELM_WIN_INDICATOR_HIDE);
#else
elm_win_indicator_mode_set(window_, ELM_WIN_INDICATOR_SHOW);
&window_height);
evas_object_resize(window_, window_width, window_height);
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
if (app_data.app_type() == ApplicationData::IME) {
ime_set_size(window_width,
window_height * 2 / 5, window_height, window_width * 3 / 5);
}
layout_ = elm_layout_add(container);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
base::FilePath edje_dir;
base::PathService::Get(PathsEfl::EDJE_RESOURCE_DIR, &edje_dir);
elm_layout_file_set(layout_, (edje_dir.value() + "/" + kEdjeFile).c_str(),
// static
Evas_Object* WRTNativeWindow::GetHostWindowDelegate(
const content::WebContents* web_contents) {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
return CreateWindow(true);
#else
auto need_conformant =
void WRTNativeWindow::InitializePlatformEventListeners() {
AddVisibilityEventListener();
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
AddEditorClientEventListeners();
#endif
ecore_evas_wm_rotation_available_rotations_set(
platform_canvas, rotations, 4);
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
//TODO(dh81.song):
// need to check elm_win_wm_rotation_manual_rotation_done_set is appliable
// for all profile
}
}
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
// NOTE: This code is added
// 1. to enable back-key on remote URL
// 2. for backward compatibility. If the 'backbutton_presence' is true,
#include "wrt/src/browser/wrt_quota_permission_context.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include <tzplatform_config.h>
#include "base/files/file_path.h"
namespace {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
const char* kStoragePrivilege = "http://tizen.org/privilege/unlimitedstorage";
bool IsOverThanHalfFreeSpace(
const content::StorageQuotaParams& params,
int render_process_id,
PermissionCallback callback) {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
if (privilege::FindPrivilegeFromConfig(kStoragePrivilege)) {
if (HasLimitQuotaPermission() &&
IsOverThanHalfFreeSpace(params.requested_size))
#include "wrt/src/service/wrt_service_launcher.h"
#include "wrt/src/service/wrt_service_manager.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/tv/wrt_native_window_tv.h"
#endif
static_cast<WRTBrowserContext*>(web_contents()->GetBrowserContext())
->AddVisitedURLs(navigation_handle->GetRedirectChain());
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
auto native_window_tv =
static_cast<WRTNativeWindowTV*>(
WRTNativeWindow::FromWebContents(web_contents()));
} else {
select_picker_->UpdatePickerData(selectedIndex, std::move(items), multiple);
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
GetWebContentsViewEfl()->SetPopupMenuVisible(true);
#endif
select_picker_->Show();
return;
AdjustViewPortHeightToPopupMenu(false /* is_popup_menu_visible */);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
GetWebContentsViewEfl()->SetPopupMenuVisible(false);
GetWebContentsViewEfl()->SetPopupMenuBounds(gfx::Rect(0, 0, 0, 0));
#endif
#include "wrt/src/browser/native_app_control.h"
#include "wrt/src/common/locale_manager.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/tv/native_web_runtime_delegate_tv.h"
#include "wrt/src/common/tv/application_data_tv.h"
#endif
// static
ApplicationData& ApplicationData::GetInstance() {
if (!instance)
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
instance = new ApplicationDataTV;
#else
instance = new ApplicationData;
// static
ApplicationData* ApplicationData::Create(const std::string& service_id,
const std::string& pkg_path) {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
return new ApplicationDataTV(service_id, pkg_path);
#else
return new ApplicationData(service_id, pkg_path);
widget_config_parser->GetManifestData(
wgt::parse::LaunchScreenInfo::Key())));
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
video_splash_screen_info_.SetImpl(
std::static_pointer_cast<const wgt::parse::VideoSplashScreenInfo>(
widget_config_parser->GetManifestData(
// static
const std::string ApplicationData::GetWrtResPath() {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
wrt_res_path_ = ApplicationDataTV::GetWrtResPath();
#endif
if (wrt_res_path_.empty()) {
}
// Find based on default start files list, if src is empty or invald
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
if (src.empty())
NativeWebRuntimeDelegateTV::GetInstance().TryMount();
#endif
const LaunchScreenInfo& launch_screen_info() const {
return launch_screen_info_;
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
const VideoSplashScreenInfo& video_splash_screen_info() const {
return video_splash_screen_info_;
}
mutable std::string pkg_id_;
ApplicationData::AppType app_type_;
std::unordered_map<std::string, std::string> metadata_;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
VideoSplashScreenInfo video_splash_screen_info_;
#endif
base::FilePath backup_config_xml_;
#include <wgt_manifest_handlers/warp_handler.h>
#include <wgt_manifest_handlers/widget_handler.h>
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include <wgt_manifest_handlers/video_splash_screen_handler.h>
#endif
wgt::parse::ScreenOrientation orientation) const {
if (!impl_)
return nullptr;
-#if defined(OS_TIZEN_TV_PRODUCT) && !TIZEN_VERSION_AT_LEAST(6, 0, 0)
+#if BUILDFLAG(IS_TIZEN_TV) && !TIZEN_VERSION_AT_LEAST(6, 0, 0)
auto& screen_data = impl_->screen_data();
auto iter = screen_data.find(orientation);
if (iter != screen_data.end())
return nullptr;
}
bool HasLaunchScreenData() const {
-#if defined(OS_TIZEN_TV_PRODUCT) && !TIZEN_VERSION_AT_LEAST(6, 0, 0)
+#if BUILDFLAG(IS_TIZEN_TV) && !TIZEN_VERSION_AT_LEAST(6, 0, 0)
if (!impl_ || impl_->screen_data().empty())
#else
if (!impl_ || impl_->launch_screen_data().empty())
MAKE_WRAP_FUNCTION(long_polling)
MAKE_WRAP_FUNCTION(screen_orientation)
MAKE_WRAP_FUNCTION(sound_mode)
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
MAKE_WRAP_FUNCTION(pointing_device_option)
#endif
};
};
#endif
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
class VideoSplashScreenInfo
: public Wrapper<wgt::parse::VideoSplashScreenInfo> {
public:
const char kWRTUIExtensionsURL[] = "wrt://extensions/";
const char kWRTUIScheme[] = "wrt";
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
const char kInternalIdAndFileDelim[] = ",#@";
const char kSpmExtension[] = ".spm";
#endif
* limitations under the License.
*/
+#include "build/build_config.h"
+
namespace wrt {
extern const char kAppDBRuntimeSection[];
extern const char kWRTUIExtensionsURL[];
extern const char kWRTUIScheme[];
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
extern const char kInternalIdAndFileDelim[];
extern const char kSpmExtension[];
#endif
#include "wrt/src/common/locale_manager.h"
#include "wrt/src/common/application_data.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/common/constants.h"
#endif
std::string resource_path = app_localized_path + file_path;
auto path_exist = Exists(resource_path);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
path_exist |= Exists(resource_path + kSpmExtension);
#endif
if (path_exist) {
return result;
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
// For TMG apps, |origin| resources will not be available and
// should not be recognized as an error
LOG(INFO) << "uri=" << origin << ", decoded=" << file_path;
}
void WRTRenderFrameObserver::SetContentSecurityPolicy() {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
static bool did_set_csp_rule_ = false;
if (did_set_csp_rule_)
return;
#include "wrt/src/common/application_data.h"
#include "wrt/src/service/wrt_service_manager.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/browser/tv/encrypted_file_handler.h"
#include "wrt/src/common/constants.h"
#endif
WRTServiceManager::Get()->KillLauncherProcess(argument);
}
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
void DbusDecryptFile(const char*, const char* argument,
const InterProcessCommunication::Message& message) {
if (WRTServiceManager::Get()->IsQuitting())
ipc.AddMessageHandler("CloseDBusConnection", DbusCloseConnection);
ipc.AddMessageHandler("KillLauncherProcess", DbusKillLauncherProcess);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
ipc.AddMessageHandler("DecryptFile", DbusDecryptFile);
ipc.AddMessageHandler("ReleaseAppDrm", DbusReleaseAppDrm);
#endif
LOG(INFO) << "wrt-service is running as global";
service_manager->SetServiceModel(WRTService::GLOBAL);
RegisterDbusHandler();
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
} else if (std::string(argv[0]).find("wrt-node") != std::string::npos) {
uv_spawn_enable(1);
// node
#include "wrt/src/service/wrt_service.h"
#include "wrt/xwalk_extensions/browser/xwalk_extension_manager.h"
-#if defined(OS_TIZEN_TV_PRODUCT) && TIZEN_VERSION_AT_LEAST(7, 0, 0)
+#if BUILDFLAG(IS_TIZEN_TV) && TIZEN_VERSION_AT_LEAST(7, 0, 0)
#include <boost-api.h>
#endif
return std::string(reinterpret_cast<char*>(encoded_data), bundle_length);
}
-#if defined(OS_TIZEN_TV_PRODUCT) && TIZEN_VERSION_AT_LEAST(7, 0, 0)
+#if BUILDFLAG(IS_TIZEN_TV) && TIZEN_VERSION_AT_LEAST(7, 0, 0)
void RequestAsBackgroundProcess() {
static bool did_boost_down = false;
if (!did_boost_down) {
return;
}
-#if defined(OS_TIZEN_TV_PRODUCT) && TIZEN_VERSION_AT_LEAST(7, 0, 0)
+#if BUILDFLAG(IS_TIZEN_TV) && TIZEN_VERSION_AT_LEAST(7, 0, 0)
RequestAsBackgroundProcess();
#endif
return;
if (shutdown_callback_)
shutdown_callback_(xw_extension_);
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
dlclose(handle_);
XWalkExtensionManager::GetInstance()->ClearPreloadHandle(library_path_);
#endif
LOG(INFO) << "XWalkExtension:Initialize";
std::string library_path = library_path_;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
auto upgradable_lib_path =
XWalkExtensionManager::GetInstance()->GetUpgradableLibPath(name_);
if (!upgradable_lib_path.empty())
#include "wrt/src/service/wrt_service_manager.h"
#include "wrt/xwalk_extensions/browser/xwalk_extension.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/xwalk_extensions/browser/tv/xwalk_extension_manager_tv.h"
#endif
// static
XWalkExtensionManager* XWalkExtensionManager::GetInstance() {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
static XWalkExtensionManagerTV self;
#else
static XWalkExtensionManager self;
bool override = !value.empty();
for (int i = 0; i < controller.GetEntryCount(); ++i)
controller.GetEntryAtIndex(i)->SetIsOverridingUserAgent(override);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
web_contents->SetReloadByUserAgentChange(false);
#endif
web_contents->SetUserAgentOverride(
.FromMaybe(v8::Local<v8::Function>());
module->LoadExtensionCode(context, require_native);
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
if (module->GetName() != "Widget")
#endif
EnsureExtensionNamespaceIsReadOnly(context, module->GetName());
#include "wrt/xwalk_extensions/renderer/xwalk_extension_context_data.h"
#include "wrt/xwalk_extensions/renderer/xwalk_extension_module.h"
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
#include "wrt/src/common/privilege.h"
#endif
auto* execution_context = blink::ExecutionContext::From(context);
if (execution_context->Url().ProtocolIsInHTTPFamily()
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
&& !wrt::privilege::CheckHostedAppPrivilege()
#endif
) {