From e8797438904fc039503b3ac1dce5245835c6fbe3 Mon Sep 17 00:00:00 2001 From: Akshay Kanagali Date: Mon, 19 Feb 2024 14:35:20 +0530 Subject: [PATCH 01/16] [M120 Migration] Show the context menu and settings menu This patch includes below to show the context menu and settings menu. - Set the type of each window - Focus on evas objects - Implement event capture - Separation of header and source file of ElfWindowManager - Implement |EflWindow::IsVisible| - Convert event location for submenu References : https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/302447 https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/302577 https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/302685 https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/302811 https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/302528 Change-Id: I32bf5fadb2fcd78a9cce6f7d8ad74d0c6e4fb542 Signed-off-by: Akshay Kanagali --- .../chromium_impl/ui/ozone/platform/efl/BUILD.gn | 1 + .../ui/ozone/platform/efl/efl_event_handler.cc | 7 ++ .../ui/ozone/platform/efl/efl_event_handler.h | 4 + .../ui/ozone/platform/efl/efl_window.cc | 140 ++++++++++++++------- .../ui/ozone/platform/efl/efl_window.h | 4 + .../ui/ozone/platform/efl/efl_window_manager.cc | 61 +++++++++ .../ui/ozone/platform/efl/efl_window_manager.h | 59 ++++----- 7 files changed, 200 insertions(+), 76 deletions(-) create mode 100644 tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.cc diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/BUILD.gn b/tizen_src/chromium_impl/ui/ozone/platform/efl/BUILD.gn index 6bfe089..84d19a4 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/BUILD.gn +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/BUILD.gn @@ -22,6 +22,7 @@ source_set("efl") { "efl_surface_factory.h", "efl_window.cc", "efl_window.h", + "efl_window_manager.cc", "efl_window_manager.h", "im_context_efl.cc", "im_context_efl.h", diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc index 6a33c98..6687966 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc @@ -790,6 +790,13 @@ bool EflEventHandler::FilterIMEKeyUpEvent(Evas_Event_Key_Up* key_up) { return false; } +void EflEventHandler::ConvertOriginToTarget(const EflWindow* new_target, + LocatedEvent* event) const { + gfx::Vector2d diff = window_->GetBoundsInDIP().origin() - + new_target->GetBoundsInDIP().origin(); + event->set_location_f(event->location_f() + diff); +} + // New requirement from tizen 6.5: // press "up" key on the top of IME panel should handled as same behavior as // press "Return Back" key on IME panel behavior: diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.h b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.h index 27d9e81..7bda5e8 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.h +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.h @@ -21,6 +21,7 @@ class EflWindow; class EflPlatformEventSource; class IMContextEfl; class KeyEvent; +class LocatedEvent; class TouchEvent; // Keyboard @@ -60,6 +61,9 @@ class EflEventHandler { } IMContextEfl* GetIMContextEfl() { return im_context_efl_; } + void ConvertOriginToTarget(const EflWindow* new_target, + LocatedEvent* event) const; + #if BUILDFLAG(IS_TIZEN_TV) void SetKeyEventChecker( const base::RepeatingCallback& checker); diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc index 2cc3995..d72b443 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc @@ -31,10 +31,37 @@ namespace ui { namespace { -Ecore_Evas* prepared_ee = nullptr; +#if defined(USE_WAYLAND) +Ecore_Wl2_Window_Type GetEcoreWl2WindowType(PlatformWindowType type) { + Ecore_Wl2_Window_Type window_type = ECORE_WL2_WINDOW_TYPE_NONE; + + switch (type) { + case PlatformWindowType::kWindow: + window_type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL; + break; + case PlatformWindowType::kPopup: + case PlatformWindowType::kMenu: + case PlatformWindowType::kTooltip: + case PlatformWindowType::kBubble: + window_type = ECORE_WL2_WINDOW_TYPE_UTILITY; + break; + case PlatformWindowType::kDrag: + window_type = ECORE_WL2_WINDOW_TYPE_DND; + break; + default: + window_type = ECORE_WL2_WINDOW_TYPE_NONE; + } + + return window_type; +} +#endif + +bool g_evas_init = false; } // namespace +Ecore_Evas* prepared_ee = nullptr; + #if BUILDFLAG(IS_TIZEN_TV) bool EflWindow::is_cursor_initialized_ = false; #endif @@ -93,22 +120,11 @@ void EflWindow::Show(bool inactive) { switches::kEnableOffscreenRendering)) return; -#if defined(ENABLE_WRT_JS) - // For now, only show kWindow and kSplashScreen, ignore other types : kMenu, - // kTootltip etc. - if (type_ != PlatformWindowType::kWindow && - type_ != PlatformWindowType::kSplashScreen) { - return; - } -#else - // For now, only show kWindow and ignore other types : kMenu, kTootltip etc. - if (type_ != PlatformWindowType::kWindow) - return; -#endif - if (events_overlay_) evas_object_show(events_overlay_); - +#if defined(USE_WAYLAND) + ecore_wl2_window_show(wl_window_); +#endif ecore_evas_show(ee_); // Request to redraw window surface when showing. If not, a black screen will @@ -121,12 +137,11 @@ void EflWindow::Hide() { switches::kEnableOffscreenRendering)) return; - if (type_ != PlatformWindowType::kWindow) - return; - if (events_overlay_) evas_object_hide(events_overlay_); - +#if defined(USE_WAYLAND) + ecore_wl2_window_hide(wl_window_); +#endif ecore_evas_hide(ee_); } @@ -135,8 +150,7 @@ void EflWindow::Close() { } bool EflWindow::IsVisible() const { - NOTIMPLEMENTED(); - return false; + return ecore_evas_visibility_get(ee_); } void EflWindow::PrepareForShutdown() { @@ -153,7 +167,14 @@ void EflWindow::SetBoundsInPixels(const gfx::Rect& bounds) { return; } + int rotation = ecore_evas_rotation_get(ee_); + LOG(INFO) << " bounds " << bounds.ToString() << " rotation " << rotation; + #if defined(USE_WAYLAND) + ecore_wl2_window_rotation_geometry_set(wl_window_, rotation, bounds.x(), + bounds.y(), bounds.width(), + bounds.height()); + if (wl2_egl_window_) { ecore_wl2_egl_window_resize_with_rotation(wl2_egl_window_, bounds.x(), bounds.y(), bounds.width(), @@ -182,16 +203,19 @@ void EflWindow::SetTitle(const std::u16string& title) { } void EflWindow::SetCapture() { - NOTIMPLEMENTED(); + if (!HasCapture()) { + window_manager_->GrabLocatedEvents(this); + } } void EflWindow::ReleaseCapture() { - NOTIMPLEMENTED(); + if (HasCapture()) { + window_manager_->UngrabLocatedEvents(this); + } } bool EflWindow::HasCapture() const { - NOTIMPLEMENTED(); - return false; + return window_manager_->located_events_grabber() == this; } void EflWindow::SetFullscreen(bool fullscreen, int64_t target_display_id) { @@ -211,7 +235,6 @@ void EflWindow::Restore() { } PlatformWindowState EflWindow::GetPlatformWindowState() const { - NOTIMPLEMENTED(); return PlatformWindowState::kNormal; } @@ -270,6 +293,11 @@ void EflWindow::UpdateFocus(bool focused) { return; has_focus_ = focused; + + if (events_overlay_) { + evas_object_focus_set(events_overlay_, focused); + } + if (!focused) return; @@ -278,7 +306,28 @@ void EflWindow::UpdateFocus(bool focused) { window_manager_->UpdateWindowFocus(this, focused); } -uint32_t EflWindow::DispatchEvent(const PlatformEvent& event) { +uint32_t EflWindow::DispatchEvent(const PlatformEvent& native_event) { + Event* event = static_cast(native_event); + + if (event->IsLocatedEvent()) { + auto* event_grabber = window_manager_->located_events_grabber(); + if (event_grabber) { + // The origin of the submenu event needs to be changed to the root menu. + efl_event_handler_->ConvertOriginToTarget(event_grabber, + event->AsLocatedEvent()); + event_grabber->DispatchEventToDelegate(event); + return POST_DISPATCH_STOP_PROPAGATION; + } + } + + return DispatchEventToDelegate(event); +} + +void EflWindow::OnWindowLostCapture() { + delegate_->OnLostCapture(); +} + +uint32_t EflWindow::DispatchEventToDelegate(const PlatformEvent& event) { bool handled = DispatchEventFromNativeUiEvent( event, base::BindOnce(&PlatformWindowDelegate::DispatchEvent, base::Unretained(delegate_))); @@ -296,8 +345,11 @@ void EflWindow::Initialize(const PlatformWindowInitProperties& properties) { return; } - ecore_evas_init(); - evas_init(); + if (!g_evas_init) { + ecore_evas_init(); + evas_init(); + g_evas_init = true; + } if (prepared_ee) { LOG(INFO) << "Use prepared ee instance"; @@ -319,14 +371,13 @@ void EflWindow::Initialize(const PlatformWindowInitProperties& properties) { ecore_evas_manual_render_set(ee_, EINA_TRUE); #if defined(USE_WAYLAND) - Ecore_Wl2_Window* ww = ecore_evas_wayland2_window_get(ee_); - if (!ww) { + wl_window_ = ecore_evas_wayland2_window_get(ee_); + if (!wl_window_) { LOG(ERROR) << "Failed to get Wl2 window"; return; } - - wl2_egl_window_ = - ecore_wl2_egl_window_create(ww, bounds_.width(), bounds_.height()); + wl2_egl_window_ = ecore_wl2_egl_window_create(wl_window_, bounds_.width(), + bounds_.height()); if (!wl2_egl_window_) { LOG(ERROR) << "Failed to create wl2 egl window"; return; @@ -335,7 +386,7 @@ void EflWindow::Initialize(const PlatformWindowInitProperties& properties) { #if defined(TIZEN_VIDEO_HOLE) // Hand a window handle to enable video hole in OnscreenRendering mode. media::VideoPlaneController::SetSharedVideoWindowHandle( - ww, media::VideoPlaneController::RenderingMode::ONSCREEN); + wl_window_, media::VideoPlaneController::RenderingMode::ONSCREEN); #endif void* egl_window = ecore_wl2_egl_window_native_get(wl2_egl_window_); @@ -346,13 +397,15 @@ void EflWindow::Initialize(const PlatformWindowInitProperties& properties) { delegate_->OnAcceleratedWidgetAvailable( reinterpret_cast(egl_window)); + + if (type_ != PlatformWindowType::kWindow) { + ecore_wl2_window_type_set(wl_window_, GetEcoreWl2WindowType(type_)); + ecore_wl2_window_position_set(wl_window_, bounds_.x(), bounds_.y()); + } #else delegate_->OnAcceleratedWidgetAvailable(ecore_evas_window_get(ee_)); #endif - if (type_ != PlatformWindowType::kWindow) - return; - // Initialize efl event handler for main window events_overlay_ = evas_object_rectangle_add(ecore_evas_get(ee_)); evas_object_color_set(events_overlay_, 0, 0, 0, 255); @@ -360,11 +413,15 @@ void EflWindow::Initialize(const PlatformWindowInitProperties& properties) { InitializeEventHandler(); + window_manager_->AddWindow(this, events_overlay_); + #if BUILDFLAG(IS_TIZEN_TV) CreateMouseCursor(); #endif - EflScreen::UpdateDisplayInfo(ee_); + if (type_ == PlatformWindowType::kWindow) { + EflScreen::UpdateDisplayInfo(ee_); + } } #if BUILDFLAG(IS_TIZEN_TV) @@ -405,9 +462,6 @@ void EflWindow::InitializeEventHandler() { // Set activation true on window to capture key events. delegate_->OnActivationChanged(true /*active*/); - // Set focus active for a newly opened window. - UpdateFocus(true); - efl_event_handler_ = std::make_unique(this); PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); } @@ -452,6 +506,8 @@ void EflWindow::SetEventsOverlayForOffscreen(Evas_Object* events_overlay) { InitializeEventHandler(); + window_manager_->AddWindow(this, events_overlay_); + #if BUILDFLAG(IS_TIZEN) // Create IMContextEfl only after event handler is instantiated, because // content layer gets IMContextEfl through EflEventHandler. diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.h b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.h index 4fb6d34..d1c0d06 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.h +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.h @@ -79,6 +79,8 @@ class EflWindow : public PlatformWindow, public PlatformEventDispatcher { void UpdateFocus(bool focused); void SetFocus(bool focused) { has_focus_ = focused; } + void OnWindowLostCapture(); + Evas* evas() const { return evas_; } Evas_Object* native_view() const { return events_overlay_; } @@ -95,6 +97,7 @@ class EflWindow : public PlatformWindow, public PlatformEventDispatcher { void InitializeEventHandler(); void ResetEventHandler(); void EnsureIMContextEfl(); + uint32_t DispatchEventToDelegate(const PlatformEvent& event); #if BUILDFLAG(IS_TIZEN_TV) void CreateMouseCursor(); static bool is_cursor_initialized_; @@ -124,6 +127,7 @@ class EflWindow : public PlatformWindow, public PlatformEventDispatcher { Evas_Object* events_overlay_ = nullptr; #if defined(USE_WAYLAND) + Ecore_Wl2_Window* wl_window_ = nullptr; Ecore_Wl2_Egl_Window* wl2_egl_window_ = nullptr; #endif diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.cc b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.cc new file mode 100644 index 0000000..76012a1 --- /dev/null +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.cc @@ -0,0 +1,61 @@ +// Copyright (c) 2021 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 "ui/ozone/platform/efl/efl_window_manager.h" + +#include "ui/ozone/platform/efl/efl_window.h" + +namespace ui { + +EflWindowManager::EflWindowManager() = default; +EflWindowManager::~EflWindowManager() = default; + +void EflWindowManager::AddWindow(EflWindow* window, Evas_Object* eo) { + window_map_[eo] = window; +} + +EflWindow* EflWindowManager::GetWindow(Evas_Object* eo) const { + auto it = window_map_.find(eo); + return it == window_map_.end() ? nullptr : it->second; +} + +void EflWindowManager::RemoveWindow(Evas_Object* eo) { + auto* window = window_map_[eo]; + DCHECK(window); + window_map_.erase(eo); +} + +void EflWindowManager::UpdateWindowFocus(EflWindow* window, bool focused) { + for (const auto& item : window_map_) { + if (item.second != window) { + item.second->SetFocus(false); + } + } +} + +std::vector EflWindowManager::GetAllOpenWindows() const { + std::vector all_windows; + for (const auto& item : window_map_) { + all_windows.push_back(item.second); + } + return all_windows; +} + +void EflWindowManager::GrabLocatedEvents(EflWindow* window) { + DCHECK_NE(located_events_grabber_, window); + auto* old_grabber = located_events_grabber_; + located_events_grabber_ = window; + if (old_grabber) { + old_grabber->OnWindowLostCapture(); + } +} + +void EflWindowManager::UngrabLocatedEvents(EflWindow* window) { + DCHECK_EQ(located_events_grabber_, window); + auto* old_grabber = located_events_grabber_; + located_events_grabber_ = nullptr; + old_grabber->OnWindowLostCapture(); +} + +} // namespace ui diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.h b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.h index 7de95a1..39dff10 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.h +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.h @@ -2,55 +2,46 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_OZONE_PLATFORM_EFL_EFL_WINDOW_MANAGER_ -#define UI_OZONE_PLATFORM_EFL_EFL_WINDOW_MANAGER_ +#ifndef UI_OZONE_PLATFORM_EFL_EFL_WINDOW_MANAGER_H_ +#define UI_OZONE_PLATFORM_EFL_EFL_WINDOW_MANAGER_H_ + +#include #include "base/containers/flat_map.h" -#include "ui/ozone/platform/efl/efl_window.h" namespace ui { +class EflWindow; + class EflWindowManager { public: - EflWindowManager() {} - ~EflWindowManager() {} + EflWindowManager(); + ~EflWindowManager(); EflWindowManager(const EflWindowManager&) = delete; EflWindowManager& operator=(const EflWindowManager&) = delete; - void AddWindow(EflWindow* window, Evas_Object* eo) { - window_map_[eo] = window; - } - - EflWindow* GetWindow(Evas_Object* eo) const { - auto it = window_map_.find(eo); - return it == window_map_.end() ? nullptr : it->second; - } - - void RemoveWindow(Evas_Object* eo) { - auto* window = window_map_[eo]; - DCHECK(window); - window_map_.erase(eo); - } - - void UpdateWindowFocus(EflWindow* window, bool focused) { - for (const auto& item : window_map_) { - if (item.second != window) - item.second->SetFocus(false); - } - } - - std::vector GetAllOpenWindows() const { - std::vector all_windows; - for (const auto& item : window_map_) - all_windows.push_back(item.second); - return all_windows; - } + void AddWindow(EflWindow* window, Evas_Object* eo); + + EflWindow* GetWindow(Evas_Object* eo) const; + + void RemoveWindow(Evas_Object* eo); + + void UpdateWindowFocus(EflWindow* window, bool focused); + + std::vector GetAllOpenWindows() const; + + void GrabLocatedEvents(EflWindow* window); + + void UngrabLocatedEvents(EflWindow* window); + + EflWindow* located_events_grabber() const { return located_events_grabber_; } private: base::flat_map window_map_; + EflWindow* located_events_grabber_ = nullptr; }; } // namespace ui -#endif // UI_OZONE_PLATFORM_EFL_EFL_WINDOW_MANAGER_ +#endif // UI_OZONE_PLATFORM_EFL_EFL_WINDOW_MANAGER_H_ -- 2.7.4 From 42626db71ac6bd5cd42d6b21631a6210dd61e2b5 Mon Sep 17 00:00:00 2001 From: Nikhil Shingne Date: Mon, 29 Jan 2024 12:21:57 +0530 Subject: [PATCH 02/16] fixup! [M120] Bring up autofill This commit enables the autofill feature which was disabled during m120 bringup. Fixes all the build errors due to changes on upstream. With this commit, autofill related TCs PASS on NativeTCT. Change-Id: I64e291292d7b99572b69221b4e4d78d5d32a21b6 Signed-off-by: Nikhil Shingne --- .../renderer/password_form_conversion_utils.cc | 3 +- .../core/browser/browser_autofill_manager.cc | 2 +- .../core/browser/fake_password_store_backend.h | 4 ++ .../core/browser/mock_password_store_backend.h | 6 ++ .../core/browser/password_store.cc | 21 +++--- .../core/browser/password_store_backend.h | 2 +- tizen_src/build/config/tizen_features.gni | 7 -- .../browser/autofill/autofill_client_efl.cc | 69 +++++++++---------- .../browser/autofill/autofill_client_efl.h | 34 ++++----- .../autofill/personal_data_manager_factory.cc | 2 +- .../browser/autofill_popup_view_efl.cc | 13 ++-- .../password_manager_client_efl.cc | 80 +++++++++++++--------- .../password_manager/password_manager_client_efl.h | 38 +++++----- .../password_manager/password_store_factory.cc | 2 +- .../ewk/efl_integration/browser_context_efl.cc | 1 - .../ewk_context_form_autofill_profile_private.cc | 9 +-- .../renderer/content_renderer_client_efl.cc | 14 ++-- 17 files changed, 163 insertions(+), 144 deletions(-) diff --git a/components/autofill/content/renderer/password_form_conversion_utils.cc b/components/autofill/content/renderer/password_form_conversion_utils.cc index 0855f0d..ab1a605 100644 --- a/components/autofill/content/renderer/password_form_conversion_utils.cc +++ b/components/autofill/content/renderer/password_form_conversion_utils.cc @@ -126,8 +126,9 @@ bool IsGaiaWithSkipSavePasswordForm(const blink::WebFormElement& form) { // Returns the PasswordContents reflecting the contents of |fields|. bool HasPasswordContents(const std::vector& fields) { for (const FormFieldData& field : fields) { - if (field.form_control_type == "password") + if (field.form_control_type == FormControlType::kInputPassword) { return true; + } } return false; } diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc index a5aae65..0cf765e 100644 --- a/components/autofill/core/browser/browser_autofill_manager.cc +++ b/components/autofill/core/browser/browser_autofill_manager.cc @@ -927,7 +927,7 @@ void BrowserAutofillManager::OnFormSubmittedImpl(const FormData& form, *submitted_form, form, *client().GetPersonalDataManager()); #if defined(TIZEN_AUTOFILL) - if (!client()->GetFormDataImporter()) { + if (!client().GetFormDataImporter()) { LOG(ERROR) << "[Autofill] " << __FUNCTION__ << " FormDataImporter is invalid"; return; diff --git a/components/password_manager/core/browser/fake_password_store_backend.h b/components/password_manager/core/browser/fake_password_store_backend.h index 0220e86..c855711 100644 --- a/components/password_manager/core/browser/fake_password_store_backend.h +++ b/components/password_manager/core/browser/fake_password_store_backend.h @@ -54,6 +54,10 @@ class FakePasswordStoreBackend : public PasswordStoreBackend { const PasswordMap& stored_passwords() const { return stored_passwords_; } IsAccountStore is_account_store() const { return is_account_store_; } +#if defined(TIZEN_AUTOFILL_FW) + void PostTaskToBackgroundTaskRunner(base::OnceClosure task) override {}; +#endif + private: // Implements PasswordStoreBackend interface. void InitBackend(AffiliatedMatchHelper* affiliated_match_helper, diff --git a/components/password_manager/core/browser/mock_password_store_backend.h b/components/password_manager/core/browser/mock_password_store_backend.h index 04288d2..7ed90e3a 100644 --- a/components/password_manager/core/browser/mock_password_store_backend.h +++ b/components/password_manager/core/browser/mock_password_store_backend.h @@ -22,6 +22,12 @@ class MockPasswordStoreBackend : public PasswordStoreBackend { MockPasswordStoreBackend(); ~MockPasswordStoreBackend() override; +#if defined(TIZEN_AUTOFILL_FW) + MOCK_METHOD(void, + PostTaskToBackgroundTaskRunner, + (base::OnceClosure task), + (override)); +#endif MOCK_METHOD(void, InitBackend, (AffiliatedMatchHelper * affiliated_match_helper, diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc index cb37e57..1a1c27d 100644 --- a/components/password_manager/core/browser/password_store.cc +++ b/components/password_manager/core/browser/password_store.cc @@ -288,16 +288,20 @@ void PasswordStore::GetLogins(const PasswordFormDigest& form, if (!skip_checking_autofill) { if (backend_) { - backend_->PostTaskToBackgroundTaskRunner( - base::BindOnce(&PasswordStore::CheckAutofillData, this, form, view, - request_handler->LoginsForFormClosure())); + backend_->PostTaskToBackgroundTaskRunner(base::BindOnce( + &PasswordStore::CheckAutofillData, this, form, view, + base::BindOnce( + &PasswordStoreConsumer::OnGetPasswordStoreResultsOrErrorFrom, + consumer, base::RetainedRef(this)))); } } else { LOG(INFO) << "[Autofill] " << __FUNCTION__ << " with view " << view << " skip to check autofill"; - InjectAffiliationAndBrandingInformation( - request_handler->LoginsForFormClosure(), - std::vector>()); + affiliated_match_helper_->InjectAffiliationAndBrandingInformation( + LoginsResult(), + base::BindOnce( + &PasswordStoreConsumer::OnGetPasswordStoreResultsOrErrorFrom, + consumer, base::RetainedRef(this))); } #else backend_->GetGroupedMatchingLoginsAsync( @@ -320,9 +324,8 @@ void PasswordStore::CheckAutofillData(const PasswordFormDigest& form, done.Wait(); LOG(INFO) << "[Autofill] " << __FUNCTION__ << " with view " << view << " wait end!"; - InjectAffiliationAndBrandingInformation( - std::move(callback), - autofill::AutofillRequestManager::GetInstance()->GetResult(view)); + affiliated_match_helper_->InjectAffiliationAndBrandingInformation( + LoginsResult(), std::move(callback)); } #endif diff --git a/components/password_manager/core/browser/password_store_backend.h b/components/password_manager/core/browser/password_store_backend.h index d4885fc..0ca3670 100644 --- a/components/password_manager/core/browser/password_store_backend.h +++ b/components/password_manager/core/browser/password_store_backend.h @@ -155,7 +155,7 @@ class PasswordStoreBackend virtual void OnSyncServiceInitialized(syncer::SyncService* sync_service) = 0; #if defined(TIZEN_AUTOFILL_FW) - virtual void PostTaskToBackgroundTaskRunner(base::OnceClosure task); + virtual void PostTaskToBackgroundTaskRunner(base::OnceClosure task) = 0; #endif // Factory function for creating the backend. The Local backend requires the diff --git a/tizen_src/build/config/tizen_features.gni b/tizen_src/build/config/tizen_features.gni index eef8b8e..7fc0da6 100644 --- a/tizen_src/build/config/tizen_features.gni +++ b/tizen_src/build/config/tizen_features.gni @@ -126,10 +126,3 @@ if (use_ozone) { #use_glib = true external_ozone_platforms = [ "efl" ] } - -if (ewk_bringup) { # FIXME: m120 bringup - tizen_autofill = false - if (tizen_product_tv) { - tizen_autofill_fw = false - } -} diff --git a/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.cc b/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.cc index d8f70ca..9e06f6f 100644 --- a/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.cc @@ -163,8 +163,7 @@ void AutofillClientEfl::ShowUnmaskPrompt( } void AutofillClientEfl::UpdateAutofillPopupDataListValues( - const std::vector& values, - const std::vector& labels) { + base::span datalist) { NOTIMPLEMENTED(); } @@ -223,10 +222,6 @@ AutofillClientEfl::GetSecurityLevelForUmaHistograms() { return security_state::SecurityLevel::SECURITY_LEVEL_COUNT; } -void AutofillClientEfl::ExecuteCommand(int id) { - NOTIMPLEMENTED(); -} - void AutofillClientEfl::HideAutofillPopup(PopupHidingReason reason) { #if defined(TIZEN_AUTOFILL_FW) LOG(INFO) << "[Autofill] " << __FUNCTION__ @@ -244,12 +239,6 @@ bool AutofillClientEfl::IsAutocompleteEnabled() const { return false; } -void AutofillClientEfl::PropagateAutofillPredictions( - autofill::AutofillDriver* autofill_driver, - const std::vector& forms) { - NOTIMPLEMENTED(); -} - bool AutofillClientEfl::IsAutocompleteSavingEnabled() { if (webview_) return webview_->GetSettings()->formCandidateData(); @@ -340,15 +329,36 @@ AutofillClientEfl::GetURLLoaderFactory() { ->GetURLLoaderFactoryForBrowserProcess(); } -void AutofillClientEfl::ConfirmSaveIBANLocally( - const IBAN& iban, +void AutofillClientEfl::ConfirmSaveIbanLocally( + const Iban& iban, + bool should_show_prompt, + AutofillClient::SaveIbanPromptCallback callback) { + NOTIMPLEMENTED(); +} + +void AutofillClientEfl::ConfirmUploadIbanToCloud( + const Iban& iban, + const LegalMessageLines& legal_message_lines, bool should_show_prompt, - LocalSaveIBANPromptCallback callback) { + AutofillClient::SaveIbanPromptCallback callback) { + NOTIMPLEMENTED(); +} + +void AutofillClientEfl::ShowEditAddressProfileDialog( + const AutofillProfile& profile, + AutofillClient::AddressProfileSavePromptCallback + on_user_decision_callback) { + NOTIMPLEMENTED(); +} + +void AutofillClientEfl::ShowDeleteAddressProfileDialog( + const AutofillProfile& profile, + AutofillClient::AddressProfileDeleteDialogCallback delete_dialog_callback) { NOTIMPLEMENTED(); } void AutofillClientEfl::DidFillOrPreviewForm( - mojom::RendererFormDataAction action, + mojom::ActionPersistence action, AutofillTriggerSource trigger_source, bool is_refill) { NOTIMPLEMENTED(); @@ -436,12 +446,6 @@ bool AutofillClientEfl::CloseWebauthnDialog() { return false; } -void AutofillClientEfl::ConfirmSaveUpiIdLocally( - const std::string& upi_id, - base::OnceCallback callback) { - NOTIMPLEMENTED(); -} - void AutofillClientEfl::OfferVirtualCardOptions( const std::vector& candidates, base::OnceCallback callback) { @@ -456,7 +460,8 @@ void AutofillClientEfl::PinPopupView() { NOTIMPLEMENTED(); } -AutofillClient::PopupOpenArgs AutofillClientEfl::GetReopenPopupArgs() const { +AutofillClient::PopupOpenArgs AutofillClientEfl::GetReopenPopupArgs( + AutofillSuggestionTriggerSource trigger_source) const { NOTIMPLEMENTED(); return {}; } @@ -466,8 +471,10 @@ std::vector AutofillClientEfl::GetPopupSuggestions() const { return std::vector(); } -void AutofillClientEfl::UpdatePopup(const std::vector& suggestions, - PopupType popup_type) { +void AutofillClientEfl::UpdatePopup( + const std::vector& suggestions, + PopupType popup_type, + AutofillSuggestionTriggerSource trigger_source) { NOTIMPLEMENTED(); } @@ -481,18 +488,6 @@ const GURL& AutofillClientEfl::GetLastCommittedPrimaryMainFrameURL() const { return entry->GetURL(); } -std::vector -AutofillClientEfl::GetAllowedMerchantsForVirtualCards() { - NOTIMPLEMENTED(); - return std::vector(); -} - -std::vector -AutofillClientEfl::GetAllowedBinRangesForVirtualCards() { - NOTIMPLEMENTED(); - return std::vector(); -} - const translate::LanguageState* AutofillClientEfl::GetLanguageState() { NOTIMPLEMENTED(); return nullptr; diff --git a/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.h b/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.h index f143729..24d9ccc 100644 --- a/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.h +++ b/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.h @@ -39,12 +39,22 @@ class AutofillClientEfl : public ContentAutofillClient, bool IsOffTheRecord() override; scoped_refptr GetURLLoaderFactory() override; - void DidFillOrPreviewForm(mojom::RendererFormDataAction action, + void DidFillOrPreviewForm(mojom::ActionPersistence action, AutofillTriggerSource trigger_source, bool is_refill) override; - void ConfirmSaveIBANLocally(const IBAN& iban, + void ConfirmSaveIbanLocally(const Iban& iban, bool should_show_prompt, - LocalSaveIBANPromptCallback callback) override; + SaveIbanPromptCallback callback) override; + void ConfirmUploadIbanToCloud(const Iban& iban, + const LegalMessageLines& legal_message_lines, + bool should_show_prompt, + SaveIbanPromptCallback callback) override; + void ShowEditAddressProfileDialog( + const AutofillProfile& profile, + AddressProfileSavePromptCallback on_user_decision_callback) override; + void ShowDeleteAddressProfileDialog( + const AutofillProfile& profile, + AddressProfileDeleteDialogCallback delete_dialog_callback) override; FormInteractionsFlowId GetCurrentFormInteractionsFlowId() override; // AutofillClient implementation. @@ -72,8 +82,7 @@ class AutofillClientEfl : public ContentAutofillClient, const CardUnmaskPromptOptions& card_unmask_prompt_options, base::WeakPtr delegate) override; void UpdateAutofillPopupDataListValues( - const std::vector& values, - const std::vector& labels) override; + base::span datalist) override; void OnUnmaskVerificationResult(PaymentsRpcResult result) override; bool HasCreditCardScanFeature() override; void ScanCreditCard(CreditCardScanCallback callback) override; @@ -85,12 +94,8 @@ class AutofillClientEfl : public ContentAutofillClient, AddressNormalizer* GetAddressNormalizer() override; security_state::SecurityLevel GetSecurityLevelForUmaHistograms() override; - void ExecuteCommand(int id) override; void HideAutofillPopup(PopupHidingReason reason) override; bool IsAutocompleteEnabled() const override; - void PropagateAutofillPredictions( - autofill::AutofillDriver* autofill_driver, - const std::vector& forms) override; void DidFillOrPreviewField(const std::u16string& autofilled_value, const std::u16string& profile_full_name) override; void ConfirmMigrateLocalCardToCloud( @@ -104,23 +109,20 @@ class AutofillClientEfl : public ContentAutofillClient, WebauthnDialogCallback verify_pending_dialog_callback) override; void UpdateWebauthnOfferDialogWithError() override; bool CloseWebauthnDialog() override; - void ConfirmSaveUpiIdLocally( - const std::string& upi_id, - base::OnceCallback callback) override; void OfferVirtualCardOptions( const std::vector& candidates, base::OnceCallback callback) override; void CreditCardUploadCompleted(bool card_saved) override; void PinPopupView() override; - PopupOpenArgs GetReopenPopupArgs() const override; + PopupOpenArgs GetReopenPopupArgs( + AutofillSuggestionTriggerSource trigger_source) const override; std::vector GetPopupSuggestions() const override; void UpdatePopup(const std::vector& suggestions, - PopupType popup_type) override; + PopupType popup_type, + AutofillSuggestionTriggerSource trigger_sources) override; const GURL& GetLastCommittedPrimaryMainFrameURL() const override; const translate::LanguageState* GetLanguageState() override; translate::TranslateDriver* GetTranslateDriver() override; - std::vector GetAllowedMerchantsForVirtualCards() override; - std::vector GetAllowedBinRangesForVirtualCards() override; void ConfirmSaveAddressProfile( const AutofillProfile& profile, const AutofillProfile* original_profile, diff --git a/tizen_src/ewk/efl_integration/browser/autofill/personal_data_manager_factory.cc b/tizen_src/ewk/efl_integration/browser/autofill/personal_data_manager_factory.cc index 3ab66e2..474a431 100644 --- a/tizen_src/ewk/efl_integration/browser/autofill/personal_data_manager_factory.cc +++ b/tizen_src/ewk/efl_integration/browser/autofill/personal_data_manager_factory.cc @@ -57,7 +57,7 @@ PersonalDataManagerFactoryEfl::PersonalDataManagerForContext( manager->Init(WebDataServiceFactoryEfl::GetAutofillWebDataForProfile(), nullptr, service, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, context->IsOffTheRecord()); + nullptr); manager->AddObserver(this); personal_data_manager_id_map_.AddWithID(std::move(pdm), unique_id); diff --git a/tizen_src/ewk/efl_integration/browser/autofill_popup_view_efl.cc b/tizen_src/ewk/efl_integration/browser/autofill_popup_view_efl.cc index b8d7fc2..0fc3795 100644 --- a/tizen_src/ewk/efl_integration/browser/autofill_popup_view_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/autofill_popup_view_efl.cc @@ -238,9 +238,8 @@ void AutofillPopupViewEfl::UpdateLocation(const gfx::RectF& bounds) { } bool isAutofillSpecial(const autofill::Suggestion& suggestion) { - return suggestion.frontend_id <= 0 && - suggestion.frontend_id != POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY && - suggestion.frontend_id != POPUP_ITEM_ID_DATALIST_ENTRY; + return suggestion.popup_item_id != PopupItemId::kAutocompleteEntry && + suggestion.popup_item_id != PopupItemId::kDatalistEntry; } void AutofillPopupViewEfl::InitFormData( @@ -269,7 +268,8 @@ void AutofillPopupViewEfl::InitFormData( void AutofillPopupViewEfl::AcceptSuggestion(size_t index) { if (delegate_ && index < values_.size()) { - delegate_->DidAcceptSuggestion(values_[index], index); + delegate_->DidAcceptSuggestion(values_[index], index, + autofill::AutofillSuggestionTriggerSource()); } } @@ -303,9 +303,8 @@ void AutofillPopupViewEfl::SetSelectedLine(size_t selected_line) selected_line_ = selected_line; if (delegate_) { if (selected_line_ < values_.size()) { - delegate_->DidSelectSuggestion(values_[selected_line].main_text.value, - selected_line, - autofill::Suggestion::BackendId()); + delegate_->DidSelectSuggestion( + values_[selected_line], autofill::AutofillSuggestionTriggerSource()); } else { delegate_->ClearPreviewedForm(); diff --git a/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.cc b/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.cc index 3b0b188..dbf1f06 100644 --- a/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.cc @@ -65,8 +65,7 @@ PasswordManagerClientEfl::PasswordManagerClientEfl( nullptr /*ProfileSyncServiceFactory::GetForProfile(profile_)*/), driver_factory_(nullptr), weak_factory_(this) { - ContentPasswordManagerDriverFactory::CreateForWebContents(web_contents, this, - autofill_client); + ContentPasswordManagerDriverFactory::CreateForWebContents(web_contents, this); driver_factory_ = ContentPasswordManagerDriverFactory::FromWebContents(web_contents); } @@ -110,8 +109,34 @@ void PasswordManagerClientEfl::ShowManualFallbackForSaving( NOTIMPLEMENTED(); } -PasswordStore* PasswordManagerClientEfl::GetProfilePasswordStore() const { - return PasswordStoreFactory::GetProfilePasswordStore().get(); +void PasswordManagerClientEfl::UserModifiedPasswordField() { + NOTIMPLEMENTED(); +} + +void PasswordManagerClientEfl::UserModifiedNonPasswordField( + ::autofill::FieldRendererId renderer_id, + const ::std::u16string& value, + bool autocomplete_attribute_has_username, + bool is_likely_otp) { + NOTIMPLEMENTED(); +} + +void PasswordManagerClientEfl::ShowPasswordSuggestions( + ::autofill::FieldRendererId element_id, + const ::autofill::FormData& form, + uint64_t username_field_index, + uint64_t password_field_index, + ::base::i18n::TextDirection text_direction, + const ::std::u16string& typed_username, + int32_t options, + const ::gfx::RectF& bounds) { + NOTIMPLEMENTED(); +} + +PasswordStoreInterface* PasswordManagerClientEfl::GetProfilePasswordStore() + const { + NOTIMPLEMENTED(); + return nullptr; } const PasswordManager* PasswordManagerClientEfl::GetPasswordManager() const { @@ -149,7 +174,8 @@ void PasswordManagerClientEfl::NotifyStorePasswordCalled() { } void PasswordManagerClientEfl::AutomaticPasswordSave( - std::unique_ptr saved_form_manager) { + std::unique_ptr saved_form_manager, + bool is_update_confirmation) { NOTIMPLEMENTED(); } @@ -216,20 +242,6 @@ void PasswordManagerClientEfl::PasswordFormsRendered( GetPasswordManager()->OnPasswordFormsRendered(driver, visible_forms); } -void PasswordManagerClientEfl::ShowPasswordSuggestions( - base::i18n::TextDirection text_direction, - const std::u16string& typed_username, - int options, - const gfx::RectF& bounds) { - password_manager::PasswordManagerDriver* driver = - driver_factory_->GetDriverForFrame( - password_manager_driver_bindings_.GetCurrentTargetFrame()); - driver->GetPasswordAutofillManager()->OnShowPasswordSuggestions( - text_direction, typed_username, options, - TransformToRootCoordinates( - password_manager_driver_bindings_.GetCurrentTargetFrame(), bounds)); -} - void PasswordManagerClientEfl::PasswordFormSubmitted( const autofill::FormData& password_form) { if (!bad_message::CheckChildProcessSecurityPolicyForURL( @@ -253,10 +265,6 @@ void PasswordManagerClientEfl::RecordSavePasswordProgress( LOG_AF(GetLogManager()) << log; } -void PasswordManagerClientEfl::UserModifiedPasswordField() { - GetMetricsRecorder()->RecordUserModifiedPasswordField(); -} - void PasswordManagerClientEfl::FocusedInputChanged( password_manager::PasswordManagerDriver* driver, autofill::FieldRendererId focused_field_id, @@ -284,7 +292,8 @@ void PasswordManagerClientEfl::PromptUserToMovePasswordToAccount( NOTIMPLEMENTED(); } -PasswordStore* PasswordManagerClientEfl::GetAccountPasswordStore() const { +PasswordStoreInterface* PasswordManagerClientEfl::GetAccountPasswordStore() + const { NOTIMPLEMENTED(); return nullptr; } @@ -344,13 +353,6 @@ void PasswordManagerClientEfl::PasswordFormCleared( const autofill::FormData& form_data) { NOTIMPLEMENTED(); } -void PasswordManagerClientEfl::UserModifiedNonPasswordField( - autofill::FieldRendererId renderer_id, - const std::u16string& field_name, - const std::u16string& value, - bool autocomplete_attribute_has_username) { - NOTIMPLEMENTED(); -} void PasswordManagerClientEfl::FocusedInputChanged( autofill::FieldRendererId focused_field_id, @@ -364,6 +366,22 @@ void PasswordManagerClientEfl::CheckSafeBrowsingReputation( NOTIMPLEMENTED(); } +PrefService* PasswordManagerClientEfl::GetLocalStatePrefs() const { + NOTIMPLEMENTED(); + return nullptr; +} + +const syncer::SyncService* PasswordManagerClientEfl::GetSyncService() const { + NOTIMPLEMENTED(); + return nullptr; +} + +PasswordChangeSuccessTracker* +PasswordManagerClientEfl::GetPasswordChangeSuccessTracker() { + NOTIMPLEMENTED(); + return nullptr; +} + WEB_CONTENTS_USER_DATA_KEY_IMPL(PasswordManagerClientEfl); } diff --git a/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.h b/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.h index c1c68ff..a885b17 100644 --- a/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.h +++ b/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.h @@ -61,7 +61,20 @@ class PasswordManagerClientEfl std::unique_ptr form_to_save, bool has_generated_password, bool is_update) override; - PasswordStore* GetProfilePasswordStore() const override; + PasswordStoreInterface* GetProfilePasswordStore() const override; + void UserModifiedPasswordField() override; + void UserModifiedNonPasswordField(::autofill::FieldRendererId renderer_id, + const ::std::u16string& value, + bool autocomplete_attribute_has_username, + bool is_likely_otp) override; + void ShowPasswordSuggestions(::autofill::FieldRendererId element_id, + const ::autofill::FormData& form, + uint64_t username_field_index, + uint64_t password_field_index, + ::base::i18n::TextDirection text_direction, + const ::std::u16string& typed_username, + int32_t options, + const ::gfx::RectF& bounds) override; bool PromptUserToChooseCredentials( std::vector> local_forms, const url::Origin& origin, @@ -76,7 +89,8 @@ class PasswordManagerClientEfl submitted_manager) override; void NotifyStorePasswordCalled() override; void AutomaticPasswordSave( - std::unique_ptr saved_form_manager) override; + std::unique_ptr saved_form_manager, + bool is_update_confirmation) override; const PasswordManager* GetPasswordManager() const override; const CredentialsFilter* GetStoreResultFilter() const override; @@ -100,7 +114,7 @@ class PasswordManagerClientEfl bool IsNewTabPage() const override; void PromptUserToMovePasswordToAccount( std::unique_ptr form_to_move) override; - PasswordStore* GetAccountPasswordStore() const override; + PasswordStoreInterface* GetAccountPasswordStore() const override; const GURL& GetLastCommittedURL() const override; url::Origin GetLastCommittedOrigin() const override; signin::IdentityManager* GetIdentityManager() override; @@ -119,11 +133,9 @@ class PasswordManagerClientEfl const override { return &password_feature_manager_; } - PrefService* GetLocalStatePrefs() const override { return nullptr; } - const syncer::SyncService* GetSyncService() const override { return nullptr; } - PasswordChangeSuccessTracker* GetPasswordChangeSuccessTracker() override { - return nullptr; - } + PrefService* GetLocalStatePrefs() const override; + const syncer::SyncService* GetSyncService() const override; + PasswordChangeSuccessTracker* GetPasswordChangeSuccessTracker() override; private: explicit PasswordManagerClientEfl(content::WebContents* web_contents, @@ -144,22 +156,12 @@ class PasswordManagerClientEfl const std::vector& visible_forms) override; void PasswordFormSubmitted(const autofill::FormData& password_form) override; void RecordSavePasswordProgress(const std::string& log) override; - void UserModifiedPasswordField() override; - void ShowPasswordSuggestions(base::i18n::TextDirection text_direction, - const std::u16string& typed_username, - int options, - const gfx::RectF& bounds) override; void LogFirstFillingResult(autofill::FormRendererId form_renderer_id, int32_t result) override; void InformAboutUserInput(const autofill::FormData& form_data) override; void DynamicFormSubmission(autofill::mojom::SubmissionIndicatorEvent submission_indication_event) override; void PasswordFormCleared(const autofill::FormData& form_data) override; - void UserModifiedNonPasswordField( - autofill::FieldRendererId renderer_id, - const std::u16string& field_name, - const std::u16string& value, - bool autocomplete_attribute_has_username) override; void FocusedInputChanged( autofill::FieldRendererId focused_field_id, autofill::mojom::FocusedFieldType focused_field_type) override; diff --git a/tizen_src/ewk/efl_integration/browser/password_manager/password_store_factory.cc b/tizen_src/ewk/efl_integration/browser/password_manager/password_store_factory.cc index 1633dcc..123e6c4 100644 --- a/tizen_src/ewk/efl_integration/browser/password_manager/password_store_factory.cc +++ b/tizen_src/ewk/efl_integration/browser/password_manager/password_store_factory.cc @@ -67,7 +67,7 @@ void PasswordStoreFactory::Init() { scoped_refptr ps = new password_manager::PasswordStore( std::make_unique( - std::move(login_db))); + std::move(login_db), syncer::WipeModelUponSyncDisabledBehavior())); if (!ps.get()) { LOG(ERROR) << "Could not create password manager."; diff --git a/tizen_src/ewk/efl_integration/browser_context_efl.cc b/tizen_src/ewk/efl_integration/browser_context_efl.cc index 04a8ae9..c58550c 100644 --- a/tizen_src/ewk/efl_integration/browser_context_efl.cc +++ b/tizen_src/ewk/efl_integration/browser_context_efl.cc @@ -205,7 +205,6 @@ BrowserContextEfl::BrowserContextEfl(EWebContext* web_context, bool incognito) #if defined(TIZEN_AUTOFILL) // autofill preferences pref_registry->RegisterBooleanPref(kAutofillProfileEnabled, true); - pref_registry->RegisterBooleanPref(kAutofillWalletImportEnabled, true); pref_registry->RegisterBooleanPref(kAutofillCreditCardEnabled, true); pref_registry->RegisterIntegerPref(kAutocompleteLastVersionRetentionPolicy, 0); diff --git a/tizen_src/ewk/efl_integration/private/ewk_context_form_autofill_profile_private.cc b/tizen_src/ewk/efl_integration/private/ewk_context_form_autofill_profile_private.cc index b13bddb..1fb706b 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_context_form_autofill_profile_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_context_form_autofill_profile_private.cc @@ -10,8 +10,6 @@ #include #include #include - -#include "base/guid.h" #include "base/strings/stringprintf.h" #include "browser/autofill/personal_data_manager_factory.h" #include "browser_context_efl.h" @@ -46,9 +44,9 @@ std::string UnsignedToGUID(unsigned id) { } bool IsValidEwkGUID(const std::string& guid) { - if (!base::IsValidGUID(guid)) + if (!base::Uuid::ParseCaseInsensitive(base::StringPiece(guid)).is_valid()) { return false; - + } if (guid.compare(0, kEwkGuidStartString.length(), kEwkGuidStartString)) return false; @@ -95,8 +93,7 @@ void to_Autofill_Profile_set_data(const Ewk_Autofill_Profile* oldStyleProfile, autofill::AutofillProfile to_Autofill_Profile( const Ewk_Autofill_Profile* oldStyleProfile) { std::string locale = EWebView::GetPlatformLocale(); - autofill::AutofillProfile ret(base::GenerateGUID(), locale); - + autofill::AutofillProfile ret(locale); if (!oldStyleProfile) return ret; diff --git a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc index 6d61f7d..ccd86d7 100644 --- a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc @@ -190,13 +190,13 @@ void ContentRendererClientEfl::RenderFrameCreated(content::RenderFrame* render_f blink::AssociatedInterfaceRegistry* registry = render_frame_observer->associated_interfaces(); - PasswordAutofillAgent* password_autofill_agent = - new PasswordAutofillAgent(render_frame, registry); - PasswordGenerationAgent* password_generation_agent = - new PasswordGenerationAgent(render_frame, password_autofill_agent, - registry); - new AutofillAgent(render_frame, password_autofill_agent, - password_generation_agent, registry); + std::unique_ptr password_autofill_agent = + std::make_unique(render_frame, registry); + std::unique_ptr password_generation_agent = + std::make_unique( + render_frame, password_autofill_agent.get(), registry); + new AutofillAgent(render_frame, std::move(password_autofill_agent), + std::move(password_generation_agent), registry); } #endif #if (defined(TIZEN_PEPPER_EXTENSIONS) && BUILDFLAG(ENABLE_PLUGINS)) -- 2.7.4 From 861279461934744c499dd76728a2c36e097337b5 Mon Sep 17 00:00:00 2001 From: "venu.musham" Date: Mon, 26 Feb 2024 10:18:26 +0530 Subject: [PATCH 03/16] fixup! [M120 Migration] Apply opacity/filter/border-radius for video hole. when video hole is disabled, build issue is observed. Build fixes for standard profile & desktop. Change-Id: I30866ed130d2463466997c32615c77ac9d4a425c Signed-off-by: venu.musham --- cc/trees/draw_property_utils.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc index 2e442ac..f55ffb1 100644 --- a/cc/trees/draw_property_utils.cc +++ b/cc/trees/draw_property_utils.cc @@ -850,9 +850,9 @@ void UpdateRenderTarget(EffectTree* effect_tree) { && effect_tree->parent(node)->render_surface_reason != RenderSurfaceReason::kOpacity && effect_tree->parent(node)->render_surface_reason != - RenderSurfaceReason::kFilter) + RenderSurfaceReason::kFilter #endif - { + ) { node->target_id = node->parent_id; } else { node->target_id = effect_tree->parent(node)->target_id; -- 2.7.4 From 5067b781f85f8186f99609c9437d8c5a76393985 Mon Sep 17 00:00:00 2001 From: Rohit Kumar Date: Wed, 21 Feb 2024 14:40:38 +0530 Subject: [PATCH 04/16] [M120 Migration]Fix for crash during chrome exit As g_bluez_dbus_manager is nullptr in BluezDBusManager::Shutdown() a crash is observed during chrome exit. By enabling BluezDBusManager::Initialize(), g_bluez_dbus_manager value is set to a valid value. Reference: https://review.tizen.org/gerrit/303262 Change-Id: Ia496ca7a06fcf33b7a34a4660f7c8303e4a15e5b Signed-off-by: Rohit Kumar --- chrome/browser/chrome_browser_main_linux.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc index 0d3bc8c..2e65a9f 100644 --- a/chrome/browser/chrome_browser_main_linux.cc +++ b/chrome/browser/chrome_browser_main_linux.cc @@ -66,9 +66,9 @@ void ChromeBrowserMainPartsLinux::PostCreateMainMessageLoop() { // initialization depend on FeatureList, and is done elsewhere. #endif // BUILDFLAG(IS_CHROMEOS) -#if !BUILDFLAG(IS_CHROMEOS) bluez::BluezDBusManager::Initialize(nullptr /* system_bus */); +#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_TIZEN) // Set up crypt config. This needs to be done before anything starts the // network service, as the raw encryption key needs to be shared with the // network service for encrypted cookie storage. -- 2.7.4 From 2fb1e438b193f3ff0a66476bd370e2dab194c24f Mon Sep 17 00:00:00 2001 From: Mateusz Bieganski Date: Wed, 29 Nov 2023 14:54:28 +0100 Subject: [PATCH 05/16] uBrowser: Add '-i' switch, to execute WebInspector server on startup. The rationale is to automate performance or correctness tests, with host-side client connecting to WebInspector server and investigating HTML that was rendered. Change-Id: Ib88942b71210f444e44dc257c7dae4df9eaedad1 Signed-off-by: Mateusz Bieganski --- tizen_src/ewk/ubrowser/main.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tizen_src/ewk/ubrowser/main.cc b/tizen_src/ewk/ubrowser/main.cc index 57bf57f..f26eb3c 100644 --- a/tizen_src/ewk/ubrowser/main.cc +++ b/tizen_src/ewk/ubrowser/main.cc @@ -56,6 +56,7 @@ struct AppData { std::vector urls; Browser* browser; + bool browser_autostart_webinspector; bool ewk_initialized; }; @@ -76,6 +77,7 @@ void show_help_and_exit(const char* app_name) { printf(" 2 - minimal GUI\n"); printf(" 3 - full GUI\n"); printf(" -z, --zoom Set zoom factor using double number\n"); + printf(" -i, --inspector Start browser with WebInspector server, running on port 7777.\n"); printf(" -h, --help Show this help message\n"); printf(" -t, --tizen Run WebView with compliance to Tizen version,\n"); printf(" for example, -t 2.4 or -t 2.3.1 etc.\n"); @@ -124,6 +126,7 @@ void parse_options(int argc, char** argv, AppData* data) { {"zoom", required_argument, 0, 'z'}, {"help", no_argument, &show_help, 1}, {"tizen-version", required_argument, 0, 't'}, + {"inspector", no_argument, 0, 'i'}, #if defined(TIZEN_VIDEO_HOLE) {"overlay", no_argument, &video_hw_overlay, 1}, #endif @@ -134,9 +137,9 @@ void parse_options(int argc, char** argv, AppData* data) { int option_index = 0; #if defined(TIZEN_VIDEO_HOLE) - c = getopt_long(argc, argv, "vndmhou:l:z:t:", long_options, &option_index); + c = getopt_long(argc, argv, "ivndmhou:l:z:t:", long_options, &option_index); #else - c = getopt_long(argc, argv, "vndmhu:l:z:t:", long_options, &option_index); + c = getopt_long(argc, argv, "ivndmhu:l:z:t:", long_options, &option_index); #endif if (c == -1) @@ -172,6 +175,9 @@ void parse_options(int argc, char** argv, AppData* data) { case 't': tizen_version = optarg; break; + case 'i': + data->browser_autostart_webinspector = true; + break; #if defined(TIZEN_VIDEO_HOLE) case 'o': video_hw_overlay = 1; @@ -219,6 +225,8 @@ static bool app_create(void* data) { new Browser(desktop_mode, gui_level, user_agent, tizen_version); if (zoom_factor > 0) app_data->browser->SetDefaultZoomFactor(zoom_factor); + if (app_data->browser_autostart_webinspector) + app_data->browser->StartInspectorServer(); #if defined(TIZEN_VIDEO_HOLE) if (video_hw_overlay) -- 2.7.4 From a4ce82208f38cc5b414543ac17c88fc376454fb2 Mon Sep 17 00:00:00 2001 From: v-saha Date: Thu, 22 Feb 2024 09:51:21 +0530 Subject: [PATCH 06/16] Remove EWK_BRINGUPS for M120 #1 This commit removes some EWK_BRINGUPs added during M120 upversion. Upgrading to Clang18 fixed some of the build errors. Change-Id: Id71747db710ebe7002829db7ae52c28989db883e Signed-off-by: v-saha --- components/attribution_reporting/trigger_registration.cc | 8 -------- components/autofill/core/browser/contact_info_sync_util.cc | 2 -- components/autofill/core/browser/webdata/autofill_table.cc | 7 ------- components/password_manager/core/browser/password_manager.cc | 2 -- content/browser/download/save_package.cc | 6 ------ .../browser/interest_group/header_direct_from_seller_signals.h | 8 -------- content/browser/interest_group/interest_group_storage.cc | 7 ------- content/browser/renderer_host/render_frame_host_impl.cc | 8 -------- media/capture/video/linux/v4l2_capture_delegate.cc | 6 +++--- media/capture/video/linux/v4l2_capture_delegate.h | 2 +- .../build/scripts/core/style/templates/computed_style_base.h.tmpl | 4 ---- .../blink/renderer/platform/fonts/palette_interpolation.cc | 2 -- 12 files changed, 4 insertions(+), 58 deletions(-) diff --git a/components/attribution_reporting/trigger_registration.cc b/components/attribution_reporting/trigger_registration.cc index 35e0234..4f0f0b5 100644 --- a/components/attribution_reporting/trigger_registration.cc +++ b/components/attribution_reporting/trigger_registration.cc @@ -109,16 +109,8 @@ base::expected, TriggerRegistrationError> ParseList( vec.reserve(list->size()); for (auto& value : *list) { -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup ASSIGN_OR_RETURN(T element, build_element(value)); vec.push_back(std::move(element)); -#else - base::expected element = build_element(value); - if (!element.has_value()) { - return base::unexpected(element.error()); - } - vec.push_back(std::move(*element)); -#endif } return vec; diff --git a/components/autofill/core/browser/contact_info_sync_util.cc b/components/autofill/core/browser/contact_info_sync_util.cc index 63ff178..b5b0a0b 100644 --- a/components/autofill/core/browser/contact_info_sync_util.cc +++ b/components/autofill/core/browser/contact_info_sync_util.cc @@ -195,11 +195,9 @@ class ContactInfoProfileSetter { CHECK(observations.empty()); for (const sync_pb::ContactInfoSpecifics::Observation& proto_observation : metadata.observations()) { -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup observations.emplace_back(proto_observation.type(), ProfileTokenQuality::FormSignatureHash( proto_observation.form_hash())); -#endif } } } diff --git a/components/autofill/core/browser/webdata/autofill_table.cc b/components/autofill/core/browser/webdata/autofill_table.cc index 3b82c27..51b71b7 100644 --- a/components/autofill/core/browser/webdata/autofill_table.cc +++ b/components/autofill/core/browser/webdata/autofill_table.cc @@ -1763,17 +1763,10 @@ std::unique_ptr AutofillTable::GetAutofillProfile( } base::span observations_data = s.ColumnBlob(3); -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup field_type_values.emplace_back( type, s.ColumnString16(1), s.ColumnInt(2), std::vector(observations_data.begin(), observations_data.end())); -#else - field_type_values.emplace_back( - FieldTypeData{type, s.ColumnString16(1), s.ColumnInt(2), - std::vector(observations_data.begin(), - observations_data.end())}); -#endif if (type == ADDRESS_HOME_COUNTRY) { country_code = base::UTF16ToUTF8(s.ColumnString16(1)); } diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index 0cbdc3d..4f73e24 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc @@ -639,13 +639,11 @@ void PasswordManager::OnUserModifiedNonPasswordField( bool is_likely_otp) { // |driver| might be empty on iOS or in tests. int driver_id = driver ? driver->GetId() : 0; -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup possible_usernames_.Put( PossibleUsernameFieldIdentifier(driver_id, renderer_id), PossibleUsernameData(GetSignonRealm(driver->GetLastCommittedURL()), renderer_id, value, base::Time::Now(), driver_id, autocomplete_attribute_has_username, is_likely_otp)); -#endif if (base::FeatureList::IsEnabled( password_manager::features::kForgotPasswordFormSupport)) { FieldInfoManager* field_info_manager = client_->GetFieldInfoManager(); diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc index b22c500..5bd4ca1 100644 --- a/content/browser/download/save_package.cc +++ b/content/browser/download/save_package.cc @@ -767,14 +767,8 @@ void SavePackage::Finish() { if (download_) { std::vector files; for (auto& item : saved_success_items_) { -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup files.emplace_back(item.second->full_path(), item.second->url(), item.second->referrer().url); -#else - files.emplace_back(download::DownloadSaveItemData::ItemInfo( - item.second->full_path(), item.second->url(), - item.second->referrer().url)); -#endif } download::DownloadSaveItemData::AttachItemData(download_, std::move(files)); } diff --git a/content/browser/interest_group/header_direct_from_seller_signals.h b/content/browser/interest_group/header_direct_from_seller_signals.h index d7d3035..59c695ee 100644 --- a/content/browser/interest_group/header_direct_from_seller_signals.h +++ b/content/browser/interest_group/header_direct_from_seller_signals.h @@ -97,19 +97,11 @@ class CONTENT_EXPORT HeaderDirectFromSellerSignals { } private: -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup const absl::optional seller_signals_; const absl::optional auction_signals_; const base::flat_map per_buyer_signals_; -#else - absl::optional seller_signals_; - - absl::optional auction_signals_; - - base::flat_map per_buyer_signals_; -#endif }; } // namespace content diff --git a/content/browser/interest_group/interest_group_storage.cc b/content/browser/interest_group/interest_group_storage.cc index a01ace3..22a183f 100644 --- a/content/browser/interest_group/interest_group_storage.cc +++ b/content/browser/interest_group/interest_group_storage.cc @@ -3002,17 +3002,10 @@ DoGetKAnonymityData(sql::Database& db, std::vector k_anon_data; while (interest_group_kanon_query.Step()) { -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup k_anon_data.emplace_back( /*key=*/interest_group_kanon_query.ColumnString(0), /*is_k_anonymous=*/interest_group_kanon_query.ColumnBool(1), /*last_updated=*/interest_group_kanon_query.ColumnTime(2)); -#else - k_anon_data.emplace_back(StorageInterestGroup::KAnonymityData( - interest_group_kanon_query.ColumnString(0), - interest_group_kanon_query.ColumnBool(1), - interest_group_kanon_query.ColumnTime(2))); -#endif } if (!interest_group_kanon_query.Succeeded()) { return absl::nullopt; diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index 6fd2953..adba336 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc @@ -8696,11 +8696,9 @@ void RenderFrameHostImpl::SendFencedFrameReportingBeacon( for (const blink::FencedFrame::ReportingDestination& destination : destinations) { -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup SendFencedFrameReportingBeaconInternal( DestinationEnumEvent(event_type, event_data), destination, /*from_renderer=*/true, attribution_reporting_runtime_features); -#endif } } @@ -8733,12 +8731,10 @@ void RenderFrameHostImpl::SendFencedFrameReportingBeaconToCustomURL( return; } -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup SendFencedFrameReportingBeaconInternal( DestinationURLEvent(destination_url), blink::FencedFrame::ReportingDestination::kBuyer, /*from_renderer=*/true, attribution_reporting_runtime_features); -#endif } void RenderFrameHostImpl::MaybeSendFencedFrameAutomaticReportingBeacon( @@ -8834,14 +8830,12 @@ void RenderFrameHostImpl::MaybeSendFencedFrameAutomaticReportingBeacon( destination) != info->destinations.end()) { data = info->data; } -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup initiator_rfh->SendFencedFrameReportingBeaconInternal( DestinationEnumEvent(blink::kFencedFrameTopNavigationBeaconType, data), destination, /*from_renderer=*/false, attribution_reporting_features, navigation_request.GetNavigationId()); -#endif } } else { if (!info->destinations.empty()) { @@ -8850,14 +8844,12 @@ void RenderFrameHostImpl::MaybeSendFencedFrameAutomaticReportingBeacon( for (blink::FencedFrame::ReportingDestination destination : info->destinations) { -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup initiator_rfh->SendFencedFrameReportingBeaconInternal( DestinationEnumEvent(blink::kFencedFrameTopNavigationBeaconType, info->data), destination, /*from_renderer=*/false, info->attribution_reporting_runtime_features, navigation_request.GetNavigationId()); -#endif } } diff --git a/media/capture/video/linux/v4l2_capture_delegate.cc b/media/capture/video/linux/v4l2_capture_delegate.cc index 2689d90..3517950 100644 --- a/media/capture/video/linux/v4l2_capture_delegate.cc +++ b/media/capture/video/linux/v4l2_capture_delegate.cc @@ -316,7 +316,7 @@ V4L2CaptureDelegate::V4L2CaptureDelegate( is_capturing_(false), timeout_count_(0), rotation_(rotation) { -#if BUILDFLAG(IS_LINUX) && !defined(EWK_BRINGUP) // FIXME: m120 bringup +#if BUILDFLAG(IS_LINUX) use_gpu_buffer_ = switches::IsVideoCaptureUseGpuMemoryBufferEnabled(); #endif // BUILDFLAG(IS_LINUX) } @@ -443,7 +443,7 @@ void V4L2CaptureDelegate::AllocateAndStart( client_->OnStarted(); -#if BUILDFLAG(IS_LINUX) && !defined(EWK_BRINGUP) // FIXME: m120 bringup +#if BUILDFLAG(IS_LINUX) if (use_gpu_buffer_) { v4l2_gpu_helper_ = std::make_unique( std::move(gmb_support_test_)); @@ -1146,7 +1146,7 @@ void V4L2CaptureDelegate::DoCapture() { // workable on Linux. // See http://crbug.com/959919. -#if BUILDFLAG(IS_LINUX) && !defined(EWK_BRINGUP) // FIXME: m120 bringup +#if BUILDFLAG(IS_LINUX) if (use_gpu_buffer_) { v4l2_gpu_helper_->OnIncomingCapturedData( client_.get(), buffer_tracker->start(), diff --git a/media/capture/video/linux/v4l2_capture_delegate.h b/media/capture/video/linux/v4l2_capture_delegate.h index 7fddf91..59d44c3 100644 --- a/media/capture/video/linux/v4l2_capture_delegate.h +++ b/media/capture/video/linux/v4l2_capture_delegate.h @@ -167,7 +167,7 @@ class CAPTURE_EXPORT V4L2CaptureDelegate final { // Clockwise rotation in degrees. This value should be 0, 90, 180, or 270. int rotation_; -#if BUILDFLAG(IS_LINUX) && !defined(EWK_BRINGUP) // FIXME: m120 bringup +#if BUILDFLAG(IS_LINUX) // Support GPU memory buffer. bool use_gpu_buffer_; std::unique_ptr v4l2_gpu_helper_; diff --git a/third_party/blink/renderer/build/scripts/core/style/templates/computed_style_base.h.tmpl b/third_party/blink/renderer/build/scripts/core/style/templates/computed_style_base.h.tmpl index a64ccb1..f962fe9 100644 --- a/third_party/blink/renderer/build/scripts/core/style/templates/computed_style_base.h.tmpl +++ b/third_party/blink/renderer/build/scripts/core/style/templates/computed_style_base.h.tmpl @@ -212,11 +212,7 @@ class ComputedStyleBase : public GarbageCollected { {% endfor %} } -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup private: -#else - public: -#endif {% for subgroup in computed_style.subgroups %} {{declare_field_group_class(subgroup)|indent(2)}} diff --git a/third_party/blink/renderer/platform/fonts/palette_interpolation.cc b/third_party/blink/renderer/platform/fonts/palette_interpolation.cc index 25ab98c..1ce08e9 100644 --- a/third_party/blink/renderer/platform/fonts/palette_interpolation.cc +++ b/third_party/blink/renderer/platform/fonts/palette_interpolation.cc @@ -31,10 +31,8 @@ Vector PaletteInterpolation::MixColorRecords( color_interpolation_space, hue_interpolation_method, start_color, end_color, percentage, alpha_multiplier); -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup FontPalette::FontPaletteOverride result_color_record(i, result_color); result_color_records.push_back(result_color_record); -#endif } return result_color_records; } -- 2.7.4 From 0da6fb3b14a7dc8c8d4befb545bd54f49a4ef3ce Mon Sep 17 00:00:00 2001 From: Manjeet Date: Tue, 27 Feb 2024 00:55:51 +0530 Subject: [PATCH 07/16] fixup! [M120 Migration] Enable event handling for Ozone EFL On RPi4, due to focus lost on mouse out event when hovered on IME panel, IME keys events were not dispatched to engine. This patch fixes it. Reference: https://review.tizen.org//gerrit/291887/ Change-Id: Ida9b59e31674ba03fc5cb47e043154970e4d05c0 Signed-off-by: Manjeet --- tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc index 6687966..d7e93d7 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc @@ -568,7 +568,7 @@ void EflEventHandler::OnMouseOut(void* data, Evas* evas, Evas_Object* obj, void* event_info) { -#if !BUILDFLAG(IS_TIZEN_TV) +#if !BUILDFLAG(IS_TIZEN) EflEventHandler* thiz = static_cast(data); thiz->window_->UpdateFocus(false); #endif -- 2.7.4 From ac8ab1ac41971040409648ab267718f4173ea3f1 Mon Sep 17 00:00:00 2001 From: Akshay Kanagali Date: Wed, 21 Feb 2024 17:51:29 +0530 Subject: [PATCH 08/16] [M120 Migration] Handle fullscreen event in chrome This patch enables the fullscreen feature for chrome. Reference : https://review.tizen.org/gerrit/304571/ Change-Id: Ia7a3686fad9fcc00403c1e49e075497820f93d7b Signed-off-by: Akshay Kanagali --- .../ui/exclusive_access/fullscreen_controller.cc | 2 -- .../chromium_impl/ui/ozone/platform/efl/efl_window.cc | 19 +++++++++++++++++-- .../chromium_impl/ui/ozone/platform/efl/efl_window.h | 4 ++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc index c43bbc7..60db87f 100644 --- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc +++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc @@ -479,7 +479,6 @@ void FullscreenController::EnterFullscreenModeInternal( FullscreenInternalOption option, content::RenderFrameHost* requesting_frame, int64_t display_id) { -#if !defined(ENABLE_WRT_JS) #if !BUILDFLAG(IS_MAC) // Do not enter fullscreen mode if disallowed by pref. This prevents the user // from manually entering fullscreen mode and also disables kiosk mode on @@ -539,7 +538,6 @@ void FullscreenController::EnterFullscreenModeInternal( display_id); // WindowFullscreenStateChanged() is called once the window is fullscreen. -#endif } void FullscreenController::ExitFullscreenModeInternal() { diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc index d72b443..ad2ebe0 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc @@ -219,7 +219,22 @@ bool EflWindow::HasCapture() const { } void EflWindow::SetFullscreen(bool fullscreen, int64_t target_display_id) { - NOTIMPLEMENTED(); + // Check if we need to fullscreen the window or not. + if (fullscreen != IsFullscreen()) { + state_ = fullscreen ? PlatformWindowState::kFullScreen + : PlatformWindowState::kNormal; +#if defined(USE_WAYLAND) + ecore_wl2_window_fullscreen_set(wl_window_, fullscreen); +#endif + } +} + +bool EflWindow::IsFullscreen() { +#if defined(USE_WAYLAND) + return ecore_wl2_window_fullscreen_get(wl_window_); +#endif + + return false; } void EflWindow::Maximize() { @@ -235,7 +250,7 @@ void EflWindow::Restore() { } PlatformWindowState EflWindow::GetPlatformWindowState() const { - return PlatformWindowState::kNormal; + return state_; } void EflWindow::Activate() { diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.h b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.h index d1c0d06..4da7edb 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.h +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.h @@ -102,6 +102,10 @@ class EflWindow : public PlatformWindow, public PlatformEventDispatcher { void CreateMouseCursor(); static bool is_cursor_initialized_; #endif + bool IsFullscreen(); + + // Stores current state of this window. + PlatformWindowState state_ = PlatformWindowState::kUnknown; PlatformWindowDelegate* delegate_; -- 2.7.4 From f7abd54990d6812f648190a9b660c4a33e610692 Mon Sep 17 00:00:00 2001 From: Manjeet Date: Tue, 27 Feb 2024 18:45:08 +0530 Subject: [PATCH 09/16] [M120 Migration] Free content_image_elm_host_properly Evas object content_image_elm_host_belongs to a Layout, it will be deleted when the layout deleted. Just like List, Box, and other container widgets, any object added to the Layout will become it's child, meaning that it will be deleted if the layout is deleted, move if the Layout is moved, and so on. https://docs.enlightment.org/elementery.1.15.0/group__layout.html Reference: https://review.tizen.org/gerrit/292255/ Change-Id: Ia86a429cf6891e1c152108f9c7c0763beb99ca59 Signed-off-by: Manjeet --- .../content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc index 0da202f..4e2f356 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc @@ -183,7 +183,6 @@ RWHVAuraOffscreenHelperEfl::~RWHVAuraOffscreenHelperEfl() { OnFocusOut); evas_event_callback_del_full(evas_, EVAS_CALLBACK_RENDER_FLUSH_PRE, OnEvasRenderFlushPre, this); - evas_object_del(content_image_elm_host_); evas_object_del(content_image_); content_image_elm_host_ = nullptr; -- 2.7.4 From e5c004c40602688398632efe7424d657b9c50404 Mon Sep 17 00:00:00 2001 From: Chunling Ye Date: Wed, 28 Feb 2024 19:42:48 +0800 Subject: [PATCH 10/16] [WRTjs] Use one FMS key to check is default mouse support product New RQ for tizen8.0, only use one FMS key: "com.samsung/featureconf/product.default_mouse_support" to get if is default support mouse, in 8.0 the mouse default support products are SmartMonitor, AOT and DTV. Change-Id: Iffc704595075b8495554f0ff4efc3f1baf36b39d Signed-off-by: Chunling Ye --- wrt/src/base/platform_info.cc | 23 +++++++++++++++++++++++ wrt/src/base/platform_info.h | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/wrt/src/base/platform_info.cc b/wrt/src/base/platform_info.cc index 32e71ae..3fc1a9a 100644 --- a/wrt/src/base/platform_info.cc +++ b/wrt/src/base/platform_info.cc @@ -259,12 +259,35 @@ bool IsAOT() { return is_aot; } +#if TIZEN_VERSION_AT_LEAST(8, 0, 0) +bool IsDefaultMouseSupport() { + static absl::optional is_default_mouse_support; + if (is_default_mouse_support.has_value()) + return is_default_mouse_support.value(); + + bool default_mouse_support = false; + if (system_info_get_custom_bool( + "com.samsung/featureconf/product.default_mouse_support", + &default_mouse_support) != SYSTEM_INFO_ERROR_NONE) { + LOG(WARNING) << "fail to get product.default_mouse_support"; + return false; + } + LOG(INFO) << "default_mouse_support : " << default_mouse_support; + is_default_mouse_support = default_mouse_support; + return is_default_mouse_support.value(); +} +#endif + bool IsMouseCursorSupportedModel() { static absl::optional is_cursor_support_model; if (is_cursor_support_model.has_value()) return is_cursor_support_model.value(); +#if TIZEN_VERSION_AT_LEAST(8, 0, 0) + is_cursor_support_model = IsDefaultMouseSupport(); +#else is_cursor_support_model = IsAOT() || IsSmartMonitor(); +#endif return is_cursor_support_model.value(); } diff --git a/wrt/src/base/platform_info.h b/wrt/src/base/platform_info.h index 88a1b7d..7dcc28f 100644 --- a/wrt/src/base/platform_info.h +++ b/wrt/src/base/platform_info.h @@ -21,6 +21,7 @@ #include #include "build/build_config.h" +#include "build/tizen_version.h" namespace wrt { @@ -64,6 +65,9 @@ bool IsUHDAModel(); bool Is8KPanel(); bool IsSmartMonitor(); bool IsAOT(); +#if TIZEN_VERSION_AT_LEAST(8, 0, 0) +bool IsDefaultMouseSupport(); +#endif bool HasLimitQuotaPermission(); bool IsVisualControllerSupported(); bool IsMouseCursorSupportedModel(); -- 2.7.4 From beacad5f0576529945284920c25153c82dd75878 Mon Sep 17 00:00:00 2001 From: liwei90727 Date: Wed, 28 Feb 2024 18:14:07 +0800 Subject: [PATCH 11/16] [WRTjs] Use BUILDFLAGS(IS_TV) for TV logic checking USE BUILDFLAGS(IS_XXX) for OS checking, will disable some unnecessary logic in compile stage Change-Id: I4bfb553535776b35c1aac919359deecd81c69eb7 Signed-off-by: liwei90727 --- wrt/src/browser/api/wrt_api_web_contents.cc | 20 ++++++++++---------- wrt/src/browser/popup.cc | 13 ++++++++----- wrt/src/browser/wrt_native_window_on_screen.cc | 5 ----- wrt/src/browser/wrt_web_contents.cc | 16 ++++++++-------- wrt/src/browser/wrt_web_contents_view_delegate.cc | 18 ++++++++---------- 5 files changed, 34 insertions(+), 38 deletions(-) mode change 100755 => 100644 wrt/src/browser/popup.cc diff --git a/wrt/src/browser/api/wrt_api_web_contents.cc b/wrt/src/browser/api/wrt_api_web_contents.cc index 2a9c62b..1552034 100644 --- a/wrt/src/browser/api/wrt_api_web_contents.cc +++ b/wrt/src/browser/api/wrt_api_web_contents.cc @@ -121,19 +121,19 @@ void WebContents::WillDraw(int new_rotation, gfx::Size frame_data_output_size) { } } - if (IsTvProfile()) { - if (frame_output_size_.height() != frame_output_size_.height()) { +#if BUILDFLAG(IS_TIZEN_TV) + if (frame_output_size_.height() != frame_output_size_.height()) { #if !defined(WRT_JS_BRINGUP) - auto rwhva = static_cast( - GetWebContents()->GetRenderWidgetHostView()); - if (rwhva && rwhva->aura_efl_helper() && - rwhva->aura_efl_helper()->GetIMContextEfl()) { - rwhva->aura_efl_helper()->GetIMContextEfl()->RequestHide(); - } -#endif + auto rwhva = static_cast( + GetWebContents()->GetRenderWidgetHostView()); + if (rwhva && rwhva->aura_efl_helper() && + rwhva->aura_efl_helper()->GetIMContextEfl()) { + rwhva->aura_efl_helper()->GetIMContextEfl()->RequestHide(); } - frame_output_size_.set_height(frame_output_size_.height()); +#endif } + frame_output_size_.set_height(frame_output_size_.height()); +#endif } #if BUILDFLAG(IS_TIZEN_TV) diff --git a/wrt/src/browser/popup.cc b/wrt/src/browser/popup.cc old mode 100755 new mode 100644 index 9ea43d1..bcba234 --- a/wrt/src/browser/popup.cc +++ b/wrt/src/browser/popup.cc @@ -134,8 +134,9 @@ Evas_Object* CreateNewWindow(Evas_Object* parent) { // static std::unique_ptr Popup::CreatePopup(Evas_Object* window) { - if (IsTvProfile()) - window = CreateNewWindow(window); +#if BUILDFLAG(IS_TIZEN_TV) + window = CreateNewWindow(window); +#endif Evas_Object* popup = elm_popup_add(window); #if !BUILDFLAG(IS_TIZEN_TV) @@ -401,9 +402,11 @@ void Popup::SetBody(const std::string& id) { elm_entry_utf8_to_markup(id.c_str())); evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL); - if (IsTvProfile()) - evas_object_color_set(label, 255, 255, 255, 255); - else evas_object_color_set(label, 0, 0, 0, 255); +#if BUILDFLAG(IS_TIZEN_TV) + evas_object_color_set(label, 255, 255, 255, 255); +#else + evas_object_color_set(label, 0, 0, 0, 255); +#endif elm_box_pack_end(box_, label); evas_object_show(label); } diff --git a/wrt/src/browser/wrt_native_window_on_screen.cc b/wrt/src/browser/wrt_native_window_on_screen.cc index 3484860..007d950 100644 --- a/wrt/src/browser/wrt_native_window_on_screen.cc +++ b/wrt/src/browser/wrt_native_window_on_screen.cc @@ -112,12 +112,7 @@ int WRTNativeWindowOnScreen::SetRotationState(bool is_auto, int degree) { const int rotations[4] = {0, 90, 180, 270}; ecore_evas_wm_rotation_available_rotations_set(ee, rotations, 4); } -#if BUILDFLAG(IS_TIZEN_TV) - // TODO(dh81.song): - // need to check elm_win_wm_rotation_manual_rotation_done_set is appliable - // for all profile ecore_evas_wm_rotation_manual_rotation_done_set(ee, EINA_TRUE); -#endif rotation_degree = ecore_evas_rotation_get(ee); } else { if (degree != -1) diff --git a/wrt/src/browser/wrt_web_contents.cc b/wrt/src/browser/wrt_web_contents.cc index 8318a21..0486b09 100644 --- a/wrt/src/browser/wrt_web_contents.cc +++ b/wrt/src/browser/wrt_web_contents.cc @@ -76,14 +76,14 @@ SelectPickerBase* CreateSelectPicker( SelectPickerBase* picker; Evas_Object* view_evas = WRTNativeWindow::FromWebContents(web_contents)->view_evas(); - if (IsTvProfile()) { - picker = new WRTSelectPickerTv(web_contents, selected_index, - is_multiple_selection, view_evas); - picker->SetFontSizeAsItem(item_font_size); - } else { - picker = new WRTSelectPicker( - web_contents, selected_index, is_multiple_selection, view_evas); - } +#if BUILDFLAG(IS_TIZEN_TV) + picker = new WRTSelectPickerTv(web_contents, selected_index, + is_multiple_selection, view_evas); + picker->SetFontSizeAsItem(item_font_size); +#else + picker = new WRTSelectPicker(web_contents, selected_index, + is_multiple_selection, view_evas); +#endif // Create two separate Elm_Genlist_Item_Class classes, because EFL cannot swap // item_style at runtime. picker->InitializeItemClass(); diff --git a/wrt/src/browser/wrt_web_contents_view_delegate.cc b/wrt/src/browser/wrt_web_contents_view_delegate.cc index 107d78a..765679f 100644 --- a/wrt/src/browser/wrt_web_contents_view_delegate.cc +++ b/wrt/src/browser/wrt_web_contents_view_delegate.cc @@ -31,16 +31,14 @@ WRTWebContentsViewDelegate::WRTWebContentsViewDelegate( WRTWebContentsViewDelegate::~WRTWebContentsViewDelegate() {} bool WRTWebContentsViewDelegate::Focus() { -#if defined(USE_WAYLAND) - if (!IsTvProfile()) { - auto wci = static_cast(web_contents_); - auto* rwhva = static_cast( - wci->GetRenderWidgetHostView()); - ClipboardHelperEfl::GetInstance()->SetSourceWidget( - (rwhva && rwhva->offscreen_helper()) - ? rwhva->offscreen_helper()->content_image_elm_host() - : nullptr); - } +#if defined(USE_WAYLAND) && !BUILDFLAG(IS_TIZEN_TV) + auto wci = static_cast(web_contents_); + auto* rwhva = static_cast( + wci->GetRenderWidgetHostView()); + ClipboardHelperEfl::GetInstance()->SetSourceWidget( + (rwhva && rwhva->offscreen_helper()) + ? rwhva->offscreen_helper()->content_image_elm_host() + : nullptr); #endif return false; } -- 2.7.4 From 3d1e14f216de9f65625ea31cd4cf02dda3c7d572 Mon Sep 17 00:00:00 2001 From: Gajendra N Date: Tue, 27 Feb 2024 10:52:00 +0530 Subject: [PATCH 12/16] (Part 2) Use proper naming for handles/functions that represent EwkView Commit [1] cleaned up most of the "evas_object" occurances inside tizen_src (but outside ewk layer). This commit is follow up of [1], which replaces rest of the occurances with ewk_view/EwkView inside ewk layer. Read [1]'s commit message for more details. [1] c65e88bc0c05def7e76e229beb506f2638034024 Also, cleans up unused/redundant functions. Change-Id: I2f95f491e2dc72ebbb719df2efdccf1e2a229cb7 Signed-off-by: Gajendra N --- tizen_src/ewk/efl_integration/eweb_view.cc | 4 +- tizen_src/ewk/efl_integration/eweb_view.h | 2 +- .../efl_integration/private/ewk_view_private.cc | 143 ++++++++++----------- .../ewk/efl_integration/private/ewk_view_private.h | 22 ++-- .../private/webview_delegate_ewk.cc | 28 ++-- .../efl_integration/private/webview_delegate_ewk.h | 6 +- .../ewk/efl_integration/public/ewk_settings.cc | 6 +- tizen_src/ewk/efl_integration/public/ewk_view.cc | 4 +- .../efl_integration/web_contents_delegate_efl.cc | 2 +- 9 files changed, 99 insertions(+), 118 deletions(-) diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index 3dbb9fe5..bb6c8c6 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -299,8 +299,8 @@ content::WebViewDelegate::WebContentsCreateCallback EWebView::create_new_window_web_contents_cb_ = base::BindRepeating(&NullCreateWebContents); -EWebView* EWebView::FromEvasObject(Evas_Object* eo) { - return WebViewDelegateEwk::GetInstance().GetWebViewFromEvasObject(eo); +EWebView* EWebView::FromEwkView(Evas_Object* ewk_view) { + return WebViewDelegateEwk::GetInstance().GetEWebViewFromEwkView(ewk_view); } void EWebView::VisibleContentChangedCallback(void* user_data, diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index ccccd8f..2108ae3 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -292,7 +292,7 @@ class PermissionPopupManager; class EWebView { public: - static EWebView* FromEvasObject(Evas_Object* eo); + static EWebView* FromEwkView(Evas_Object* ewk_view); EWebView(Ewk_Context*, Evas_Object* smart_object); ~EWebView(); diff --git a/tizen_src/ewk/efl_integration/private/ewk_view_private.cc b/tizen_src/ewk/efl_integration/private/ewk_view_private.cc index 91efa95..c7b547b 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_view_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_view_private.cc @@ -51,15 +51,13 @@ void SmartDataChanged(Ewk_View_Smart_Data* d) } // Evas_Smart_Class callback interface: -void handleEvasObjectAdd(Evas_Object* evas_object) -{ - const Evas_Smart* smart = evas_object_smart_smart_get(evas_object); +void handleEwkViewAdd(Evas_Object* ewk_view) { + const Evas_Smart* smart = evas_object_smart_smart_get(ewk_view); const Evas_Smart_Class* smart_class = evas_smart_class_get(smart); const Ewk_View_Smart_Class* api = reinterpret_cast(smart_class); assert(api); - Ewk_View_Smart_Data* smart_data = - GetEwkViewSmartDataFromEvasObject(evas_object); + Ewk_View_Smart_Data* smart_data = GetSmartDataFromEwkView(ewk_view); if (!smart_data) { // Allocating with 'calloc' as the API contract is that it should be deleted with 'free()'. @@ -69,31 +67,29 @@ void handleEvasObjectAdd(Evas_Object* evas_object) EINA_LOG_ERR("Failed to allocate Smart View Data"); return; } - evas_object_smart_data_set(evas_object, smart_data); + evas_object_smart_data_set(ewk_view, smart_data); } - smart_data->self = evas_object; + smart_data->self = ewk_view; smart_data->api = api; - parent_smart_class_.add(evas_object); + parent_smart_class_.add(ewk_view); smart_data->priv = 0; // Will be initialized later. } // Ewk_View_Smart_Class callback interface: -void handleEvasObjectDelete(Evas_Object* evas_object) -{ - Ewk_View_Smart_Data* smart_data = GetEwkViewSmartDataFromEvasObject(evas_object); +void handleEwkViewDelete(Evas_Object* ewk_view) { + Ewk_View_Smart_Data* smart_data = GetSmartDataFromEwkView(ewk_view); if (smart_data) { delete smart_data->priv; smart_data->priv = NULL; } - parent_smart_class_.del(evas_object); + parent_smart_class_.del(ewk_view); } -void handleEvasObjectShow(Evas_Object* o) -{ - Ewk_View_Smart_Data* d = GetEwkViewSmartDataFromEvasObject(o); - EWebView* wv = GetWebViewFromSmartData(d); +void handleEwkViewShow(Evas_Object* ewk_view) { + Ewk_View_Smart_Data* d = GetSmartDataFromEwkView(ewk_view); + EWebView* wv = GetEWebViewFromSmartData(d); if (!wv) { return; } @@ -104,10 +100,9 @@ void handleEvasObjectShow(Evas_Object* o) wv->HandleShow(); } -void handleEvasObjectHide(Evas_Object* o) -{ - Ewk_View_Smart_Data* d = GetEwkViewSmartDataFromEvasObject(o); - EWebView* wv = GetWebViewFromSmartData(d); +void handleEwkViewHide(Evas_Object* ewk_view) { + Ewk_View_Smart_Data* d = GetSmartDataFromEwkView(ewk_view); + EWebView* wv = GetEWebViewFromSmartData(d); if (!wv) { return; } @@ -122,10 +117,9 @@ void handleEvasObjectHide(Evas_Object* o) wv->HandleHide(); } -void handleEvasObjectMove(Evas_Object* o, Evas_Coord x, Evas_Coord y) -{ - Ewk_View_Smart_Data* d = GetEwkViewSmartDataFromEvasObject(o); - EWebView* wv = GetWebViewFromSmartData(d); +void handleEwkViewMove(Evas_Object* ewk_view, Evas_Coord x, Evas_Coord y) { + Ewk_View_Smart_Data* d = GetSmartDataFromEwkView(ewk_view); + EWebView* wv = GetEWebViewFromSmartData(d); if (!wv) { return; } @@ -133,10 +127,11 @@ void handleEvasObjectMove(Evas_Object* o, Evas_Coord x, Evas_Coord y) SmartDataChanged(d); } -void handleEvasObjectResize(Evas_Object* o, Evas_Coord width, Evas_Coord height) -{ - Ewk_View_Smart_Data* d = GetEwkViewSmartDataFromEvasObject(o); - EWebView* wv = GetWebViewFromSmartData(d); +void handleEwkViewResize(Evas_Object* ewk_view, + Evas_Coord width, + Evas_Coord height) { + Ewk_View_Smart_Data* d = GetSmartDataFromEwkView(ewk_view); + EWebView* wv = GetEWebViewFromSmartData(d); if (!wv) { return; } @@ -148,7 +143,7 @@ void handleEvasObjectResize(Evas_Object* o, Evas_Coord width, Evas_Coord height) LOG(ERROR) << "hardcode size as 1920 * 1080 for invalid size"; width = 1920; height = 1080; - evas_object_geometry_set(o, 0, 0, width, height); + evas_object_geometry_set(ewk_view, 0, 0, width, height); } #endif d->view.w = width; @@ -157,29 +152,31 @@ void handleEvasObjectResize(Evas_Object* o, Evas_Coord width, Evas_Coord height) SmartDataChanged(d); } -void handleEvasObjectCalculate(Evas_Object* o) -{ - Ewk_View_Smart_Data* d = GetEwkViewSmartDataFromEvasObject(o); - EWebView* wv = GetWebViewFromSmartData(d); +void handleEwkViewCalculate(Evas_Object* ewk_view) { + Ewk_View_Smart_Data* d = GetSmartDataFromEwkView(ewk_view); + EWebView* wv = GetEWebViewFromSmartData(d); if (!wv) { return; } Evas_Coord x, y, width, height; - evas_object_geometry_get(o, &x, &y, &width, &height); + evas_object_geometry_get(ewk_view, &x, &y, &width, &height); d->view.x = x; d->view.y = y; d->view.w = width; d->view.h = height; } -void handleEvasObjectColorSet(Evas_Object*, int red, int green, int blue, int alpha) -{ +void handleEwkViewColorSet(Evas_Object*, + int red, + int green, + int blue, + int alpha) { // FIXME: implement. } Eina_Bool handleTextSelectionDown(Ewk_View_Smart_Data* d, int x, int y) { - EWebView* wv = GetWebViewFromSmartData(d); + EWebView* wv = GetEWebViewFromSmartData(d); if (!wv) return false; return wv->HandleTextSelectionDown(x, y); @@ -187,7 +184,7 @@ Eina_Bool handleTextSelectionDown(Ewk_View_Smart_Data* d, int x, int y) Eina_Bool handleTextSelectionUp(Ewk_View_Smart_Data* d, int x, int y) { - EWebView* wv = GetWebViewFromSmartData(d); + EWebView* wv = GetEWebViewFromSmartData(d); if (!wv) return false; return wv->HandleTextSelectionUp(x, y); @@ -205,70 +202,68 @@ unsigned long long handleExceededDatabaseQuota(Ewk_View_Smart_Data *sd, const ch // --------- public API -------------- -bool IsWebViewObject(const Evas_Object* evas_object) -{ - if (!evas_object) { +bool IsSmartWebViewObject(const Evas_Object* ewk_view) { + if (!ewk_view) { return false; } - const char* object_type = evas_object_type_get(evas_object); - const Evas_Smart* evas_smart = evas_object_smart_smart_get(evas_object); + const char* object_type = evas_object_type_get(ewk_view); + const Evas_Smart* evas_smart = evas_object_smart_smart_get(ewk_view); if (!evas_smart) { - EINA_LOG_ERR("%p (%s) is not a smart object!", evas_object, + EINA_LOG_ERR("%p (%s) is not a smart object!", ewk_view, object_type ? object_type : "(null)"); return false; } const Evas_Smart_Class* smart_class = evas_smart_class_get(evas_smart); if (!smart_class) { - EINA_LOG_ERR("%p (%s) is not a smart class object!", evas_object, + EINA_LOG_ERR("%p (%s) is not a smart class object!", ewk_view, object_type ? object_type : "(null)"); return false; } if (smart_class->data != EwkViewSmartClassName) { - EINA_LOG_ERR("%p (%s) is not of an ewk_view (need %p, got %p)!", - evas_object, object_type ? object_type : "(null)", - EwkViewSmartClassName, smart_class->data); + EINA_LOG_ERR("%p (%s) is not of an ewk_view (need %p, got %p)!", ewk_view, + object_type ? object_type : "(null)", EwkViewSmartClassName, + smart_class->data); return false; } return true; } -Ewk_View_Smart_Data* GetEwkViewSmartDataFromEvasObject(const Evas_Object* evas_object) -{ - assert(evas_object); - assert(IsWebViewObject(evas_object)); - return static_cast(evas_object_smart_data_get(evas_object)); +Ewk_View_Smart_Data* GetSmartDataFromEwkView(const Evas_Object* ewk_view) { + assert(ewk_view); + assert(IsSmartWebViewObject(ewk_view)); + return static_cast( + evas_object_smart_data_get(ewk_view)); } -EWebView* GetWebViewFromSmartData(const Ewk_View_Smart_Data* smartData) -{ - if (smartData && smartData->priv) { - return smartData->priv->GetTizenWebView(); +EWebView* GetEWebViewFromSmartData(const Ewk_View_Smart_Data* smart_data) { + if (smart_data && smart_data->priv) { + return smart_data->priv->GetTizenWebView(); } return NULL; } -EWebView* GetWebViewFromEvasObject(const Evas_Object* eo) { - if (!IsWebViewObject(eo)) { +EWebView* GetEWebViewFromEwkView(const Evas_Object* ewk_view) { + if (!IsSmartWebViewObject(ewk_view)) { return NULL; } - Ewk_View_Smart_Data* sd = GetEwkViewSmartDataFromEvasObject(eo); - return GetWebViewFromSmartData(sd); + Ewk_View_Smart_Data* sd = GetSmartDataFromEwkView(ewk_view); + return GetEWebViewFromSmartData(sd); } Evas_Object* CreateWebViewAsEvasObject(Ewk_Context* context, Evas* canvas, Evas_Smart* smart /*= 0*/) { smart = smart ? smart : DefaultSmartClassInstance(); - Evas_Object* wv_evas_object = evas_object_smart_add(canvas, smart); - EWebView* view = new EWebView(context, wv_evas_object); + Evas_Object* ewk_view = evas_object_smart_add(canvas, smart); + EWebView* view = new EWebView(context, ewk_view); if (!view) { return NULL; } - LOG(INFO) << "EWebView: " << view << ", ewk_view:" << wv_evas_object; - Ewk_View_Smart_Data* sd = GetEwkViewSmartDataFromEvasObject(wv_evas_object); + LOG(INFO) << "EWebView: " << view << ", ewk_view: " << ewk_view; + Ewk_View_Smart_Data* sd = GetSmartDataFromEwkView(ewk_view); if (!sd) { delete view; return NULL; @@ -276,7 +271,7 @@ Evas_Object* CreateWebViewAsEvasObject(Ewk_Context* context, // attach webview as a member of smart data sd->priv = new EwkViewImpl(view); view->Initialize(); - return wv_evas_object; + return ewk_view; } @@ -295,14 +290,14 @@ bool InitSmartClassInterface(Ewk_View_Smart_Class& api) evas_object_smart_clipped_smart_set(&api.sc); // Set Evas_Smart_Class callbacks. - api.sc.add = &handleEvasObjectAdd; - api.sc.del = &handleEvasObjectDelete; - api.sc.move = &handleEvasObjectMove; - api.sc.resize = &handleEvasObjectResize; - api.sc.show = &handleEvasObjectShow; - api.sc.hide = &handleEvasObjectHide; - api.sc.calculate = &handleEvasObjectCalculate; - api.sc.color_set = &handleEvasObjectColorSet; + api.sc.add = &handleEwkViewAdd; + api.sc.del = &handleEwkViewDelete; + api.sc.move = &handleEwkViewMove; + api.sc.resize = &handleEwkViewResize; + api.sc.show = &handleEwkViewShow; + api.sc.hide = &handleEwkViewHide; + api.sc.calculate = &handleEwkViewCalculate; + api.sc.color_set = &handleEwkViewColorSet; // Set Ewk_View_Smart_Class callbacks. api.text_selection_down = &handleTextSelectionDown; diff --git a/tizen_src/ewk/efl_integration/private/ewk_view_private.h b/tizen_src/ewk/efl_integration/private/ewk_view_private.h index f77c09a..8084fb2 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_view_private.h +++ b/tizen_src/ewk/efl_integration/private/ewk_view_private.h @@ -21,10 +21,10 @@ bool InitSmartClassInterface(Ewk_View_Smart_Class& api); const char EwkViewSmartClassName[] = "EWebView"; // type conversion utility -bool IsWebViewObject(const Evas_Object* evas_object); -Ewk_View_Smart_Data* GetEwkViewSmartDataFromEvasObject(const Evas_Object* evas_object); -EWebView* GetWebViewFromSmartData(const Ewk_View_Smart_Data* smartData); -EWebView* GetWebViewFromEvasObject(const Evas_Object* eo); +bool IsSmartWebViewObject(const Evas_Object* ewk_view); +Ewk_View_Smart_Data* GetSmartDataFromEwkView(const Evas_Object* ewk_view); +EWebView* GetEWebViewFromSmartData(const Ewk_View_Smart_Data* smart_data); +EWebView* GetEWebViewFromEwkView(const Evas_Object* ewk_view); // permission message request creator std::string CreatePermissionMessageRequest( @@ -33,13 +33,13 @@ std::string CreatePermissionMessageRequest( // helper macro // TODO: "EINA_LOG_ERR" should be changed to "EINA_LOG_CRIT" // (http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=15311) -#define EWK_VIEW_IMPL_GET_OR_RETURN(evas_object, impl, ...) \ - EWebView* impl = GetWebViewFromEvasObject(evas_object); \ - do { \ - if (!impl) { \ - EINA_LOG_ERR("Evas Object %p is not Ewk WebView", evas_object); \ - return __VA_ARGS__; \ - } \ +#define EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl, ...) \ + EWebView* impl = GetEWebViewFromEwkView(ewk_view); \ + do { \ + if (!impl) { \ + EINA_LOG_ERR("Evas Object %p is not Ewk WebView", ewk_view); \ + return __VA_ARGS__; \ + } \ } while (0) #endif // ewk_view_private_h diff --git a/tizen_src/ewk/efl_integration/private/webview_delegate_ewk.cc b/tizen_src/ewk/efl_integration/private/webview_delegate_ewk.cc index 9aa120e..1332f37 100644 --- a/tizen_src/ewk/efl_integration/private/webview_delegate_ewk.cc +++ b/tizen_src/ewk/efl_integration/private/webview_delegate_ewk.cc @@ -15,28 +15,16 @@ const WebViewDelegateEwk& WebViewDelegateEwk::GetInstance() { return instance; } -EWebView* WebViewDelegateEwk::GetWebViewFromEvasObject( - Evas_Object* evas_object) const { - return ::GetWebViewFromEvasObject(evas_object); -} - -bool WebViewDelegateEwk::IsWebViewEvasObject(Evas_Object* evas_object) const { - return ::IsWebViewObject(evas_object); -} - -Evas_Object_Smart_Clipped_Data* WebViewDelegateEwk::GetSmartClippedData( - Evas_Object* evas_object) { - if (!WebViewDelegateEwk::IsWebViewEvasObject(evas_object)) { - return NULL; - } - return &GetEwkViewSmartDataFromEvasObject(evas_object)->base; +EWebView* WebViewDelegateEwk::GetEWebViewFromEwkView( + Evas_Object* ewk_view) const { + return ::GetEWebViewFromEwkView(ewk_view); } Eina_Rectangle WebViewDelegateEwk::GetLastUsedViewPortArea( - Evas_Object* evas_object) const { + Evas_Object* ewk_view) const { Eina_Rectangle result = {-1, -1, -1, -1}; - if (WebViewDelegateEwk::IsWebViewEvasObject(evas_object)) { - Ewk_View_Smart_Data* sd = GetEwkViewSmartDataFromEvasObject(evas_object); + if (::IsSmartWebViewObject(ewk_view)) { + Ewk_View_Smart_Data* sd = GetSmartDataFromEwkView(ewk_view); assert(sd); result.x = sd->view.x; result.y = sd->view.y; @@ -48,14 +36,14 @@ Eina_Rectangle WebViewDelegateEwk::GetLastUsedViewPortArea( void WebViewDelegateEwk::RequestHandleOrientationLock(EWebView* wv, int orientation) const { - Ewk_View_Smart_Data* sd = GetEwkViewSmartDataFromEvasObject(wv->ewk_view()); + Ewk_View_Smart_Data* sd = GetSmartDataFromEwkView(wv->ewk_view()); if (sd && sd->api && sd->api->orientation_lock) { sd->api->orientation_lock(sd, orientation); } } void WebViewDelegateEwk::RequestHandleOrientationUnlock(EWebView* wv) const { - Ewk_View_Smart_Data* sd = GetEwkViewSmartDataFromEvasObject(wv->ewk_view()); + Ewk_View_Smart_Data* sd = GetSmartDataFromEwkView(wv->ewk_view()); if (sd && sd->api && sd->api->orientation_unlock) { sd->api->orientation_unlock(sd); } diff --git a/tizen_src/ewk/efl_integration/private/webview_delegate_ewk.h b/tizen_src/ewk/efl_integration/private/webview_delegate_ewk.h index f9b622f..29f4d25 100644 --- a/tizen_src/ewk/efl_integration/private/webview_delegate_ewk.h +++ b/tizen_src/ewk/efl_integration/private/webview_delegate_ewk.h @@ -12,10 +12,8 @@ class EWebView; struct WebViewDelegateEwk { public: static const WebViewDelegateEwk& GetInstance(); - EWebView* GetWebViewFromEvasObject(Evas_Object* evas_object) const; - bool IsWebViewEvasObject(Evas_Object* evas_object) const; - Evas_Object_Smart_Clipped_Data* GetSmartClippedData(Evas_Object* evas_object); - Eina_Rectangle GetLastUsedViewPortArea(Evas_Object* evas_object) const; + EWebView* GetEWebViewFromEwkView(Evas_Object* ewk_view) const; + Eina_Rectangle GetLastUsedViewPortArea(Evas_Object* ewk_view) const; void RequestHandleOrientationLock(EWebView* wv, int orientation) const; void RequestHandleOrientationUnlock(EWebView* wv) const; diff --git a/tizen_src/ewk/efl_integration/public/ewk_settings.cc b/tizen_src/ewk/efl_integration/public/ewk_settings.cc index 1d63b3b..9f6b71b 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_settings.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_settings.cc @@ -37,7 +37,7 @@ namespace { void ewkUpdateWebkitPreferences(Evas_Object *ewkView) { - EWebView* impl = EWebView::FromEvasObject(ewkView); + EWebView* impl = EWebView::FromEwkView(ewkView); assert(impl); impl->UpdateWebKitPreferences(); @@ -193,7 +193,7 @@ Eina_Bool ewk_settings_private_browsing_enabled_set(Ewk_Settings* settings, Eina #elif BUILDFLAG(IS_TIZEN) if (IsMobileProfile()) { EINA_SAFETY_ON_NULL_RETURN_VAL(settings, EINA_FALSE); - EWebView* impl = EWebView::FromEvasObject(settings->ewk_view()); + EWebView* impl = EWebView::FromEwkView(settings->ewk_view()); return impl->SetPrivateBrowsing(enable); } #endif @@ -776,7 +776,7 @@ Eina_Bool ewk_settings_legacy_font_size_enabled_get(Ewk_Settings* settings) Eina_Bool ewk_settings_use_system_font_set(Ewk_Settings* settings, Eina_Bool use) { if (IsMobileProfile()) { - EWebView* impl = EWebView::FromEvasObject(settings->ewk_view()); + EWebView* impl = EWebView::FromEwkView(settings->ewk_view()); if (impl) { if (use) impl->UseSettingsFont(); diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index 5b1d807..5d0c309 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -83,7 +83,7 @@ Evas_Object* ewk_view_add_with_session_data(Evas* canvas, const char* data, unsi Evas_Object* ret = ewk_view_add(canvas); - EWebView *webView = GetWebViewFromEvasObject(ret); + EWebView* webView = GetEWebViewFromEwkView(ret); if (!webView || !data || !length) return ret; @@ -1057,7 +1057,7 @@ void ewk_view_session_data_get(Evas_Object* ewkView, const char** data, unsigned EINA_SAFETY_ON_NULL_RETURN(data); EINA_SAFETY_ON_NULL_RETURN(length); - EWebView* impl = GetWebViewFromEvasObject(ewkView); + EWebView* impl = GetEWebViewFromEwkView(ewkView); if (!impl) { *data = NULL; *length = 0; diff --git a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc index 24af37f..98fdf55 100644 --- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc +++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc @@ -196,7 +196,7 @@ WebContents* WebContentsDelegateEfl::OpenURLFromTab( ActivateContents(source); EWebView* wv = - WebViewDelegateEwk::GetInstance().GetWebViewFromEvasObject(new_object); + WebViewDelegateEwk::GetInstance().GetEWebViewFromEwkView(new_object); DCHECK(wv); wv->SetURL(url); return NULL; -- 2.7.4 From 5efe643b30fbe11a5be9a681ca2d7e30f1b89f0d Mon Sep 17 00:00:00 2001 From: Akshay Kanagali Date: Wed, 28 Feb 2024 14:47:04 +0530 Subject: [PATCH 13/16] [M120] Fix build break for chrome This patch fix chrome build issues occured by recent commits. It also disables autofill for chrome build. Change-Id: I9eb0b280057976de9c35faa125cf64cac9716121 Signed-off-by: Akshay Kanagali --- tizen_src/build/config/tizen_features.gni | 2 +- ui/events/platform/platform_event_source.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tizen_src/build/config/tizen_features.gni b/tizen_src/build/config/tizen_features.gni index 7fc0da6..06cbe65 100644 --- a/tizen_src/build/config/tizen_features.gni +++ b/tizen_src/build/config/tizen_features.gni @@ -73,7 +73,7 @@ declare_args() { tizen_thread_booster_service = false } -if (is_tizen) { +if (is_tizen && !build_chrome) { tizen_autofill = true if (tizen_product_tv) { tizen_autofill_fw = true diff --git a/ui/events/platform/platform_event_source.cc b/ui/events/platform/platform_event_source.cc index 109786f..16e993d 100644 --- a/ui/events/platform/platform_event_source.cc +++ b/ui/events/platform/platform_event_source.cc @@ -15,7 +15,7 @@ #if BUILDFLAG(IS_TIZEN_TV) #include "base/logging.h" -#include "tizen_src/ewk/efl_integration/common/application_type.h" +#include "third_party/blink/public/platform/web_application_type.h" #include "ui/events/event.h" #endif @@ -97,7 +97,7 @@ uint32_t PlatformEventSource::DispatchEvent(PlatformEvent platform_event) { if (action & POST_DISPATCH_PERFORM_DEFAULT) { for (PlatformEventDispatcher& dispatcher : dispatchers_) { #if BUILDFLAG(IS_TIZEN_TV) - if (content::IsHbbTV() && platform_event->IsKeyEvent()) { + if (blink::IsHbbTV() && platform_event->IsKeyEvent()) { if ((&dispatcher) == platform_event->GetDispatcher()) { LOG(INFO) << "Dispatching event through dispatcher : " << (&dispatcher); -- 2.7.4 From 6cc826771ef7c096af87d57975b824e510dbae86 Mon Sep 17 00:00:00 2001 From: "qiang.ji" Date: Wed, 12 Apr 2023 10:12:39 +0800 Subject: [PATCH 14/16] [M120 Migration] Fix Terms and Condition wizard shows transparent/white bg As the viz strategy is totally updated, for bg logic, we need to flow below: 1. Set bg for Render CompositorFrame EWebView::SetDrawsTransparentBackground -> WebFrameWidgetImpl::SetDrawsTransparentBackground -> layer_tree_host -> CompositorFrameSinkImpl -> CompositorFrame with transparent bg 2. Set bg for Browser CompositorFrame EWebView::SetDrawsTransparentBackground -> RenderWidgetHostViewBase::SetBackgroundColor 2.1 RenderWidgetHostViewAura::UpdateBackgroundColor() Compositor::SetBackgroundColor layer_tree_host -> RootCompositorFrameSinkImpl -> CompositorFrame with transparent bg 2.2 RWHVAuraOffscreenHelperEfl::PaintTextureToSurface RenderWidgetHostViewBase::GetBackgroundColor() if set transparent bg, need to enable blend. References: https://review.tizen.org/gerrit/291210 https://review.tizen.org/gerrit/301497 https://review.tizen.org/gerrit/302739 Change-Id: I1b0650d5446917c6171df97eebef36c2f947f5fc Signed-off-by: qiang.ji Signed-off-by: Gajendra N --- .../renderer_host/render_widget_host_view_aura.cc | 5 +++++ .../renderer/core/frame/web_frame_widget_impl.cc | 4 ++++ .../rwhv_aura_offscreen_helper_efl.cc | 24 ++++++++++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 753881a..9bfdcaf 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -807,6 +807,11 @@ void RenderWidgetHostViewAura::UpdateBackgroundColor() { DCHECK(GetBackgroundColor()); SkColor color = *GetBackgroundColor(); + // Set transparent bg for Browser process + if (color == SK_ColorTRANSPARENT && GetCompositor()) { + GetCompositor()->SetBackgroundColor(SK_ColorTRANSPARENT); + } + bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; window_->layer()->SetFillsBoundsOpaquely(opaque); window_->layer()->SetColor(color); diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc index b212320..65d3b6c 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc @@ -5145,6 +5145,10 @@ void WebFrameWidgetImpl::SetDrawsTransparentBackground( : static_cast(0xFFFFFFFF); webview->SetPageBaseBackgroundColor(absl::make_optional(backgroundColor)); + // set transparent bg for Render process + if (draws_transparent_background) { + widget_base_->LayerTreeHost()->set_background_color(SkColors::kTransparent); + } } void WebFrameWidgetImpl::SetBackgroundColor(int32_t red, diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc index 4e2f356..bfb1e76 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc @@ -250,7 +250,16 @@ bool RWHVAuraOffscreenHelperEfl::MakeCurrent() { void RWHVAuraOffscreenHelperEfl::ClearBrowserFrame() { DCHECK(evas_gl_api_); - evas_gl_api_->glClearColor(1.0, 1.0, 1.0, 1.0); + absl::optional bg_color = rwhva()->GetBackgroundColor(); + if (bg_color) { + evas_gl_api_->glClearColor( + static_cast(SkColorGetR(*bg_color)) / 255.0f, + static_cast(SkColorGetG(*bg_color)) / 255.0f, + static_cast(SkColorGetB(*bg_color)) / 255.0f, + static_cast(SkColorGetA(*bg_color)) / 255.0f); + } else { + evas_gl_api_->glClearColor(1.0, 1.0, 1.0, 1.0); + } evas_gl_api_->glClear(GL_COLOR_BUFFER_BIT); } @@ -378,7 +387,15 @@ void RWHVAuraOffscreenHelperEfl::PaintTextureToSurface(GLuint texture_id) { evas_gl_make_current(evas_gl_, evas_gl_surface_, evas_gl_context_); evas_gl_api_->glViewport(0, 0, width, height); - evas_gl_api_->glClearColor(1.0, 1.0, 1.0, 1.0); + absl::optional bg_color = rwhva()->GetBackgroundColor(); + if (bg_color && *bg_color == SK_ColorTRANSPARENT) { + LOG(INFO) << __func__ << " transparent bg"; + evas_gl_api_->glClearColor(0.0, 0.0, 0.0, 0.0); + evas_gl_api_->glEnable(GL_BLEND); + evas_gl_api_->glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } else { + evas_gl_api_->glClearColor(1.0, 1.0, 1.0, 1.0); + } evas_gl_api_->glClear(GL_COLOR_BUFFER_BIT); evas_gl_api_->glUseProgram(program_id_); @@ -412,6 +429,9 @@ void RWHVAuraOffscreenHelperEfl::PaintTextureToSurface(GLuint texture_id) { evas_gl_api_->glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, NULL); evas_gl_api_->glBindTexture(GL_TEXTURE_2D, 0); + if (bg_color && *bg_color == SK_ColorTRANSPARENT) { + evas_gl_api_->glDisable(GL_BLEND); + } evas_gl_make_current(evas_gl_, 0, 0); // for snapshot -- 2.7.4 From d2c508432ee0446a289a46e101c4246531dceb24 Mon Sep 17 00:00:00 2001 From: Koyyani Maheswari Date: Wed, 21 Feb 2024 17:59:23 +0530 Subject: [PATCH 15/16] [HOTFIX] Web app is crashing during exit when the web app is terminated, crash is reported with the below callstack: (gdb) bt 0xb30f4f16 in mojo::InterfaceEndpointClient::~InterfaceEndpointClient() () at /usr/share/chromium-efl/lib/libchromium-impl.so Disabling the CHECK temporarily since crash is happening only on termination. Change-Id: Id4c4fa55ee6398a6a1bb637634103c2a5985cf27 Signed-off-by: Koyyani Maheswari --- mojo/public/cpp/bindings/lib/interface_endpoint_client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc index 7e4d699..9bf3e76 100644 --- a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc +++ b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc @@ -490,7 +490,7 @@ InterfaceEndpointClient::InterfaceEndpointClient( } InterfaceEndpointClient::~InterfaceEndpointClient() { - CHECK(sequence_checker_.CalledOnValidSequence()); + DCHECK(sequence_checker_.CalledOnValidSequence()); if (controller_) handle_.group_controller()->DetachEndpointClient(handle_); } -- 2.7.4 From 3c671e9bcd5bc8b2d6dd1c1ea28958c6b4958899 Mon Sep 17 00:00:00 2001 From: Manjeet Date: Sun, 25 Feb 2024 02:15:22 +0530 Subject: [PATCH 16/16] [M120 Migration][TCT] Fix viewport user-scalable web-tct issue(behavior test) Value changing of |user-scalable| property of view point meta tag is not applied instantly. Due to this, zooming gesture is not working even if |user-scalable| is changed to |true|. To apply this change instantly, changed to make layout after updating |user-scalable| property. Reference: https://review.tizen.org/gerrit/288621 Change-Id: Id9ac0b4180cdea4ba9668fd9abb414cb3964d2d4 Signed-off-by: Manjeet --- .../blink/renderer/core/exported/web_view_impl.cc | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index 43095f2..e50ecae 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -2998,6 +2998,14 @@ void WebViewImpl::UpdatePageDefinedViewportConstraints( float old_initial_scale = GetPageScaleConstraintsSet().PageDefinedConstraints().initial_scale; + +#if BUILDFLAG(IS_TIZEN) + float old_min_scale = + GetPageScaleConstraintsSet().PageDefinedConstraints().minimum_scale; + float old_max_scale = + GetPageScaleConstraintsSet().PageDefinedConstraints().maximum_scale; +#endif + GetPageScaleConstraintsSet().UpdatePageDefinedConstraints(description, default_min_width); @@ -3021,11 +3029,26 @@ void WebViewImpl::UpdatePageDefinedViewportConstraints( SettingsImpl()->ViewportMetaNonUserScalableQuirk()); float new_initial_scale = GetPageScaleConstraintsSet().PageDefinedConstraints().initial_scale; +#if BUILDFLAG(IS_TIZEN) + float new_min_scale = + GetPageScaleConstraintsSet().PageDefinedConstraints().minimum_scale; + float new_max_scale = + GetPageScaleConstraintsSet().PageDefinedConstraints().maximum_scale; +#endif + if (old_initial_scale != new_initial_scale && new_initial_scale != -1) { GetPageScaleConstraintsSet().SetNeedsReset(true); if (MainFrameImpl() && MainFrameImpl()->GetFrameView()) MainFrameImpl()->GetFrameView()->SetNeedsLayout(); } +#if BUILDFLAG(IS_TIZEN) + else if (old_min_scale != -1 && + (old_min_scale != new_min_scale || old_max_scale != new_max_scale)) { + if (MainFrameImpl() && MainFrameImpl()->GetFrameView()) { + MainFrameImpl()->GetFrameView()->SetNeedsLayout(); + } + } +#endif if (does_composite_) { MainFrameImpl()->FrameWidgetImpl()->UpdateViewportDescription(description); -- 2.7.4