[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 d590520bb159aff2e2bcdafdb5d08b49738391e7..38fe7b26e446c8e7af5a59abff09dd315302f83c 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 eafc893d9e0900929e3371b0aa855a9c5d84cb9b..30f3e3e972829f57f977161acd014e1f8847b09b 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 297997ae1ad84b50f61e7a1310d7677436ff5fd4..4a7e57179c04153cb45924774cda636a92a85118 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 f8353060c4e8d0061ed3c9bd0bf8c374b63de499..41abbab0c745a2218c8b140d4a9e55f99c00aa58 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 dede458604272c10b240f54d8ea0bfddc6c99f81..4fb0b5c70c2c2eea9b39f035fe98bff1deef149e 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 1b83e4ae220d84de05f32e3f6922869c342ec2e3..e1e8ab5939ec3bd084d3bb4b59c20fd2bfd402ef 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 cd8b6146bf38de26049843aca5d9ca7b93b11d63..254f4085a2e77d106eb35679b64eb45bd721b92a 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 4b12d1299394a93660ad54eb4e4f3fdb363097a2..bb3173438c888fec290a8c083823d7e11f096eb1 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 047895193f0c6debea50d438c109d5cf3205872c..3b39e9eab0d6cfd49c59e0127c6ee3f24734d319 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 861408dab84328335b822b69f3f554f4a866c58d..6f67bc4fa4ebbfddee109455b4288461fcb896ef 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 f055d32c98a90baf9fd011cbb8cf9272449f43dd..8f1cb827c813b09fa4e690ceefbbad7f0ac8ad20 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 90c225f22ee625b513075bbd7ebc91253153a54c..619c3c4bbf1601867d3b789fab64bb4fa49d2da0 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 259b03bf881d7efe2555679e2773ed49ff31e456..c02d1f353e617af36db7f30bd99a1742b48e7a64 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 8b47c7c9903de2cf4f4c5536b48e3e940d139716..d5f0c4ec7f51040b316c63ec3a6fff1bd1b129ba 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 8ef0dc885654edefe73802b93129e10a37579ad9..178c9eb39148c3ba62c43a61cc46c9d65e5b1104 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 f1e358e55d00a931ee8c6d4e94a0f9e95a9e513f..1c375cf821285dd0c561088627b9119d300a9afc 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 4f6f75196afe528bb458f69dd8ebb5d3cbc5db03..d99cf64fd2d0f48589782f9d580d60240ec624b2 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 a705a3211b5be8e8fb0ab54603abd04a4c25f2c7..a41051e76b315a805458a4b61115276be13d6c84 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 522e278d631d5da0c7a5bb768e168efb93ca1a39..79c046dcb716299c6b6b9b8efa978a6d46c88d8a 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 12dcb0dd974735d7317fa27f73d4c5b060839fb8..e2f5978a30a82c502c2b8c9b272979bdd44f4d45 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 e6f54123a2aed54356789dcd492f4a6746a8f431..fbe5c03a999b4822811577173889cee60844c54d 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 6f0885007f45a3b05e91841f99123f44f55244f1..f2bfe70c93b1a401657357d2f87beb7400f4ddbf 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 58d41d97716a51d24c827d00ca537729f975b09b..dfc61683eb7072ba4590ef646911eb4bbce2a80c 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 e48307fb2ba159c8c82c16f3f8e4081f334c8490..09c4e85045a5bdaddac0582dfebfe07145d3c38e 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 a885e36cc90d38152f945987fccefbaf37f649cc..c844d8b18d10f33dde6b4a51fe6a6aa72a2e49b8 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 0fe5049074f6fad3b219bcc9780540165e09154e..d777ecc9d310a42b219d437d2e3abd1c5388be60 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 a3e560db18f97dbe8deeb18b5c7bdffdf4aee50b..50ccad3fca8bb01e99b03b04c0fbdece08521b86 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 e380c38b089bb203b511383525fdc5d61094f3d6..8ec7992fda6dc2720d034528b110e82d1f422618 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 0d5a487a00ddd847f075376178201a4edf00bc13..09940399395fe49982980cd7b21c702348f87032 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 102ea7cd3f05caf4cd11609c2fed4bf0d9422d20..eeb95cca6749acf34977a4c448024cce93be4af5 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 701d8ab0ab9902c578afcdd4ff0d13ff84c0d3d4..784527e1a06753482ef5c5af9ae5225031ed9bc8 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 ac3ddcab895fc31d9a6dc838f0c600de5a850c46..d8c60542c4069f52c70857ec40cf4420763aca0c 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 7295c7b01336640012cff93232c330ee693f7632..aba6906675dc2d8794504afd13786124e4826368 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 35f1a98ac47fcd277cf7d752a2f00272504a00b4..bd05f6097f0a5f4043e30a22fe6756323d7a61e6 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 598335ad747efc50b11c610016a7de2a689d646f..581112284b7518aa61a64f98cab69eca6493842b 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 8553ec7253723349ac414199d95554a9729f966b..46ebbc7f50adc37b0c913ff43cc8161e8594c7d5 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 b0417864da897f98c0c281afa8cfb3db66c78402..961575573da417d94c2ce35ffd584d39904a00d6 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 56144ebd7e72e349753e99bcef64efbfc60afa14..85f6fe755714dc2e461d8ff834e919b285aeaca6 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 8d36ec9603136aeb57830f4782851ff0ea9c10fc..4c612eeca4a0a43f211504cf0d299a80bc480cc6 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 086705360b92e99a8134870c507d43d4ea78748a..df4df7cc2993cc5db503da6b3a74401e6902b1d6 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 0b752201dcb33da667f30d68b56480fc30fe754a..c492b0e5e8eeacb3dba6283ae2f6a9d452262e30 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 2a5ed322f97ab591015a164369947598b2538a3a..3dbc59b34aa8b2af728b67d41748a12f45e7811d 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 8a35ab1a9297b72cbc5ffa10853dd67e649f9bb3..d1d61287db27fe91ed931694cf5aa22a574f74ec 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 e1ac9db811e258e88b9649e8643c58dbf531691e..d1f06aebcb5b2013ff8cf50f028ff363f056ca13 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 e5aefc0b9a3fcea61c93d20fec5a6b9178b7812e..624fd4ddc747b1fa5156108955c5d29c389bab25 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 9130cc7383348c8eff5cbbb145f4c8f4b69012d6..54f860e80b7ad1f834c06eb519638af075c2b43b 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 004b72737f33b464004d070c9992491db2fd6e5c..000ed8197d90760fe4c84830f2b76edd6d0ac7b8 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 6a76713867bbfc2fa956bf593fc5ca67d1009ee1..76377dc23090fccd186d36f80d5ccb4239cf854d 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
     ) {