"//components/samsung/bpbookmark_model",
"//components/samsung/bpbookmark_image_model",
"//components/samsung/browser_config",
+ "//components/samsung/bixby_provider",
]
configs += [
"samsung/multi_language_controller.h",
"samsung/thread_booster_controller.cc",
"samsung/thread_booster_controller.h",
+ "samsung/bixby_manager.cc",
+ "samsung/bixby_manager.h",
+ "samsung/bixby_controller.cc",
+ "samsung/bixby_controller.h",
+ "samsung/voice_interaction_manager.cc",
+ "samsung/voice_interaction_manager.h",
]
}
}
--- /dev/null
+// Copyright 2023 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/samsung/bixby_controller.h"
+
+#include "base/logging.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/samsung/samsung_browser_core.h"
+#include "components/samsung/public/samsung_utility.h"
+#include "url/gurl.h"
+
+namespace samsung_browser_controller {
+
+BixbyController::BixbyController() {}
+
+BixbyController::~BixbyController() {
+ DeInit();
+}
+
+void BixbyController::Init() {
+ LOG(INFO) << "";
+ auto bixby_manager = samsung_browser_main::SamsungBrowserCore::instance()
+ ->VoiceInteractionManager()
+ ->BixbyManager();
+ if (bixby_manager) {
+ bixby_manager->AddObserver(this);
+ }
+}
+
+void BixbyController::DeInit() {
+ LOG(INFO) << "destructor is called";
+ auto bixby_manager = samsung_browser_main::SamsungBrowserCore::instance()
+ ->VoiceInteractionManager()
+ ->BixbyManager();
+ if (bixby_manager) {
+ bixby_manager->RemoveObserver(this);
+ }
+}
+
+bool BixbyController::ReInit() {
+ LOG(INFO) << "";
+ return true;
+}
+
+void BixbyController::OpenWebsiteCb(std::string url) {
+ LOG(INFO) << "";
+ std::string bixby_url = GetBixbyUrl(url);
+ auto browser = samsung_browser_main::SamsungBrowserCore::instance()
+ ->GetBrowserInstance();
+ chrome::AddTabAt(browser, GURL(bixby_url), -1, true);
+}
+
+std::string BixbyController::GetBixbyUrl(std::string url) {
+ std::string base64URL = url;
+ std::string BixbyURL = "http://www.google.co.kr/#q=";
+ size_t pos = base64URL.find_first_of(":.");
+ if (pos != std::string::npos) {
+ BixbyURL = url;
+ } else {
+ int lengthURL = 0;
+ void* data = nullptr;
+ data = samsung_utility::base64_decode(base64URL, lengthURL);
+ BixbyURL.assign(static_cast<char*>(data), lengthURL);
+
+ if (data) {
+ free(data);
+ }
+ }
+ return BixbyURL;
+}
+
+} // namespace samsung_browser_controller
--- /dev/null
+#ifndef CHROME_BROWSER_UI_SAMSUNG_BIXBY_CONTROLLER_H_
+#define CHROME_BROWSER_UI_SAMSUNG_BIXBY_CONTROLLER_H_
+
+#include "chrome/browser/ui/samsung/bixby_manager.h"
+
+namespace samsung_browser_controller {
+
+class BixbyController
+ : public samsung_browser_voice_interaction_manager::BixbyManager::Observer {
+ public:
+ explicit BixbyController();
+ virtual ~BixbyController();
+
+ BixbyController(const BixbyController&) = delete;
+ BixbyController& operator=(const BixbyController&) = delete;
+
+ void Init();
+ void DeInit();
+ bool ReInit();
+ std::string GetBixbyUrl(std::string url);
+
+ void OpenWebsiteCb(std::string url) override;
+
+ private:
+};
+} // namespace samsung_browser_controller
+#endif // CHROME_BROWSER_UI_SAMSUNG_BIXBY_CONTROLLER_H_
\ No newline at end of file
--- /dev/null
+#include "chrome/browser/ui/samsung/bixby_manager.h"
+
+#include "base/logging.h"
+
+namespace samsung_browser_voice_interaction_manager {
+
+BixbyManager::BixbyManager() : m_bixby_provider(nullptr) {}
+
+BixbyManager::~BixbyManager() {
+ DeInit();
+}
+
+void BixbyManager::Init() {
+ LOG(INFO) << "creating input_provider";
+ m_bixby_provider = std::make_unique<samsung_browser_main::BixbyProvider>();
+ m_bixby_provider->Init();
+ m_bixby_provider->AddObserver(this);
+}
+
+void BixbyManager::DeInit() {
+ LOG(INFO) << "destructor is called";
+ m_bixby_provider->RemoveObserver(this);
+ m_bixby_provider->DeInit();
+}
+
+bool BixbyManager::ReInit() {
+ LOG(INFO) << "";
+
+ return true;
+}
+
+void BixbyManager::AddObserver(Observer* observer) {
+ LOG(INFO) << "Adding observer";
+ m_observer_list.AddObserver(observer);
+}
+
+void BixbyManager::RemoveObserver(Observer* observer) {
+ LOG(INFO) << "Removing observer";
+ m_observer_list.RemoveObserver(observer);
+}
+
+void BixbyManager::OpenWebsiteCb(std::string url) {
+ LOG(INFO) << "";
+ for (auto& observer : m_observer_list) {
+ observer.OpenWebsiteCb(url);
+ }
+}
+
+} // namespace samsung_browser_voice_interaction_manager
--- /dev/null
+#ifndef CHROME_BROWSER_UI_SAMSUNG_BIXBY_MANAGER_H_
+#define CHROME_BROWSER_UI_SAMSUNG_BIXBY_MANAGER_H_
+
+#include "base/observer_list.h"
+#include "components/samsung/public/bixby_provider/bixby_provider.h"
+
+namespace samsung_browser_voice_interaction_manager {
+
+class BixbyManager : public samsung_browser_main::BixbyProvider::Observer {
+ public:
+ explicit BixbyManager();
+ virtual ~BixbyManager();
+
+ BixbyManager(const BixbyManager&) = delete;
+ BixbyManager& operator=(const BixbyManager&) = delete;
+
+ class Observer {
+ public:
+ virtual ~Observer() = default;
+ virtual void OpenWebsiteCb(std::string url){};
+ };
+
+ void Init();
+ void DeInit();
+ bool ReInit();
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
+ void OpenWebsiteCb(std::string url) override;
+
+ private:
+ base::ObserverList<Observer>::Unchecked m_observer_list;
+ std::unique_ptr<samsung_browser_main::BixbyProvider> m_bixby_provider;
+};
+} // namespace samsung_browser_voice_interaction_manager
+#endif // CHROME_BROWSER_UI_SAMSUNG_BIXBY_MANAGER_H_
\ No newline at end of file
#include "chrome/browser/ui/samsung/samsung_browser_core.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/samsung/bixby_controller.h"
#include "chrome/browser/ui/samsung/data_sync_controller.h"
#include "chrome/browser/ui/samsung/data_sync_manager.h"
#include "chrome/browser/ui/samsung/samsung_account_manager.h"
std::make_unique<samsung_browser_controller::MultiLanguageController>(
browser_);
m_multi_language_controller->Init();
-
+ m_voice_interaction_manager = std::make_unique<
+ samsung_browser_voice_interaction_manager::VoiceInteractionManager>();
+ m_voice_interaction_manager->Init();
+ m_voice_interaction_manager->InitBixbyandVIF();
+ m_bixby_controller =
+ std::make_unique<samsung_browser_controller::BixbyController>();
+ m_bixby_controller->Init();
BrowserList::AddObserver(this);
m_initialized = true;
return true;
#include "chrome/browser/ui/samsung/opened_tabs_controller.h"
#include "chrome/browser/ui/samsung/passkey_controller.h"
#include "chrome/browser/ui/samsung/storage_manager.h"
+#include "chrome/browser/ui/samsung/voice_interaction_manager.h"
#include "chrome/browser/ui/samsung/watch_later_controller.h"
#include "components/samsung/public/samsung_pass/samsung_pass.h"
#include "components/samsung/public/system_configuration/samsung_system_configuration.h"
class SamsungAccountManager;
}
namespace samsung_browser_controller {
+class BixbyController;
class DataSyncController;
class SamsungWebContentsController;
class MCFController;
return m_input_manager.get();
};
+ samsung_browser_controller::BixbyController* BixbyController() {
+ return m_bixby_controller.get();
+ }
+
samsung_browser_controller::CursorController* CursorController() {
return m_cursor_controller.get();
};
return m_browser_scroll.get();
}
+ samsung_browser_voice_interaction_manager::VoiceInteractionManager*
+ VoiceInteractionManager() {
+ return m_voice_interaction_manager.get();
+ }
+
aura::WindowTreeHost* GetWindowInstance();
bool CanShowWindow() { return can_show_window; }
std::unique_ptr<samsung_browser_fw_core::SamsungWebServerDownloader>
m_samsung_web_server_downloader;
std::unique_ptr<samsung_input_manager::InputManager> m_input_manager;
+ std::unique_ptr<samsung_browser_controller::BixbyController>
+ m_bixby_controller;
std::unique_ptr<samsung_browser_controller::CursorController>
m_cursor_controller;
std::unique_ptr<samsung_browser_configuration::SystemConfiguration>
std::unique_ptr<SamsungPass> m_samsung_pass;
std::unique_ptr<samsung_browser_controller::ThreadBoosterController>
m_thread_booster_controller;
+ std::unique_ptr<
+ samsung_browser_voice_interaction_manager::VoiceInteractionManager>
+ m_voice_interaction_manager;
raw_ptr<Browser> browser_;
aura::WindowTreeHost* window_host;
bool m_initialized;
--- /dev/null
+#include "chrome/browser/ui/samsung/voice_interaction_manager.h"
+
+#include "base/logging.h"
+
+namespace samsung_browser_voice_interaction_manager {
+
+VoiceInteractionManager::VoiceInteractionManager()
+ : m_bixby_manager_(nullptr) {}
+
+VoiceInteractionManager::~VoiceInteractionManager() {
+ DeInit();
+}
+
+void VoiceInteractionManager::Init() {
+ LOG(INFO) << "creating input_provider";
+ m_bixby_manager_ = std::make_unique<
+ samsung_browser_voice_interaction_manager::BixbyManager>();
+}
+
+void VoiceInteractionManager::DeInit() {
+ LOG(INFO) << "destructor is called";
+ if (m_bixby_manager_) {
+ m_bixby_manager_->DeInit();
+ }
+}
+
+void VoiceInteractionManager::InitBixbyandVIF() {
+ if (m_bixby_manager_) {
+ m_bixby_manager_->Init();
+ }
+ // Add vifmanager here
+}
+
+} // namespace samsung_browser_voice_interaction_manager
--- /dev/null
+#ifndef CHROME_BROWSER_UI_SAMSUNG_VOICE_INTERACTION_MANAGER_H_
+#define CHROME_BROWSER_UI_SAMSUNG_VOICE_INTERACTION_MANAGER_H_
+
+#include "chrome/browser/ui/samsung/bixby_manager.h"
+
+namespace samsung_browser_voice_interaction_manager {
+
+class VoiceInteractionManager {
+ public:
+ explicit VoiceInteractionManager();
+ virtual ~VoiceInteractionManager();
+
+ VoiceInteractionManager(const VoiceInteractionManager&) = delete;
+ VoiceInteractionManager& operator=(const VoiceInteractionManager&) = delete;
+
+ samsung_browser_voice_interaction_manager::BixbyManager* BixbyManager() {
+ return m_bixby_manager_.get();
+ }
+
+ void Init();
+ void DeInit();
+ void InitBixbyandVIF();
+
+ private:
+ std::unique_ptr<samsung_browser_voice_interaction_manager::BixbyManager>
+ m_bixby_manager_;
+};
+} // namespace samsung_browser_voice_interaction_manager
+#endif // CHROME_BROWSER_UI_SAMSUNG_VOICE_INTERACTION_MANAGER_H_
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * PROPRIETARY/CONFIDENTIAL
+ *
+ * This software is the confidential and proprietary information of
+ * Samsung Electronics Co., Ltd. ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall
+ * use it only in accordance with the terms of the license agreement
+ * you entered into with Samsung Electronics Co., Ltd. ("SAMSUNG").
+ *
+ * SAMSUNG MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
+ * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
+ * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SAMSUNG SHALL NOT BE
+ * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
+ * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+ */
+
+/**
+ * @file bixby.h
+ * @brief This is the header file for the %Bixby SDK module.
+ *
+ * This header file contains the declarations and descriptions of the %Bixby SDK
+ * module.
+ */
+
+#ifndef __SAMSUNG_EXPERIENCE_SERVICE_BIXBY_CAPI_BIXBY_H__
+#define __SAMSUNG_EXPERIENCE_SERVICE_BIXBY_CAPI_BIXBY_H__
+
+#include <bundle.h>
+#include <tizen.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup CAPI_BIXBY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for error codes.
+ * @since_ses 1
+ */
+typedef enum {
+ BIXBY_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ BIXBY_ERROR_INVALID_PARAMETER =
+ TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid Parameter */
+ BIXBY_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ BIXBY_ERROR_ALREADY_IN_PROGRESS =
+ TIZEN_ERROR_ALREADY_IN_PROGRESS, /**< Operation already in progress */
+ BIXBY_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
+ BIXBY_ERROR_PERMISSION_DENIED =
+ TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+ BIXBY_ERROR_INVALID_STATE = TIZEN_ERROR_UNKNOWN - 1, /**< Invalid State */
+ BIXBY_ERROR_OPERATION_FAILED =
+ TIZEN_ERROR_UNKNOWN - 2 /**< Operation Failed */
+} bixby_error_e;
+
+/**
+ * @brief Action handler for unique identification of action request.
+ * @since_ses 1
+ */
+typedef void* bixby_action_h;
+
+/**
+ * @brief State handler for unique identification of application state request.
+ * @since_ses 1
+ */
+typedef void* bixby_app_state_h;
+
+/**
+ * @brief Called when Bixby client (Bixby engine service application) requests
+ * current application state.
+ * @since_ses 1
+ *
+ * @remarks It has to call bixby_complete_app_state_request() to notify the
+ * state of the app to the Bixby client after this is called.
+ * @remarks The @a app_state_handler should not be released by application.
+ *
+ * @param[in] app_state_handler The ID of the request, which application has to
+ * specify back when calling bixby_complete_app_state_request().
+ * @param[in] user_data The user data to be passed to the callback
+ * function.
+ *
+ * @post bixby_complete_app_state_request()
+ *
+ * @see bixby_set_app_state_request_cb()
+ * @see bixby_unset_app_state_request_cb()
+ * @see bixby_complete_app_state_request()
+ */
+typedef void (*bixby_app_state_request_cb)(
+ const bixby_app_state_h app_state_handler,
+ void* user_data);
+
+/**
+ * @brief Called when the Bixby client requests some action to be executed in
+ * application.
+ * @since_ses 1
+ *
+ * @remarks It has to call bixby_complete_action_execution() to notify the
+ * result of the action to the Bixby client after this is called.
+ * @remarks The @a action_handler should not be released.
+ * @remarks The @a params should not be released by application. The @a params
+ * is managed by the platform and will be released when invocation of this
+ * callback is finished.
+ *
+ * @param[in] action_handler The ID of the request, which application has to
+ * specify back when calling bixby_complete_action_execution().
+ * @param[in] params The bundle data
+ * @param[in] user_data The user data to be passed to the callback
+ * function
+ *
+ * @post bixby_complete_action_execution()
+ *
+ * @see bixby_set_action_execution_cb()
+ * @see bixby_unset_action_execution_cb()
+ * @see bixby_complete_action_execution()
+ */
+typedef void (*bixby_action_execution_cb)(const bixby_action_h action_handler,
+ bundle* params,
+ void* user_data);
+
+/**
+ * @brief Creates the Bixby context as a singleton.
+ * @since_ses 1
+ *
+ * @return @c 0 on success, otherwise an error value
+ * @retval #BIXBY_ERROR_NONE Successful
+ * @retval #BIXBY_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #BIXBY_ERROR_NOT_SUPPORTED Not supported
+ * @retval #BIXBY_ERROR_OPERATION_FAILED Operation Failed
+ *
+ * @see bixby_deinitialize()
+ *
+ * @code
+static bool
+app_create(void *data)
+{
+ appdata_s *ad = data;
+
+ bixby_initialize();
+
+ bixby_set_action_execution_cb("viv.tablerez.FindRestaurants",
+_bixby_search_action_execution_cb, ad);
+ bixby_set_action_execution_cb("viv.tablerez.ReserveTable",
+_bixby_reserve_action_execution_cb, ad);
+
+ return true;
+}
+ * @endcode
+ */
+int bixby_initialize(void);
+
+/**
+ * @brief Destroys the Bixby context.
+ * @since_ses 1
+ *
+ * @return @c 0 on success, otherwise an error value
+ * @retval #BIXBY_ERROR_NONE Successful
+ * @retval #BIXBY_ERROR_OUT_OF_MEMORY Out of memory
+ *
+ * @pre bixby_initialize()
+ * @see bixby_initialize()
+ *
+ * @code
+static void
+app_terminate(void *data)
+{
+ // Release all resources.
+
+ bixby_unset_action_execution_cb("viv.tablerez.ReserveTable");
+ bixby_unset_action_execution_cb("viv.tablerez.FindRestaurants");
+
+ bixby_unset_app_state_request_cb();
+
+ bixby_deinitialize();
+}
+ * @endcode
+ *
+ */
+int bixby_deinitialize(void);
+
+/**
+ * @brief Sets a callback function to be invoked when the Bixby client requests
+current application state.
+ * @since_ses 1
+ *
+ * @param[in] callback The callback function to be registered
+ * @param[in] user_data The user data passed to bixby_app_state_request_cb()
+ *
+ * @return @c 0 on success, otherwise an error value
+ * @retval #BIXBY_ERROR_NONE Successful
+ * @retval #BIXBY_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #BIXBY_ERROR_INVALID_STATE Invalid State
+ * @retval #BIXBY_ERROR_INVALID_PARAMETER Invalid Parameter
+ *
+ * @pre bixby_initialize()
+ * @post bixby_app_state_request_cb() will be invoked.
+ *
+ * @see bixby_unset_app_state_request_cb()
+ * @see bixby_complete_app_state_request()
+ * @see bixby_app_state_request_cb()
+ *
+ * @code
+bool
+execute_search_service(const char* name, const char* cuisine)
+{
+ // DO Service
+
+ bixby_set_app_state_request_cb(_bixby_app_state_request_cb, NULL);
+
+ bixby_complete_action_execution("{\"result\" : \"success\" }");
+
+ return true;
+}
+ * @endcode
+ *
+ */
+int bixby_set_app_state_request_cb(bixby_app_state_request_cb callback,
+ void* user_data);
+
+/**
+ * @brief Unsets an app state request callback function.
+ * @since_ses 1
+ *
+ * @return @c 0 on success, otherwise an error value
+ * @retval #BIXBY_ERROR_NONE Successful
+ * @retval #BIXBY_ERROR_OUT_OF_MEMORY Out of memory
+ *
+ * @see bixby_set_app_state_request_cb()
+ * @see bixby_complete_app_state_request()
+ * @see bixby_app_state_request_cb()
+ *
+ * @code
+static void
+app_terminate(void *data)
+{
+ // Release all resources.
+
+ bixby_unset_action_execution_cb("viv.tablerez.ReserveTable");
+ bixby_unset_action_execution_cb("viv.tablerez.FindRestaurants");
+
+ bixby_unset_app_state_request_cb();
+
+ bixby_deinitialize();
+}
+ * @endcode
+ *
+ */
+int bixby_unset_app_state_request_cb(void);
+
+/**
+ * @brief Notifies that the app state to the Bixby client after the
+bixby_app_state_request_cb() callback is called.
+ * @since_ses 1
+ *
+ * @remarks The @a app_state is JSON string, and this has a user-defined format.
+Therefore, there is no fixed key and value string. \n
+ * The @a app_state should be released using free() by application
+after bixby_complete_app_state_request() call is returned.
+ *
+ * @param[in] app_state_handler The state handler for which app_state_request
+is completed.
+ * @param[in] app_state The result of the app state as JSON string.
+ *
+ * @return @c 0 on success, otherwise an error value
+ * @retval #BIXBY_ERROR_NONE Successful
+ * @retval #BIXBY_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #BIXBY_ERROR_INVALID_STATE Invalid State
+ * @retval #BIXBY_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #BIXBY_ERROR_OPERATION_FAILED Operation Failed
+ *
+ * @pre bixby_initialize()
+ * @pre bixby_set_app_state_request_cb()
+ *
+ * @see bixby_set_app_state_request_cb()
+ * @see bixby_unset_app_state_request_cb()
+ * @see bixby_app_state_request_cb()
+ *
+ * @code
+static void
+_bixby_app_state_request_cb(const bixby_app_state_h app_state_handler, void
+*user_data)
+{
+ // TODO : use json-glib to make json data
+
+ const char *app_state =
+ "{\"concepts\":[{\"type\":\"viv.tablerez.FindRestaurants\",\"values\":[{\"name\":\"Cloudz
+Hookah Lounge\",\"cuisines\":[\"Korean\"]}]}]}";
+
+ bixby_complete_app_state_request(app_state_handler, app_state);
+}
+ * @endcode
+ *
+ */
+int bixby_complete_app_state_request(bixby_app_state_h app_state_handler,
+ const char* app_state);
+
+/**
+ * @brief Sets a callback function to be invoked when the Bixby client requests
+some action to be executed.
+ * @since_ses 1
+ *
+ * @param[in] action_id The action ID to be executed.
+ * @param[in] callback The callback function to be registered
+ * @param[in] user_data The user data passed to bixby_action_execution_cb()
+ *
+ * @return @c 0 on success, otherwise an error value
+ * @retval #BIXBY_ERROR_NONE Successful
+ * @retval #BIXBY_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #BIXBY_ERROR_INVALID_STATE Invalid State
+ * @retval #BIXBY_ERROR_INVALID_PARAMETER Invalid Parameter
+ *
+ * @pre bixby_initialize()
+ *
+ * @post bixby_action_execution_cb() will be invoked.
+ *
+ * @code
+static bool
+app_create(void *data)
+{
+ appdata_s *ad = data;
+
+ bixby_initialize();
+
+ bixby_set_app_state_request_cb(_bixby_app_state_request_cb, ad);
+
+ bixby_set_action_execution_cb("viv.tablerez.FindRestaurants",
+_bixby_action_execution_cb, ad);
+ bixby_set_action_execution_cb("viv.tablerez.ReserveTable",
+_bixby_action_execution_cb, ad);
+
+ return true;
+}
+ * @endcode
+ *
+ */
+int bixby_set_action_execution_cb(const char* action_id,
+ bixby_action_execution_cb callback,
+ void* user_data);
+
+/**
+ * @brief Unsets an action execution callback function.
+ * @since_ses 1
+ *
+ * @remarks The @a action_id should be released using free() by application
+after bixby_unset_action_execution_cb() is returned.
+ *
+ * @param[in] action_id The action ID for which action execution callback would
+be unset.
+ *
+ * @return @c 0 on success, otherwise an error value
+ * @retval #BIXBY_ERROR_NONE Successful
+ * @retval #BIXBY_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #BIXBY_ERROR_INVALID_PARAMETER Invalid Parameter
+ *
+ * @see bixby_set_action_execution_cb()
+ *
+ * @code
+static void
+app_terminate(void *data)
+{
+ // Release all resources.
+
+ bixby_unset_action_execution_cb("viv.tablerez.ReserveTable");
+ bixby_unset_action_execution_cb("viv.tablerez.FindRestaurants");
+
+ bixby_unset_app_state_request_cb();
+
+ bixby_deinitialize();
+}
+ * @endcode
+ *
+ */
+int bixby_unset_action_execution_cb(const char* action_id);
+
+/**
+ * @brief Notifies that the results of the action to the Bixby client after the
+bixby_action_execution callback is called.
+ * @since_ses 1
+ *
+ * @remarks The @a action_result is JSON string, and this has a user-defined
+format. Therefore, there is no fixed key and value string.
+ * The @a action_result should be released using free() by application.
+ *
+ * @param[in] action_handler The action handler for which action is completed
+ * @param[in] action_result The results of the action as JSON string
+ *
+ * @return @c 0 on success, otherwise an error value
+ * @retval #BIXBY_ERROR_NONE Successful
+ * @retval #BIXBY_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #BIXBY_ERROR_INVALID_STATE Invalid State
+ * @retval #BIXBY_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #BIXBY_ERROR_OPERATION_FAILED Operation Failed
+ *
+ * @pre bixby_initialize()
+ * @pre bixby_set_action_execution_cb()
+ *
+ * @code
+bool
+execute_search_service(bixby_action_h action_handler, const char* cuisine)
+{
+ // DO Service
+
+ bixby_set_app_state_request_cb(_bixby_app_state_request_cb, NULL);
+
+ bixby_complete_action_execution(action_handler, "{\"result\" :
+\"success\" }");
+
+ return true;
+}
+* @endcode
+*
+*/
+int bixby_complete_action_execution(bixby_action_h action_handler,
+ const char* action_result);
+
+/**
+ * @brief Requests the action ID.
+ * @since_ses 1
+ *
+ * @remarks returns the @a action_id corresponding to the given @a
+action_handler.
+ * The @a action_id should be released using free() by application
+after bixby_complete_action_execution() call is returned.
+ *
+ * @param[in] action_handler The action handler for which action_id is
+requested
+ * @param[out] action_id The action ID corresponding to the @a
+action_handler
+ *
+ * @return @c 0 on success, otherwise an error value
+ * @retval #BIXBY_ERROR_NONE Successful
+ * @retval #BIXBY_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #BIXBY_ERROR_INVALID_STATE Invalid State
+ * @retval #BIXBY_ERROR_INVALID_PARAMETER Invalid Parameter
+ * @retval #BIXBY_ERROR_OPERATION_FAILED Operation Failed
+ *
+ * @pre bixby_initialize()
+ * @pre bixby_set_action_execution_cb()
+ *
+ * @code
+static void
+_bixby_search_action_execution_cb(const bixby_action_h action_handler, bundle
+*params, void *user_data)
+{
+ char* action_id;
+ if(bixby_get_action_name(actionHandler, &action_id))
+ return;
+ _D("%s action execution callback is called", action_id);
+ free(action_id);
+
+ char *name = NULL;
+ char *cuisine = NULL;
+
+ bundle_get_str(params, "name", &name);
+ bundle_get_str(params, "cuisine", &cuisine);
+
+ if (!name || !cuisine)
+ {
+ _E("mandatory param(s) missing.");
+ bixby_complete_action_execution(action_handler, NULL);
+
+ return;
+ }
+
+ execute_search_service(action_handler, name, cuisine);
+}
+* @endcode
+*
+*/
+int bixby_get_action_name(const bixby_action_h action_handler,
+ char** action_id);
+
+/** @} */ // end Bixby
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SAMSUNG_EXPERIENCE_SERVICE_BIXBY_CAPI_BIXBY_H__ */
--- /dev/null
+# Copyright 2023 Samsung Electronics.All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+source_set("bixby_provider") {
+ sources = [
+ "bixby_provider_impl.cc",
+ "bixby_provider_impl.h",
+ "../public/bixby_provider/bixby_provider.cc",
+ "../public/bixby_provider/bixby_provider.h",
+ ]
+
+ deps = [
+ "//skia",
+ "//ui/aura",
+ ]
+
+ public_deps = [ "//base" ]
+
+ configs += [
+ "//tizen_src/build:json-glib-1.0",
+ ]
+}
+
--- /dev/null
+// Copyright 2023 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/samsung/bixby_provider/bixby_provider_impl.h"
+
+#include <dlfcn.h>
+// #include <json-glib/json-glib.h>
+#include "base/logging.h"
+#include "components/samsung/public/bixby_provider/bixby_provider.h"
+
+namespace samsung_browser_main {
+
+using namespace samsung_browser_main;
+
+#define BIXBY_LIB_PATH APP_SAMSUNG_NEXT_BROWSER_ROOT_DIR "/lib/libbixby.so"
+
+const char* ACTION_OPEN_WEBSITE = "tvWebBrowser.AccessWebsite";
+const char* ACTION_SEARCH_IN_WEBBROWSER = "tvWebBrowser.SearchKeyword";
+const char* ACTION_OPEN_WEBBROWSER = "tvLauncher.Open";
+const char* ACTION_CLOSE_WEBBROWSER = "tvLauncher.Close";
+
+const char* ACTION_SHOW_VOICEHINT_WEBBROWSER = "tvWebBrowser.showVoiceHints";
+const char* ACTION_SELECT_VOICEHINT_WEBBROWSER = "tvWebBrowser.selectVoiceHint";
+const char* ACTION_ZOOM_WEBBROWSER = "tvWebBrowser.zoomChange";
+const char* ACTION_SCROLL_WEBBROWSER = "tvWebBrowser.scrollChange";
+
+constexpr char DEFAULT[] = "default";
+constexpr char HOMEPAGE[] = "homepage";
+const char* WebBrowser_TV_1_1 =
+ "WebBrowser_TV_1_1_OpenAWebSite_WebsiteName_MatchedwithTable_N";
+const char* WebBrowser_TV_1_4 = "WebBrowser_TV_1_4_OpenAWebSite_Popup_Exist_Y";
+const char* WebBrowser_TV_1_5 =
+ "WebBrowser_TV_1_5_OpenAWebSite_WebsiteName_MatchedwithTable_Y";
+const char* WebBrowser_TV_2_6 =
+ "WebBrowser_TV_2_6_SearchAKeywordInWebBrowser_SearchKeyword_UserSaid_Y";
+const char* WebBrowser_TV_2_7 =
+ "WebBrowser_TV_2_7_SearchAKeywordInWebBrowser_Popup_Exist_Y";
+const char* WebBrowser_TV_2_8 =
+ "WebBrowser_TV_2_8_SearchAKeywordInWebBrowser_SearchKeyword_UserSaid_N";
+const char* WebBrowser_TV_2_9 =
+ "WebBrowser_TV_2_9_SearchAKeywordInWebBrowser_SearchWebsiteName_Valid_N";
+
+const char* WebBrowser_TV_1_1_VoiceHintsShown_Y =
+ "WebBrowser_TV_1_1_VoiceHintsShown_Y";
+const char* WebBrowser_TV_1_1_VoiceHintsShown_N =
+ "WebBrowser_TV_1_1_VoiceHintsShown_N";
+const char* WebBrowser_TV_1_1_VoiceHintsSelected_Y =
+ "WebBrowser_TV_1_1_VoiceHintsSelected_Y";
+const char* WebBrowser_TV_1_1_VoiceHintsSelected_N =
+ "WebBrowser_TV_1_1_VoiceHintsSelected_N";
+
+const char* ACTION_CHANGE_BOOKMARKS = "tvWebBrowser.BookmarkWebpage";
+const char* ACTION_CHANGE_WATCH_LATER = "tvWebBrowser.WatchLater";
+
+BixbyProviderImpl::BixbyProviderImpl(BixbyProvider* bixby_provider)
+ : m_initialized(false), bixby_provider_(bixby_provider) {}
+
+BixbyProviderImpl::~BixbyProviderImpl() {
+ LOG(INFO) << "Destructor start";
+ DeInit();
+}
+
+bool BixbyProviderImpl::Init() {
+ LOG(INFO) << "Init start";
+ if (m_initialized) {
+ LOG(INFO) << "Already Initialized";
+ return true;
+ }
+ if (!OpenBixbyLibrary()) {
+ return false;
+ }
+
+ if (bixby_initialize_func() != BIXBY_ERROR_NONE) {
+ LOG(INFO) << "Failed to initialize the bixby";
+ }
+ bixby_set_app_state_request_cb_func(AppContextCb, this);
+ bixby_set_action_execution_cb_func(ACTION_OPEN_WEBSITE, OpenWebsiteCb, this);
+ bixby_set_action_execution_cb_func(ACTION_SEARCH_IN_WEBBROWSER,
+ SearchInWebbrowserCb, this);
+ bixby_set_action_execution_cb_func(ACTION_OPEN_WEBBROWSER, OpenWebbrowserCb,
+ this);
+ bixby_set_action_execution_cb_func(ACTION_CLOSE_WEBBROWSER, CloseWebbrowserCb,
+ this);
+ m_initialized = true;
+ return true;
+}
+
+void BixbyProviderImpl::DeInit() {
+ LOG(INFO) << "DeInit start";
+ if (!m_initialized) {
+ LOG(INFO) << "Already DeInitialized";
+ return;
+ }
+ bixby_deinitialize_func();
+ m_initialized = false;
+}
+
+bool BixbyProviderImpl::OpenBixbyLibrary() {
+ if (bixby_lib_handle) {
+ return bixby_lib_handle;
+ }
+ bixby_lib_handle = dlopen(BIXBY_LIB_PATH, RTLD_NOW);
+ if (!bixby_lib_handle) {
+ LOG(ERROR) << "dlopen error : " << dlerror();
+ return false;
+ }
+ LOG(INFO) << "Bixby lib dlopen done";
+
+ bixby_initialize_func = reinterpret_cast<bixby_initialize>(
+ dlsym(bixby_lib_handle, "bixby_initialize"));
+ bixby_deinitialize_func = reinterpret_cast<bixby_deinitialize>(
+ dlsym(bixby_lib_handle, "bixby_deinitialize"));
+ bixby_set_app_state_request_cb_func =
+ reinterpret_cast<bixby_set_app_state_request_cb>(
+ dlsym(bixby_lib_handle, "bixby_set_app_state_request_cb"));
+ bixby_set_action_execution_cb_func =
+ reinterpret_cast<bixby_set_action_execution_cb>(
+ dlsym(bixby_lib_handle, "bixby_set_action_execution_cb"));
+ bixby_complete_app_state_request_func =
+ reinterpret_cast<bixby_complete_app_state_request>(
+ dlsym(bixby_lib_handle, "bixby_complete_app_state_request"));
+
+ LOG(INFO) << "Samsung Cloud lib function pointers resolved";
+
+ return true;
+}
+
+gchar* BixbyProviderImpl::GetResultJsonData() {
+ LOG(INFO) << "";
+ /*
+ JsonBuilder *builder = json_builder_new ();
+ JsonNode *node = NULL;
+ JsonGenerator *generator = NULL;
+ gsize length = 0;
+ gchar *data = NULL;
+
+ // make result json data
+ json_builder_begin_object (builder);
+
+ json_builder_set_member_name (builder, "AppId");
+ json_builder_add_string_value (builder, "org.tizen.browser");
+
+ json_builder_set_member_name (builder, "AppVersion");
+ json_builder_add_string_value (builder, "10000");
+
+ json_builder_set_member_name (builder, "CapsuleId");
+ json_builder_add_string_value (builder, "samsung.tvLauncher");
+
+ json_builder_set_member_name (builder, "ContextBlob");
+
+ json_builder_add_string_value (builder, "{\"concepts\" : [{\"type\" :
+\"samsung.tvLauncher.WebBrowserInfo\",\"values\" :
+[{\"app_id\":\"org.tizen.browser\",\"description\":\"TV Web Browser
+AppContext\"}]}]}");
+
+ json_builder_end_object (builder);
+
+ node = json_builder_get_root (builder);
+ g_object_unref (builder);
+
+ generator = json_generator_new ();
+ json_generator_set_root (generator, node);
+
+ // convert json data into string
+ data = json_generator_to_data (generator, &length);
+
+ json_node_free (node);
+ g_object_unref (generator);
+LOG(INFO)<<"";
+ { "AppId" : "org.tizen.browser", "AppVersion" : "10000", "CapsuleId" :
+"samsung.tvLauncher", "ContextBlob" : "{\"concepts\" : [{\"type\" :
+\"samsung.tvLauncher.WebBrowserInfo\",\"values\" :
+[{\"app_id\":\"org.tizen.browser\",\"description\":\"TV Web Browser
+AppContext\"}]}]}" }
+ */
+ gchar* data = NULL;
+ return data;
+}
+
+void BixbyProviderImpl::AppContextCb(const bixby_app_state_h app_state_handler,
+ void* user_data) {
+ LOG(INFO) << "";
+ BixbyProviderImpl* self = static_cast<BixbyProviderImpl*>(user_data);
+ if (!self) {
+ LOG(INFO) << "Error casting to self";
+ return;
+ }
+ // char* result = self->GetResultJsonData();
+ std::string result =
+ "{ \"AppId\" : \"org.tizen.browser\", \"AppVersion\" : \"10000\", "
+ "\"CapsuleId\" : \"samsung.tvLauncher\", \"ContextBlob\" : "
+ "\"{\"concepts\" : [{\"type\" : "
+ "\"samsung.tvLauncher.WebBrowserInfo\",\"values\" : "
+ "[{\"app_id\":\"org.tizen.browser\",\"description\":\"TV Web Browser "
+ "AppContext\"}]}]}\" }";
+ self->bixby_complete_app_state_request_func(app_state_handler,
+ result.c_str());
+
+ // if (result) {
+ // free(result);
+ // }
+}
+
+void BixbyProviderImpl::OpenWebsiteCb(const bixby_action_h action_handler,
+ bundle* params,
+ void* user_data) {
+ LOG(INFO) << "";
+ BixbyProviderImpl* self = static_cast<BixbyProviderImpl*>(user_data);
+ if (!self) {
+ LOG(INFO) << "self is null, return";
+ return;
+ }
+ char* websiteName = NULL;
+ bundle_get_str(params, "url", &websiteName);
+ if (websiteName != NULL && *websiteName != '\0') {
+ LOG(INFO) << "Calling bixby provider";
+ self->bixby_provider_->OpenWebsiteCb(std::string(websiteName));
+ }
+}
+
+void BixbyProviderImpl::SearchInWebbrowserCb(
+ const bixby_action_h action_handler,
+ bundle* params,
+ void* user_data) {
+ LOG(INFO) << "";
+ BixbyProviderImpl* self = static_cast<BixbyProviderImpl*>(user_data);
+ if (!self) {
+ LOG(INFO) << "self is null, return";
+ return;
+ }
+}
+
+void BixbyProviderImpl::OpenWebbrowserCb(const bixby_action_h action_handler,
+ bundle* params,
+ void* user_data) {
+ LOG(INFO) << "";
+}
+
+void BixbyProviderImpl::CloseWebbrowserCb(const bixby_action_h action_handler,
+ bundle* params,
+ void* user_data) {
+ LOG(INFO) << "";
+}
+
+} // namespace samsung_browser_main
\ No newline at end of file
--- /dev/null
+// Copyright 2023 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SAMSUNG_BIXBY_PROVIDER_BIXBY_PROVIDER_IMPL_H_
+#define COMPONENTS_SAMSUNG_BIXBY_PROVIDER_BIXBY_PROVIDER_IMPL_H_
+
+#include <glib.h>
+
+#include "base/memory/raw_ptr.h"
+#include "components/samsung/bixby/bixby.h"
+
+namespace samsung_browser_main {
+
+class BixbyProvider;
+
+typedef int (*bixby_initialize)(void);
+typedef int (*bixby_deinitialize)(void);
+typedef int (*bixby_set_app_state_request_cb)(bixby_app_state_request_cb,
+ void*);
+typedef int (*bixby_set_action_execution_cb)(const char*,
+ bixby_action_execution_cb,
+ void*);
+typedef int (*bixby_complete_app_state_request)(bixby_app_state_h, const char*);
+
+class BixbyProviderImpl {
+ public:
+ explicit BixbyProviderImpl(BixbyProvider* bixby_provider);
+ ~BixbyProviderImpl();
+ BixbyProviderImpl(const BixbyProviderImpl&) = delete;
+ BixbyProviderImpl& operator=(const BixbyProviderImpl&) = delete;
+
+ bool Init();
+ void DeInit();
+ gchar* GetResultJsonData();
+
+ private:
+ bool OpenBixbyLibrary();
+ static void AppContextCb(const bixby_app_state_h app_state_handler,
+ void* user_data);
+ static void OpenWebsiteCb(const bixby_action_h action_handler,
+ bundle* params,
+ void* user_data);
+ static void OpenWebbrowserCb(const bixby_action_h action_handler,
+ bundle* params,
+ void* user_data);
+ static void CloseWebbrowserCb(const bixby_action_h action_handler,
+ bundle* params,
+ void* user_data);
+ static void SearchInWebbrowserCb(const bixby_action_h action_handler,
+ bundle* params,
+ void* user_data);
+
+ raw_ptr<BixbyProvider> bixby_provider_;
+ bool m_initialized;
+ void* bixby_lib_handle = nullptr;
+ bixby_initialize bixby_initialize_func;
+ bixby_deinitialize bixby_deinitialize_func;
+ bixby_set_app_state_request_cb bixby_set_app_state_request_cb_func;
+ bixby_set_action_execution_cb bixby_set_action_execution_cb_func;
+ bixby_complete_app_state_request bixby_complete_app_state_request_func;
+};
+} // namespace samsung_browser_main
+
+#endif // COMPONENTS_SAMSUNG_BIXBY_PROVIDER_BIXBY_PROVIDER_IMPL_H_
\ No newline at end of file
--- /dev/null
+// Copyright 2023 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/samsung/public/bixby_provider/bixby_provider.h"
+
+#include "base/logging.h"
+#include "components/samsung/bixby_provider/bixby_provider_impl.h"
+
+namespace samsung_browser_main {
+
+using namespace samsung_browser_main;
+
+BixbyProvider::BixbyProvider() : m_initialized(false) {}
+
+BixbyProvider::~BixbyProvider() {
+ LOG(INFO) << "Destructor start";
+ DeInit();
+}
+
+bool BixbyProvider::Init() {
+ LOG(INFO) << "Init start";
+ if (m_initialized) {
+ LOG(INFO) << "Already Initialized";
+ return true;
+ }
+ bixby_provider_impl_ = std::make_unique<BixbyProviderImpl>(this);
+ bixby_provider_impl_->Init();
+ m_initialized = true;
+ return true;
+}
+
+void BixbyProvider::DeInit() {
+ LOG(INFO) << "DeInit start";
+ if (!m_initialized) {
+ LOG(INFO) << "Already DeInitialized";
+ return;
+ }
+ m_initialized = false;
+}
+
+void BixbyProvider::AddObserver(Observer* observer) {
+ LOG(INFO) << "Adding observer";
+ m_observer_list.AddObserver(observer);
+}
+
+void BixbyProvider::RemoveObserver(Observer* observer) {
+ LOG(INFO) << "Removing observer";
+ m_observer_list.RemoveObserver(observer);
+}
+
+void BixbyProvider::OpenWebsiteCb(std::string url) {
+ LOG(INFO) << "";
+ for (auto& observer : m_observer_list) {
+ observer.OpenWebsiteCb(url);
+ }
+}
+
+} // namespace samsung_browser_main
\ No newline at end of file
--- /dev/null
+// Copyright 2023 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SAMSUNG_PUBLIC_BIXBY_PROVIDER_BIXBY_PROVIDER_H_
+#define COMPONENTS_SAMSUNG_PUBLIC_BIXBY_PROVIDER_BIXBY_PROVIDER_H_
+
+#include <memory>
+#include <string>
+
+#include "base/observer_list.h"
+
+namespace samsung_browser_main {
+
+class BixbyProviderImpl;
+
+class BixbyProvider {
+ public:
+ explicit BixbyProvider();
+ ~BixbyProvider();
+ BixbyProvider(const BixbyProvider&) = delete;
+ BixbyProvider& operator=(const BixbyProvider&) = delete;
+
+ bool Init();
+ void DeInit();
+
+ class Observer {
+ public:
+ virtual ~Observer() = default;
+ virtual void OpenWebsiteCb(std::string url){};
+ };
+
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
+ void OpenWebsiteCb(std::string url);
+
+ private:
+ base::ObserverList<Observer>::Unchecked m_observer_list;
+ std::unique_ptr<BixbyProviderImpl> bixby_provider_impl_;
+ bool m_initialized;
+};
+} // namespace samsung_browser_main
+
+#endif // COMPONENTS_SAMSUNG_PUBLIC_BIXBY_PROVIDER_BIXBY_PROVIDER_H_
\ No newline at end of file
#include "components/samsung/public/samsung_utility.h"
+#include <string.h>
#include <chrono>
#include <ctime>
#include <iomanip>
+#include <memory>
#include <random>
#include <sstream>
return ret;
}
+void* samsung_utility::base64_decode(const std::string& encoded_string,
+ int& len) {
+ int in_len = encoded_string.size();
+ int i = 0;
+ int j = 0;
+ int in_ = 0;
+ unsigned char char_array_4[4], char_array_3[3];
+ std::vector<unsigned char> image_data;
+ int arr4_len = sizeof(char_array_4) / sizeof(char);
+ int arr3_len = sizeof(char_array_3) / sizeof(char);
+
+ while (in_len-- && (encoded_string[in_] != '=') &&
+ is_base64(encoded_string[in_])) {
+ char_array_4[i++] = encoded_string[in_];
+ in_++;
+ if (i == 4) {
+ for (i = 0; i < arr4_len; i++) {
+ char_array_4[i] =
+ static_cast<unsigned char>(base64_chars.find(char_array_4[i]));
+ }
+
+ char_array_3[0] =
+ (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
+ char_array_3[1] =
+ ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
+ char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
+
+ for (i = 0; (i < arr3_len); i++) {
+ image_data.push_back(char_array_3[i]);
+ }
+ i = 0;
+ }
+ }
+
+ if (i) {
+ for (j = i; j < arr4_len; j++) {
+ char_array_4[j] = 0;
+ }
+
+ for (j = 0; j < arr4_len; j++) {
+ char_array_4[j] =
+ static_cast<unsigned char>(base64_chars.find(char_array_4[j]));
+ }
+
+ char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
+ char_array_3[1] =
+ ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
+ char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
+
+ for (j = 0; (j < i - 1) && (j < arr3_len); j++) {
+ image_data.push_back(char_array_3[j]);
+ }
+ }
+
+ len = image_data.size();
+ void* ret = nullptr;
+ ret = malloc(len);
+ memcpy(ret, static_cast<void*>(image_data.data()), len);
+
+ return ret;
+}
+
+inline bool samsung_utility::is_base64(unsigned char c) {
+ return (isalnum(c) || (c == '+') || (c == '/'));
+}
+
samsung_browser_main::CursorImage
samsung_utility::DirectionKeyToScrollCursorImage(const std::string& key) {
if (!keynameArrowLeft.compare(key)) {
std::string generate_hex(const unsigned int len);
std::string base64_encode(const void*, int);
+void* base64_decode(const std::string&, int&);
+bool is_base64(unsigned char);
samsung_browser_main::CursorImage DirectionKeyToScrollCursorImage(
const std::string& key);
samsung_browser_main::DirectionType DirectionKeyToEnum(const std::string& key);
BuildRequires: pkgconfig(capi-window-tv)
BuildRequires: pkgconfig(VDCurl)
BuildRequires: pkgconfig(capi-media-image-util)
+BuildRequires: pkgconfig(json-glib-1.0)
%endif
# Applied python acceleration for generating gyp files.
install -m 0755 "%{OUTPUT_FOLDER}"/libchromium-ewk.so %{_buildroot_next_browser}/lib
install -m 0755 ./components/samsung/samsung_cloud/libsamsungcloud.so %{_buildroot_next_browser}/lib
install -m 0755 ./components/samsung/mcf/libmcf_api.so %{_buildroot_next_browser}/lib
+ install -m 0755 ./components/samsung/bixby/libbixby.so %{_buildroot_next_browser}/lib
install -m 0755 ./chrome/browser/ui/webui/samsung/js/*.js %{_buildroot_next_browser}/res/js
install -m 0755 ./chrome/browser/resources/samsung/locales/internal/*.po %{_buildroot_next_browser}/res/locale/internal
install -m 0755 ./chrome/browser/resources/samsung/locales/web-ui/*.json %{_buildroot_next_browser}/res/locale/webui
tizen_pkg_config("libcapi-cloud-bookmark"){
packages = [ "capi-cloud-bookmark" ]
}
+
+ config("json-glib-1.0"){
+ ldflags = ["-ljson-glib-1.0"]
+ }
+
+ tizen_pkg_config("libjson-glib-1.0"){
+ packages = [ "json-glib-1.0" ]
+ }
}
#Next browser package ends
install -m 0755 ${build_root_next_browser}/lib/libchromium-ewk.so ${tpk_root}/lib
install -m 0755 ${build_root_next_browser}/lib/libsamsungcloud.so ${tpk_root}/lib
install -m 0755 ${build_root_next_browser}/lib/libmcf_api.so ${tpk_root}/lib
+install -m 0755 ${build_root_next_browser}/lib/libbixby.so ${tpk_root}/lib
install -m 0644 ${build_root_next_browser}/res/js/*.js ${tpk_root}/res/js
install -m 0644 ${build_root_next_browser}/res/locale/internal/*.po ${tpk_root}/res/locale/internal/
install -m 0644 ${build_root_next_browser}/res/locale/webui/*.json ${tpk_root}/res/locale/webui/