[M108][WRTjs] Use BUILDFLAG(IS_XXX) for OS checking 38/289238/5
authorzhaosy <shiyusy.zhao@samsung.com>
Fri, 3 Mar 2023 00:17:51 +0000 (08:17 +0800)
committerBot Blink <blinkbot@samsung.com>
Wed, 8 Mar 2023 00:54:06 +0000 (00:54 +0000)
This patch replaces all occurances of defined(OS_XXX) with
BUILDFLAG(IS_XXX) as per upstream changes mentioned in [1].

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=1234043

Below efl/tizen build flags are replaced:

USE_EFL -> IS_EFL
OS_TIZEN -> IS_TIZEN
OS_TIZEN_TV_PRODUCT -> IS_TIZEN_TV

Reference:
https://review.tizen.org/gerrit/#/c/285956/

Change-Id: Iaea1ba52738be626e218fbc962bff3f2a555938e
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
48 files changed:
content/common/zygote/zygote_communication_linux.cc
content/common/zygote/zygote_communication_linux.h
wrt/src/app/runtime.cc
wrt/src/app/ui_runtime.cc
wrt/src/app/wrt_content_main.cc
wrt/src/base/platform_info.cc
wrt/src/base/platform_info.h
wrt/src/browser/api/wrt_api_mde_extension.cc
wrt/src/browser/api/wrt_api_mde_extension.h
wrt/src/browser/api/wrt_api_web_contents.cc
wrt/src/browser/api/wrt_api_web_contents.h
wrt/src/browser/api/wrt_api_web_runtime.cc
wrt/src/browser/api/wrt_api_web_runtime.h
wrt/src/browser/native_app_control.cc
wrt/src/browser/native_web_runtime.cc
wrt/src/browser/net/wrt_file_url_loader.cc
wrt/src/browser/net/wrt_proxying_url_loader_factory.cc
wrt/src/browser/popup.cc
wrt/src/browser/popup.h
wrt/src/browser/popup_string.cc
wrt/src/browser/popup_string.h
wrt/src/browser/splash_screen.cc
wrt/src/browser/tv/wrt_select_picker_tv.cc
wrt/src/browser/tv/wrt_select_picker_tv.h
wrt/src/browser/wrt_browser_client.cc
wrt/src/browser/wrt_browser_context.cc
wrt/src/browser/wrt_browser_context.h
wrt/src/browser/wrt_context_menu_controller.cc
wrt/src/browser/wrt_devtools_manager_delegate.cc
wrt/src/browser/wrt_devtools_manager_delegate.h
wrt/src/browser/wrt_javascript_dialog_manager.cc
wrt/src/browser/wrt_javascript_dialog_manager.h
wrt/src/browser/wrt_native_window.cc
wrt/src/browser/wrt_quota_permission_context.cc
wrt/src/browser/wrt_web_contents.cc
wrt/src/common/application_data.cc
wrt/src/common/application_data.h
wrt/src/common/application_data_wrapper.h
wrt/src/common/constants.cc
wrt/src/common/constants.h
wrt/src/common/resource_manager.cc
wrt/src/renderer/wrt_render_frame_observer.cc
wrt/src/service/wrt_service.cc
wrt/src/service/wrt_service_manager.cc
wrt/xwalk_extensions/browser/xwalk_extension.cc
wrt/xwalk_extensions/browser/xwalk_extension_manager.cc
wrt/xwalk_extensions/renderer/xwalk_extension_context_data.cc
wrt/xwalk_extensions/renderer/xwalk_extension_renderer_controller.cc

index d590520..38fe7b2 100644 (file)
@@ -357,7 +357,7 @@ void ZygoteCommunication::DropProcessPrivileges(const std::string& app_id) {
 }
 #endif
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
 pid_t ZygoteCommunication::GetZygotePid() {
   return pid_;
 }
index eafc893..30f3e3e 100644 (file)
@@ -78,7 +78,7 @@ class CONTENT_EXPORT ZygoteCommunication {
   void DropProcessPrivileges(const std::string& app_id);
 #endif
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
   pid_t GetZygotePid();
 #endif
 
index 297997a..4a7e571 100755 (executable)
@@ -16,7 +16,8 @@
 
 #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"
@@ -33,7 +34,7 @@ Runtime::~Runtime() {}
 
 // 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();
index f835306..41abbab 100755 (executable)
@@ -39,7 +39,7 @@ bool UiRuntime::OnCreate() {
 
 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
index dede458..4fb0b5c 100644 (file)
@@ -20,7 +20,7 @@
 #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"
@@ -64,7 +64,7 @@ class WRTContentMain::Loader {
                             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_;
@@ -145,7 +145,7 @@ class WRTContentMain::Loader {
 };
 
 WRTContentMain::WRTContentMain()
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
     : main_delegate_(new WRTMainDelegateTV) {}
 #else
     : main_delegate_(new WRTMainDelegate) {}
index 1b83e4a..e1e8ab5 100644 (file)
@@ -19,7 +19,7 @@
 #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"
@@ -29,7 +29,7 @@ namespace wrt {
 
 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;
@@ -75,7 +75,7 @@ enum ProfileType GetProfile() {
   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(
index cd8b614..254f408 100644 (file)
@@ -20,6 +20,8 @@
 #include <list>
 #include <string>
 
+#include "build/build_config.h"
+
 namespace wrt {
 
 enum ProfileType {
@@ -45,7 +47,7 @@ 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);
index 4b12d12..bb31734 100755 (executable)
@@ -7,7 +7,7 @@
 #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>
@@ -19,7 +19,7 @@ namespace api {
 
 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";
@@ -72,7 +72,7 @@ void MDEExtension::LaunchBrowserFromUrl(const std::string& url) {
   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);
@@ -143,7 +143,7 @@ std::string MDEExtension::GetDeviceUUID() const {
 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",
index 0478951..3b39e9e 100755 (executable)
@@ -30,7 +30,7 @@ class MDEExtension : public gin::Wrappable<MDEExtension>,
  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);
index 861408d..6f67bc4 100755 (executable)
@@ -13,7 +13,7 @@
 #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
@@ -48,7 +48,7 @@ bool WebContents::DidAddMessageToConsole(
     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,
@@ -86,7 +86,7 @@ std::unique_ptr<content::ColorChooser> WebContents::OpenColorChooser(
 
 #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
@@ -125,7 +125,7 @@ void WebContents::WillDraw(int new_rotation, gfx::Size frame_data_output_size) {
   }
 }
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
 void WebContents::ShowMicOpenedNotification(bool show) {
   if (show) {
     auto pcm_title =
index f055d32..8f1cb82 100755 (executable)
@@ -44,7 +44,7 @@ class WebContents : public electron::api::WebContents {
 #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
index 90c225f..619c3c4 100755 (executable)
@@ -45,7 +45,7 @@
 #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
 
@@ -283,7 +283,7 @@ void WebRuntime::HandleNotificationPermissionRequest(
     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
@@ -415,7 +415,7 @@ std::string WebRuntime::GetPlatformType() const {
     return "wearable";
 #endif
   else if (IsTvProfile())
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
     return "product_tv";
 #else
     return "tv";
@@ -696,7 +696,7 @@ v8::Local<v8::Value> WebRuntime::SecurityExtension(v8::Isolate* isolate) {
   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);
@@ -769,7 +769,7 @@ gin::ObjectTemplateBuilder WebRuntime::GetObjectTemplateBuilder(
 #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);
index 259b03b..c02d1f3 100755 (executable)
@@ -118,7 +118,7 @@ class WebRuntime : public gin::Wrappable<WebRuntime>,
   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
index 8b47c7c..d5f0c4e 100755 (executable)
@@ -31,7 +31,7 @@
 #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
@@ -223,7 +223,7 @@ bool NativeAppControl::AddDataArray(
 }
 
 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;
index 8ef0dc8..178c9eb 100755 (executable)
@@ -38,7 +38,7 @@
 #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
 
@@ -170,7 +170,7 @@ void NativeWebRuntime::Initialize() {
   extension_manager->LoadUserExtensions(app_data.application_path());
 #endif
 
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
   VibrationManager::CreateInstance();
   SetupTizenCompatibility();
 #endif
index f1e358e..1c375cf 100755 (executable)
@@ -69,7 +69,7 @@ bool ShouldOverrideMimeType(const GURL& url,
 
 }  // 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;
 
@@ -137,7 +137,7 @@ class WRTFileURLLoader : public network::mojom::URLLoader {
   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,
@@ -176,7 +176,7 @@ class WRTFileURLLoader : public network::mojom::URLLoader {
       return;
     }
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
     if (!IsAllowedPath(path)) {
       OnClientComplete(net::ERR_ACCESS_DENIED);
       return;
@@ -310,7 +310,7 @@ class WRTFileURLLoader : public network::mojom::URLLoader {
 };
 
 void InitializeWRTFileURLLoader() {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
   SetAllowedPath();
 #endif
 }
index 4f6f751..d99cf64 100644 (file)
@@ -4,7 +4,7 @@
 #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
 
@@ -12,7 +12,7 @@ namespace wrt {
 
 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;
@@ -50,7 +50,7 @@ WRTProxyingURL WRTProxyingURLLoaderFactory::ParseURL(const GURL& url) {
                << "] 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);
@@ -92,7 +92,7 @@ void WRTProxyingURLLoaderFactory::CreateLoaderAndStart(
   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));
index a705a32..a41051e 100755 (executable)
@@ -22,7 +22,7 @@
 #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>
@@ -53,13 +53,13 @@ const char* kStyleButtonRight = "popup/circle/right";
 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
@@ -76,7 +76,7 @@ const char* kSignalEdit = "elm,action,hide,search_icon";
 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
@@ -86,7 +86,7 @@ const char* kWRTEdjePath = "/usr/share/edje/wrtjs/wrtjs_tizen.edj";
 
 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,
@@ -111,9 +111,9 @@ static Evas_Object* AddCheckBox(Evas_Object* parent) {
   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;
 }
@@ -123,7 +123,7 @@ static Evas_Object* AddCheckBox(Evas_Object* parent) {
 // 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);
@@ -145,7 +145,7 @@ std::unique_ptr<Popup> Popup::CreatePopup(Evas_Object* window) {
 
 #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";
@@ -180,7 +180,7 @@ std::unique_ptr<Popup> Popup::CreatePopup(Evas_Object* window) {
 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
@@ -230,7 +230,7 @@ void Popup::SetButtonType(ButtonType type) {
       break;
   }
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
   if (button2_) {
     auto focused_callback = [](void* instance, Evas_Object* button,
                               void* /*eventInfo*/) {
@@ -311,7 +311,7 @@ Evas_Object* Popup::AddEntry(const char* id, Popup::EntryType type) {
   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
@@ -328,7 +328,7 @@ Evas_Object* Popup::AddEntry(const char* id, Popup::EntryType type) {
   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(),
@@ -440,7 +440,7 @@ void Popup::HandleButtonClickEvent(Evas_Object* button) {
   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();
index 522e278..79c046d 100755 (executable)
@@ -24,7 +24,7 @@
 
 #include "base/callback.h"
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
 #include "base/timer/timer.h"
 #endif
 
@@ -64,7 +64,7 @@ class Popup {
 
   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();
 
@@ -82,7 +82,7 @@ class Popup {
 
   void Hide();
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
   void Timeout();
 
   base::OneShotTimer timeout_timer_;
index 12dcb0d..e2f5978 100755 (executable)
 
 #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";
@@ -93,7 +93,7 @@ std::string GetText(const std::string& msg_id) {
   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());
index e6f5412..fbe5c03 100755 (executable)
@@ -21,6 +21,8 @@
 #include <initializer_list>
 #include <string>
 
+#include "build/build_config.h"
+
 namespace wrt {
 
 namespace popup_string {
@@ -49,7 +51,7 @@ extern const char kPopupButtonAllow[];
 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[];
@@ -58,7 +60,7 @@ 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
index 6f08850..f2bfe70 100755 (executable)
@@ -18,7 +18,7 @@
 
 #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
 
@@ -82,7 +82,7 @@ bool SplashScreen::ShowSplashScreen() {
     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);
index 58d41d9..dfc6168 100755 (executable)
@@ -14,7 +14,7 @@
 #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
 
@@ -45,7 +45,7 @@ void WRTSelectPickerTv::HidePopupMenu() {
     wrt_web_contents->HidePopupMenuImpl();
 }
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
 bool WRTSelectPickerTv::GetSpatialNavigationSettings() {
   return NativeWebRuntimeDelegateTV::GetInstance()
       .IsSpatialNavigationMetaTagSet();
index e48307f..09c4e85 100755 (executable)
@@ -41,7 +41,7 @@ class WRTSelectPickerTv : public SelectPickerTvBase {
 
   // SelectPickerTvBase
   void HidePopupMenu() override;
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
   bool GetSpatialNavigationSettings() override;
 #endif
   Eina_Rectangle GetLastUsedViewPortArea() override;
index a885e36..c844d8b 100755 (executable)
 #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"
@@ -283,7 +283,7 @@ void WRTBrowserClient::OverrideWebkitPrefs(
   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);
   }
@@ -319,7 +319,7 @@ void WRTBrowserClient::BindHostReceiverForRenderer(
     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;
@@ -329,7 +329,7 @@ void WRTBrowserClient::BindHostReceiverForRenderer(
     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)
index 0fe5049..d777ecc 100755 (executable)
@@ -36,7 +36,7 @@ WRTBrowserContext::WRTBrowserContext(const std::string& partition,
                                      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
@@ -113,7 +113,7 @@ void WRTBrowserContext::DeleteCookies() {
                       base::BindOnce([](uint32_t num_deleted) {}));
 }
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
 void WRTBrowserContext::ClearWebCache() {
   web_cache_manager_.ClearCache();
 }
index a3e560d..50ccad3 100755 (executable)
@@ -11,7 +11,7 @@
 #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
 
@@ -42,7 +42,7 @@ class WRTBrowserContext : public electron::ElectronBrowserContext,
 
   WRTSpecialStoragePolicy* GetWRTSpecialStoragePolicy();
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
   void ClearWebCache();
 #endif
 
@@ -58,7 +58,7 @@ class WRTBrowserContext : public electron::ElectronBrowserContext,
   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
 };
index e380c38..8ec7992 100755 (executable)
@@ -249,7 +249,7 @@ bool WRTContextMenuController::PopulateAndShowContextMenu(
        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))
index 0d5a487..0994039 100755 (executable)
@@ -4,7 +4,7 @@
 
 #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
 
@@ -14,7 +14,7 @@ bool WRTDevToolsManagerDelegate::HasBundledFrontendResources() {
   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();
 }
index 102ea7c..eeb95cc 100755 (executable)
@@ -19,7 +19,7 @@ class WRTDevToolsManagerDelegate : public electron::DevToolsManagerDelegate {
       = 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
 
index 701d8ab..784527e 100755 (executable)
@@ -11,7 +11,7 @@
 #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
 
@@ -87,7 +87,7 @@ void WRTJavaScriptDialogManager::RunBeforeUnloadDialog(
   }
 }
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
 void WRTJavaScriptDialogManager::CancelDialogs(
     content::WebContents* web_contents, bool reset_state) {
   if (dialog_)
index ac3ddca..d8c6054 100755 (executable)
@@ -39,7 +39,7 @@ class WRTJavaScriptDialogManager : public electron::ElectronJavaScriptDialogMana
                              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)
index 7295c7b..aba6906 100755 (executable)
 #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;
@@ -104,7 +104,7 @@ const int kLandscapeNaturalAngle[] = {
     -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";
@@ -260,7 +260,7 @@ Evas_Object* WRTNativeWindow::CreateWindow(bool need_conformant) {
     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");
@@ -276,7 +276,7 @@ Evas_Object* WRTNativeWindow::CreateWindow(bool need_conformant) {
     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);
@@ -287,7 +287,7 @@ Evas_Object* WRTNativeWindow::CreateWindow(bool need_conformant) {
                           &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);
@@ -306,7 +306,7 @@ Evas_Object* WRTNativeWindow::CreateWindow(bool need_conformant) {
   }
 
   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(),
@@ -347,7 +347,7 @@ void WRTNativeWindow::EnsurePlatformWindow() {
 // 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 =
@@ -399,7 +399,7 @@ bool WRTNativeWindow::UseOnscreenRendering() {
 void WRTNativeWindow::InitializePlatformEventListeners() {
   AddVisibilityEventListener();
 
-#if !defined(OS_TIZEN_TV_PRODUCT)
+#if !BUILDFLAG(IS_TIZEN_TV)
   AddEditorClientEventListeners();
 #endif
 
@@ -522,7 +522,7 @@ void WRTNativeWindow::SetRotationState(bool is_auto, int degree) {
       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
@@ -570,7 +570,7 @@ void WRTNativeWindow::OnHWBackKey(void*, Evas_Object*, void*) {
     }
   }
 
-#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,
index 35f1a98..bd05f60 100755 (executable)
@@ -1,6 +1,6 @@
 #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"
@@ -13,7 +13,7 @@ namespace wrt {
 
 namespace {
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
 const char* kStoragePrivilege = "http://tizen.org/privilege/unlimitedstorage";
 
 bool IsOverThanHalfFreeSpace(
@@ -41,7 +41,7 @@ void WRTQuotaPermissionContext::RequestQuotaPermission(
     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))
index 598335a..5811122 100755 (executable)
@@ -35,7 +35,7 @@
 #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
 
@@ -269,7 +269,7 @@ void WRTWebContents::DidFinishNavigation(
     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()));
@@ -455,7 +455,7 @@ void WRTWebContents::ShowPopupMenuImpl(
   } 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();
@@ -468,7 +468,7 @@ void WRTWebContents::HidePopupMenuImpl() {
      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
index 8553ec7..46ebbc7 100755 (executable)
@@ -39,7 +39,7 @@
 #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
@@ -169,7 +169,7 @@ bool ApplicationData::IsInWRT() {
 // static
 ApplicationData& ApplicationData::GetInstance() {
   if (!instance)
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
     instance = new ApplicationDataTV;
 #else
     instance = new ApplicationData;
@@ -180,7 +180,7 @@ ApplicationData& ApplicationData::GetInstance() {
 // 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);
@@ -257,7 +257,7 @@ bool ApplicationData::Initialize() {
           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(
@@ -476,7 +476,7 @@ const std::string ApplicationData::GetServiceID(const std::string& internal_id)
 
 // 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()) {
@@ -563,7 +563,7 @@ ApplicationData::GetDefaultLoadInfo() {
   }
 
   // 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
index b041786..9615755 100755 (executable)
@@ -62,7 +62,7 @@ class ApplicationData {
   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_;
   }
@@ -182,7 +182,7 @@ class ApplicationData {
   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_;
index 56144eb..85f6fe7 100755 (executable)
@@ -20,7 +20,7 @@
 #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
 
@@ -131,7 +131,7 @@ class LaunchScreenInfo : public Wrapper<wgt::parse::LaunchScreenInfo> {
       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())
@@ -145,7 +145,7 @@ class LaunchScreenInfo : public Wrapper<wgt::parse::LaunchScreenInfo> {
     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())
@@ -189,7 +189,7 @@ class SettingInfo : public Wrapper<wgt::parse::SettingInfo> {
   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
 };
@@ -209,7 +209,7 @@ class AddonInfo : public Wrapper<wgt::parse::AddonInfo> {
 };
 #endif
 
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
 class VideoSplashScreenInfo
     : public Wrapper<wgt::parse::VideoSplashScreenInfo> {
  public:
index 8d36ec9..4c612ee 100755 (executable)
@@ -26,7 +26,7 @@ const char kWRTUIExtensionsHost[] = "extensions";
 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
index 0867053..df4df7c 100755 (executable)
@@ -14,6 +14,8 @@
  *    limitations under the License.
  */
 
+#include "build/build_config.h"
+
 namespace wrt {
 
 extern const char kAppDBRuntimeSection[];
@@ -24,7 +26,7 @@ extern const char kWRTUIExtensionsHost[];
 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
index 0b75220..c492b0e 100755 (executable)
@@ -37,7 +37,7 @@
 #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
 
@@ -123,7 +123,7 @@ std::string ResourceManager::GetLocalizedPath(const std::string& origin) {
 
       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) {
@@ -139,7 +139,7 @@ std::string ResourceManager::GetLocalizedPath(const std::string& origin) {
     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;
index 2a5ed32..3dbc59b 100755 (executable)
@@ -128,7 +128,7 @@ void WRTRenderFrameObserver::PlayLinkEffect() {
 }
 
 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;
index 8a35ab1..d1d6128 100755 (executable)
@@ -16,7 +16,7 @@
 #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
@@ -122,7 +122,7 @@ void DbusKillLauncherProcess(const char*, const char* argument,
   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())
@@ -177,7 +177,7 @@ int RegisterDbusHandler() {
     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
@@ -285,7 +285,7 @@ int WRTService::Main(int argc, char** argv) {
     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
index e1ac9db..d1f06ae 100644 (file)
@@ -17,7 +17,7 @@
 #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
 
@@ -45,7 +45,7 @@ std::string ConvertEncodedBundle(bundle* bundle_data) {
   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) {
@@ -386,7 +386,7 @@ void WRTServiceManager::OnServiceStarted(uv_async_t* handle) {
     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
 
index e5aefc0..624fd4d 100755 (executable)
@@ -311,7 +311,7 @@ XWalkExtension::~XWalkExtension() {
     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
@@ -392,7 +392,7 @@ bool XWalkExtension::Initialize(bool immediate) {
 
   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())
index 9130cc7..54f860e 100644 (file)
@@ -26,7 +26,7 @@
 #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
 
@@ -64,7 +64,7 @@ base::Lock xmanager_instance_lock;
 
 // static
 XWalkExtensionManager* XWalkExtensionManager::GetInstance() {
-#if defined(OS_TIZEN_TV_PRODUCT)
+#if BUILDFLAG(IS_TIZEN_TV)
   static XWalkExtensionManagerTV self;
 #else
   static XWalkExtensionManager self;
@@ -525,7 +525,7 @@ std::string XWalkExtensionManager::HandleRuntimeMessageInternal(
       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(
index 004b727..000ed81 100755 (executable)
@@ -186,7 +186,7 @@ void XWalkExtensionContextData::LoadExtensionModule(
           .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());
index 6a76713..76377dc 100755 (executable)
@@ -22,7 +22,7 @@
 #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
 
@@ -152,7 +152,7 @@ void XWalkExtensionRendererController::DidCreateScriptContext(
 
   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
     ) {