From 9bf7257a5a84b7d570a69f51a30f476f2dbb07f8 Mon Sep 17 00:00:00 2001 From: saurabh-2 Date: Thu, 28 Mar 2024 13:52:15 +0530 Subject: [PATCH 01/16] Fixing SVACE Issue This change fixes the NO_CAST.INTEGER_OVERFLOW issue. reference: https://review.tizen.org/gerrit/303295/ Change-Id: I07976844bf6be44fc35a996e3cbe5fa39234ac1f Signed-off-by: saurabh-2 --- tizen_src/chromium_impl/media/audio/tizen/capi_util.cc | 8 ++++++-- tizen_src/chromium_impl/media/audio/tizen/capi_util.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tizen_src/chromium_impl/media/audio/tizen/capi_util.cc b/tizen_src/chromium_impl/media/audio/tizen/capi_util.cc index f0bac70..3450561 100644 --- a/tizen_src/chromium_impl/media/audio/tizen/capi_util.cc +++ b/tizen_src/chromium_impl/media/audio/tizen/capi_util.cc @@ -122,8 +122,12 @@ int GetAudioOutputSampleRate(audio_out_h audio_out, return sample_rate; } -int LatencyInBytes(int latency_milli, int sample_rate, int bytes_per_frame) { - return latency_milli * sample_rate * bytes_per_frame / +int64_t LatencyInBytes(int latency_milli, + int sample_rate, + int bytes_per_frame) { + return (static_cast(latency_milli) * + static_cast(sample_rate) * + static_cast(bytes_per_frame)) / base::Time::kMillisecondsPerSecond; } diff --git a/tizen_src/chromium_impl/media/audio/tizen/capi_util.h b/tizen_src/chromium_impl/media/audio/tizen/capi_util.h index a852077..d4c8dd2 100644 --- a/tizen_src/chromium_impl/media/audio/tizen/capi_util.h +++ b/tizen_src/chromium_impl/media/audio/tizen/capi_util.h @@ -49,7 +49,7 @@ int GetAudioOutputSampleRate(audio_out_h audio_out, media::ChannelLayout channel_layout, SampleFormat sample_format); -int LatencyInBytes(int latency_milli, int sample_rate, int bytes_per_frame); +int64_t LatencyInBytes(int latency_milli, int sample_rate, int bytes_per_frame); int GetAudioInLatencyInBytes(audio_in_h audio_in, int bytes_per_frame); -- 2.7.4 From 9f64d5de81016d6bef860969abaf463937faebaa Mon Sep 17 00:00:00 2001 From: saurabh-2 Date: Thu, 28 Mar 2024 13:59:01 +0530 Subject: [PATCH 02/16] Fixing SVACE Issue This change fixes the NO_CAST.INTEGER_OVERFLOW issue. Change-Id: Iff85661e1d2fdedc02bd83b0792a6aa7bab41372 Signed-off-by: saurabh-2 --- tizen_src/ewk/efl_integration/renderer/plugins/hole_layer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tizen_src/ewk/efl_integration/renderer/plugins/hole_layer.cc b/tizen_src/ewk/efl_integration/renderer/plugins/hole_layer.cc index 2bf498b..5c863a2 100644 --- a/tizen_src/ewk/efl_integration/renderer/plugins/hole_layer.cc +++ b/tizen_src/ewk/efl_integration/renderer/plugins/hole_layer.cc @@ -69,7 +69,8 @@ void HoleLayerImpl::AppendSolidQuads(viz::CompositorRenderPass* render_pass, continue; append_quads_data->visible_layer_area += - visible_quad_rect.width() * visible_quad_rect.height(); + static_cast(visible_quad_rect.width()) * + static_cast(visible_quad_rect.height()); viz::SolidColorDrawQuad* quad = render_pass->CreateAndAppendDrawQuad(); -- 2.7.4 From e9d4ece3db642f9346493c5d79f3a3f9433e72d2 Mon Sep 17 00:00:00 2001 From: jiangyuwei Date: Tue, 2 Apr 2024 09:18:05 +0800 Subject: [PATCH 03/16] [M120 Migration][VD][AX] Improve navigation without TAB key in browser Because some element will consume all arrow keys and not use it to navigation, focus could be trapped in these elements. To solve this issue, for composite widget convert the arrow keys which direction is perpendicular to object orientation to tab key; and check the actual operation after author consuming arrow key to decide if reset the prevent state to trigger spatial navigation. References: - https://review.tizen.org/gerrit/291310/ Change-Id: I654c428e0d1f5cddb30fedc30ed10a0074c4f962 Signed-off-by: jiangyuwei --- .../renderer/core/accessibility/ax_object_cache.h | 9 ++ third_party/blink/renderer/core/dom/events/event.h | 6 + .../renderer/core/dom/events/event_dispatcher.cc | 37 +++++ third_party/blink/renderer/core/dom/node.cc | 6 + third_party/blink/renderer/core/dom/node.h | 4 + .../renderer/core/input/keyboard_event_manager.cc | 96 ++++++++++++ .../renderer/core/input/keyboard_event_manager.h | 5 + .../core/page/spatial_navigation_controller.cc | 28 +++- .../core/page/spatial_navigation_controller.h | 2 + .../modules/accessibility/ax_object_cache_impl.cc | 164 +++++++++++++++++++++ .../modules/accessibility/ax_object_cache_impl.h | 9 ++ 11 files changed, 365 insertions(+), 1 deletion(-) diff --git a/third_party/blink/renderer/core/accessibility/ax_object_cache.h b/third_party/blink/renderer/core/accessibility/ax_object_cache.h index 9019791..2df3e78 100644 --- a/third_party/blink/renderer/core/accessibility/ax_object_cache.h +++ b/third_party/blink/renderer/core/accessibility/ax_object_cache.h @@ -58,6 +58,9 @@ class HTMLSelectElement; class LocalFrameView; struct PhysicalRect; +#if BUILDFLAG(IS_TIZEN_TV) +class KeyboardEvent; +#endif class CORE_EXPORT AXObjectCache : public GarbageCollected { public: using BlinkAXEventIntentsSet = @@ -288,6 +291,12 @@ class CORE_EXPORT AXObjectCache : public GarbageCollected { // Ensure that a call to ProcessDeferredAccessibilityEvents() will occur soon. virtual void ScheduleAXUpdate() const = 0; +#if BUILDFLAG(IS_TIZEN_TV) + virtual void SetActiveObjectChangedFlag(bool) = 0; + virtual bool GetActiveObjectChangedFlag() = 0; + virtual bool ShouldFakeTabKeyEvent(KeyboardEvent*, Node*) = 0; +#endif + protected: friend class ScopedBlinkAXEventIntent; FRIEND_TEST_ALL_PREFIXES(ScopedBlinkAXEventIntentTest, SingleIntent); diff --git a/third_party/blink/renderer/core/dom/events/event.h b/third_party/blink/renderer/core/dom/events/event.h index a5fef82..768103c 100644 --- a/third_party/blink/renderer/core/dom/events/event.h +++ b/third_party/blink/renderer/core/dom/events/event.h @@ -245,6 +245,12 @@ class CORE_EXPORT Event : public ScriptWrappable { bool defaultPrevented() const { return default_prevented_; } virtual void preventDefault(); +#if BUILDFLAG(IS_TIZEN_TV) + void SetDefaultPrevented(bool default_prevented) { + default_prevented_ = default_prevented; + } +#endif + bool DefaultHandled() const { return default_handled_; } void SetDefaultHandled() { default_handled_ = true; } diff --git a/third_party/blink/renderer/core/dom/events/event_dispatcher.cc b/third_party/blink/renderer/core/dom/events/event_dispatcher.cc index f741544..5017634 100644 --- a/third_party/blink/renderer/core/dom/events/event_dispatcher.cc +++ b/third_party/blink/renderer/core/dom/events/event_dispatcher.cc @@ -62,6 +62,15 @@ #include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/keyboard_codes.h" #include "ui/events/keycodes/dom/keycode_converter.h" + +#if BUILDFLAG(IS_TIZEN_TV) +#include "third_party/blink/public/platform/web_application_type.h" +#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h" +#include "third_party/blink/renderer/core/dom/events/event.h" +#include "third_party/blink/renderer/core/events/keyboard_event.h" +#include "third_party/blink/renderer/core/input/keyboard_event_manager.h" +#endif + namespace blink { DispatchEventResult EventDispatcher::DispatchEvent(Node& node, Event& event) { @@ -411,6 +420,34 @@ inline void EventDispatcher::DispatchEventPostProcess( } #if BUILDFLAG(IS_TIZEN_TV) + // Now node_i might be null - in most cases it returns 'this', but + // for SliderThumbElement it may return null. + const Node* node_i = node_->FocusDelegate(); + // This is the solution that was introduced to solve the special + // problem of web browser. + if (IsWebBrowser() && node_i) { + LocalFrame* frame = node_i->GetDocument().GetFrame(); + if (event_->IsKeyboardEvent() && + event_->type() == event_type_names::kKeydown && frame && + IsSpatialNavigationEnabled(frame)) { + KeyboardEvent* kevent = DynamicTo(&GetEvent()); + if (!kevent->key().IsNull() && + SpatialNavigationDirection::kNone != + SpatialNavigationController::GetNavigationDirectionFromKeyEvent( + kevent) && + event_->defaultPrevented()) { + // If current arrow has been prevented but not actually had action on + // the object, reset the default prevent to trigger spatial navigation + LOG(INFO) << "Current arrow key has been prevented"; + AXObjectCache* cache = node_i->GetDocument().ExistingAXObjectCache(); + if (cache && !cache->GetActiveObjectChangedFlag()) { + LOG(INFO) << "Prevented arrow key has no actual action, reset to " + "navigation"; + kevent->SetDefaultPrevented(false); + } + } + } + } if (event_->IsKeyboardEvent()) { if (event_->defaultPrevented()) LOG(INFO) << "Keyboard event been defaultPrevented"; diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index e6cc97a..5e6a670 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc @@ -1189,6 +1189,12 @@ bool Node::InActiveDocument() const { return isConnected() && GetDocument().IsActive(); } +#if BUILDFLAG(IS_TIZEN_TV) +const Node* Node::FocusDelegate() const { + return this; +} +#endif + bool Node::ShouldHaveFocusAppearance() const { DCHECK(IsFocused()); return true; diff --git a/third_party/blink/renderer/core/dom/node.h b/third_party/blink/renderer/core/dom/node.h index 5c2e896..0cb4ade 100644 --- a/third_party/blink/renderer/core/dom/node.h +++ b/third_party/blink/renderer/core/dom/node.h @@ -624,6 +624,10 @@ class CORE_EXPORT Node : public EventTarget { void SetHasFocusWithin(bool flag); virtual void SetDragged(bool flag); +#if BUILDFLAG(IS_TIZEN_TV) + virtual const Node* FocusDelegate() const; +#endif + // This is called only when the node is focused. virtual bool ShouldHaveFocusAppearance() const; diff --git a/third_party/blink/renderer/core/input/keyboard_event_manager.cc b/third_party/blink/renderer/core/input/keyboard_event_manager.cc index 37faba2..89c3223 100644 --- a/third_party/blink/renderer/core/input/keyboard_event_manager.cc +++ b/third_party/blink/renderer/core/input/keyboard_event_manager.cc @@ -38,6 +38,14 @@ #include "third_party/blink/renderer/platform/windows_keyboard_codes.h" #include "ui/events/keycodes/dom/keycode_converter.h" +#if BUILDFLAG(IS_TIZEN_TV) +#include "third_party/blink/public/platform/web_application_type.h" +#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h" +#include "third_party/blink/renderer/core/frame/settings.h" +#include "third_party/blink/renderer/core/html/media/html_media_element.h" +#include "ui/events/base_event_utils.h" +#endif + #if BUILDFLAG(IS_WIN) #include #elif BUILDFLAG(IS_MAC) @@ -203,6 +211,78 @@ bool KeyboardEventManager::HandleAccessKey(const WebKeyboardEvent& evt) { return true; } +#if BUILDFLAG(IS_TIZEN_TV) +bool KeyboardEventManager::ShouldFakeTabKeyEvent(KeyboardEvent* event, + Node* node) { + AXObjectCache* cache = node->GetDocument().ExistingAXObjectCache(); + if (cache && cache->ShouldFakeTabKeyEvent(event, node)) + return true; + + // For media element, Usually use LEFT/RIGHT to control progress bar and use + // UP/DOWN to control volume and use TAB to navigation, but there is not TAB + // in TV remote control, consider there are volume key on remote control, so + // leave LEFT/RIGHT for JS and change UP/DOWN to TAB/SHIFT TAB + SpatialNavigationDirection type = + SpatialNavigationController::GetNavigationDirectionFromKeyEvent(event); + if (SpatialNavigationDirection::kUp != type && + SpatialNavigationDirection::kDown != type) + return false; + + bool is_in_media_player = false; + const Node* current = node; + while (current) { + const Element* cur_element = + current->IsElementNode() ? To(current) : nullptr; + if (current->IsMediaControls() || current->IsMediaControlElement() || + (cur_element && IsA(cur_element))) { + is_in_media_player = true; + break; + } + + // Special case: the media control element of youtube.com is just a DIV, and + // don't has Media Control Ancestor. use their class to distinguish them + if (cur_element) { + const AtomicString& class_attr = + cur_element->getAttribute(html_names::kClassAttr); + if (class_attr.Contains("html5-video-player")) { + is_in_media_player = true; + break; + } + } + + if (current->IsShadowRoot()) + current = current->OwnerShadowHost(); + else + current = current->ParentOrShadowHostElement(); + } + + if (is_in_media_player) { + LOG(INFO) << "For media element, convert DOWN/UP to TAB/SHIFT TAB"; + return true; + } + + return false; +} + +WebKeyboardEvent KeyboardEventManager::CreateFakeTabKeyDownEvent( + KeyboardEvent* event) { + WebKeyboardEvent web_event(WebInputEvent::Type::kRawKeyDown, + WebInputEvent::kNoModifiers, + base::TimeTicks::Now()); + + SpatialNavigationDirection type = + SpatialNavigationController::GetNavigationDirectionFromKeyEvent(event); + if (SpatialNavigationDirection::kUp == type || + SpatialNavigationDirection::kLeft == type) + web_event.SetModifiers(WebInputEvent::kShiftKey); + + web_event.text[0] = VKEY_TAB; + web_event.windows_key_code = VKEY_TAB; + web_event.dom_key = ui::KeycodeConverter::KeyStringToDomKey("Tab"); + return web_event; +} +#endif + WebInputEventResult KeyboardEventManager::KeyEvent( const WebKeyboardEvent& initial_key_event) { base::AutoReset is_handling_key_event(&is_handling_key_event_, true); @@ -314,6 +394,22 @@ WebInputEventResult KeyboardEventManager::KeyEvent( KeyboardEvent* event = KeyboardEvent::Create( web_event, frame_->GetDocument()->domWindow(), event_cancellable); +#if BUILDFLAG(IS_TIZEN_TV) + // Only fake Tab key for arrow key from RC. + // And this is the solution that was introduced to solve the special + // problem of web browser. + if (IsWebBrowser() && IsSpatialNavigationEnabled(frame_) && + SpatialNavigationController::GetNavigationDirectionFromKeyEvent( + event) != SpatialNavigationDirection::kNone && + web_event.is_from_rc) { + if (ShouldFakeTabKeyEvent(event, node)) { + LOG(INFO) << "CreateFakeTabKeyDownEvent for arrow key"; + event = KeyboardEvent::Create(CreateFakeTabKeyDownEvent(event), + frame_->GetDocument()->domWindow(), + event_cancellable); + } + } +#endif event->SetTarget(node); event->SetStopPropagation(!send_key_event); diff --git a/third_party/blink/renderer/core/input/keyboard_event_manager.h b/third_party/blink/renderer/core/input/keyboard_event_manager.h index 15d7f8e..3ddb79a 100644 --- a/third_party/blink/renderer/core/input/keyboard_event_manager.h +++ b/third_party/blink/renderer/core/input/keyboard_event_manager.h @@ -70,6 +70,11 @@ class CORE_EXPORT KeyboardEventManager final void DefaultImeSubmitHandler(KeyboardEvent*); void DefaultArrowEventHandler(KeyboardEvent*, Node*); +#if BUILDFLAG(IS_TIZEN_TV) + WebKeyboardEvent CreateFakeTabKeyDownEvent(KeyboardEvent*); + bool ShouldFakeTabKeyEvent(KeyboardEvent*, Node*); +#endif + const Member frame_; Member scroll_manager_; diff --git a/third_party/blink/renderer/core/page/spatial_navigation_controller.cc b/third_party/blink/renderer/core/page/spatial_navigation_controller.cc index 0f3e1a9..47f16c4 100644 --- a/third_party/blink/renderer/core/page/spatial_navigation_controller.cc +++ b/third_party/blink/renderer/core/page/spatial_navigation_controller.cc @@ -36,6 +36,10 @@ #include "third_party/blink/renderer/core/css/style_change_reason.h" +#if BUILDFLAG(IS_TIZEN_TV) +#include "third_party/blink/renderer/platform/keyboard_codes.h" +#endif + namespace blink { namespace { @@ -45,6 +49,16 @@ SpatialNavigationDirection FocusDirectionForKey(KeyboardEvent* event) { return SpatialNavigationDirection::kNone; SpatialNavigationDirection ret_val = SpatialNavigationDirection::kNone; +#if BUILDFLAG(IS_TIZEN_TV) + if (event->key() == "ArrowDown" || event->keyCode() == VKEY_DOWN) + ret_val = SpatialNavigationDirection::kDown; + else if (event->key() == "ArrowUp" || event->keyCode() == VKEY_UP) + ret_val = SpatialNavigationDirection::kUp; + else if (event->key() == "ArrowLeft" || event->keyCode() == VKEY_LEFT) + ret_val = SpatialNavigationDirection::kLeft; + else if (event->key() == "ArrowRight" || event->keyCode() == VKEY_RIGHT) + ret_val = SpatialNavigationDirection::kRight; +#else if (event->key() == "ArrowDown") ret_val = SpatialNavigationDirection::kDown; else if (event->key() == "ArrowUp") @@ -53,7 +67,7 @@ SpatialNavigationDirection FocusDirectionForKey(KeyboardEvent* event) { ret_val = SpatialNavigationDirection::kLeft; else if (event->key() == "ArrowRight") ret_val = SpatialNavigationDirection::kRight; - +#endif // TODO(bokan): We should probably assert that we don't get anything else but // currently KeyboardEventManager sends non-arrow keys here. @@ -499,6 +513,12 @@ void SpatialNavigationController::MoveInterestTo(Node* next_node) { LocalFrame* old_frame = page_->GetFocusController().FocusedFrame(); ClearFocusInExitedFrames(old_frame, next_node->GetDocument().GetFrame()); +#if BUILDFLAG(IS_TIZEN_TV) + LOG(INFO) + << "SpatialNavigationController::MoveInterestTo set focus to element: " + << element->outerHTML().Utf8().data(); +#endif + element->Focus(FocusParams(SelectionBehaviorOnFocus::kReset, mojom::blink::FocusType::kSpatialNavigation, nullptr, FocusOptions::Create(), @@ -611,5 +631,11 @@ bool SpatialNavigationController::HandleSpatialNavigationDirection( SpatialNavigationDirection direction) { return Advance(direction); } + +SpatialNavigationDirection +SpatialNavigationController::GetNavigationDirectionFromKeyEvent( + KeyboardEvent* event) { + return FocusDirectionForKey(event); +} #endif } // namespace blink diff --git a/third_party/blink/renderer/core/page/spatial_navigation_controller.h b/third_party/blink/renderer/core/page/spatial_navigation_controller.h index 01311b6..5ec3087 100644 --- a/third_party/blink/renderer/core/page/spatial_navigation_controller.h +++ b/third_party/blink/renderer/core/page/spatial_navigation_controller.h @@ -50,6 +50,8 @@ class CORE_EXPORT SpatialNavigationController final #if BUILDFLAG(IS_TIZEN_TV) bool HandleSpatialNavigationDirection(SpatialNavigationDirection direction); + static SpatialNavigationDirection GetNavigationDirectionFromKeyEvent( + KeyboardEvent* event); #endif private: diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc index 11c1b7a..ced89ed 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc @@ -115,6 +115,14 @@ #include "ui/accessibility/ax_role_properties.h" #include "ui/accessibility/mojom/ax_relative_bounds.mojom-blink.h" +#if BUILDFLAG(IS_TIZEN_TV) +#include "third_party/blink/renderer/core/events/keyboard_event.h" +#include "third_party/blink/renderer/core/input/keyboard_event_manager.h" +#include "third_party/blink/renderer/core/page/spatial_navigation.h" +#include "third_party/blink/renderer/core/page/spatial_navigation_controller.h" +#include "third_party/blink/renderer/platform/keyboard_codes.h" +#endif + // Prevent code that runs during the lifetime of the stack from altering the // document lifecycle, for the main document, and the popup document if present. #if DCHECK_IS_ON() @@ -722,6 +730,64 @@ AXObjectType DetermineAXObjectType(const Node* node, // static bool AXObjectCacheImpl::use_ax_menu_list_ = false; +#if BUILDFLAG(IS_TIZEN_TV) +bool IsOrientationPerpendicularToArrow(AccessibilityOrientation orientation, + SpatialNavigationDirection arrow) { + if (kAccessibilityOrientationVertical == orientation && + (SpatialNavigationDirection::kLeft == arrow || + SpatialNavigationDirection::kRight == arrow)) + return true; + else if (kAccessibilityOrientationHorizontal == orientation && + (SpatialNavigationDirection::kUp == arrow || + SpatialNavigationDirection::kDown == arrow)) + return true; + + return false; +} + +// For slider and composite widget with Orientation, fake the arrow keys to +// TAB key if the arrow direction is perpendicular to object orientation +// Composite widget with Orientation including: kComboBoxRole, kMenuBarRole, +// kListBoxRole, kTabListRole, kMenuRole, kRadioGroupRole, kToolbarRole, +// kTreeRole, kTreeGridRole +// FIXME: The default orientation of kRadioGroupRole is Undefined, and +// some composite widget, such as kGridRole and kSpinButtonRole, don't have +// Orientation, RadioGroup case currently fake TAB key in vertical direction; +// SpinButton case currently fake TAB key in vertical direction; Grid case +// should check if reach edge of grid, now use active object changed flag +bool ShouldFakeTabByOrientation(AXObject* widget, + SpatialNavigationDirection arrow) { + ax::mojom::Role role = widget->RoleValue(); + AccessibilityOrientation orientation = widget->Orientation(); + + if (IsOrientationPerpendicularToArrow(orientation, arrow)) { + LOG(INFO) + << "For orientation is perpendicular to arrow, convert arrow to TAB"; + return true; + } + + if (kAccessibilityOrientationUndefined == orientation) { + if (role == ax::mojom::Role::kRadioGroup && + (SpatialNavigationDirection::kUp == arrow || + SpatialNavigationDirection::kDown == arrow)) { + LOG(INFO) << "For undefined orientation Ratio Group, convert vertical " + "arrow to TAB"; + return true; + } + + if (role == ax::mojom::Role::kSpinButton && + (SpatialNavigationDirection::kLeft == arrow || + SpatialNavigationDirection::kRight == arrow)) { + LOG(INFO) << "For undefined orientation Spin Button, convert horizontal " + "arrow to TAB"; + return true; + } + } + + return false; +} +#endif + // static AXObjectCache* AXObjectCacheImpl::Create(Document& document, const ui::AXMode& ax_mode) { @@ -2041,6 +2107,10 @@ void AXObjectCacheImpl::DeferTreeUpdate( if (AXObject* obj = SafeGet(node)) { obj->InvalidateCachedValues(); } +#if BUILDFLAG(IS_TIZEN_TV) + // Mark the operation that could be triggered by arrow key + SetActiveObjectChangedFlag(true); +#endif // These events are fired during RunPostLifecycleTasks(), // ensure there is a document lifecycle update scheduled. @@ -2988,6 +3058,35 @@ void AXObjectCacheImpl::PostNotification(AXObject* object, if (!object || !object->AXObjectID() || object->IsDetached()) return; +#if BUILDFLAG(IS_TIZEN_TV) + // Mark the operation that could be triggered by arrow key + switch (event_type) { + case ax::mojom::Event::kActiveDescendantChanged: + case ax::mojom::Event::kAriaAttributeChangedDeprecated: + case ax::mojom::Event::kCheckedStateChanged: + case ax::mojom::Event::kChildrenChanged: + case ax::mojom::Event::kDocumentSelectionChanged: + case ax::mojom::Event::kExpandedChanged: + case ax::mojom::Event::kFocus: + case ax::mojom::Event::kHide: + case ax::mojom::Event::kMenuListValueChanged: + case ax::mojom::Event::kRowCollapsed: + case ax::mojom::Event::kRowCountChanged: + case ax::mojom::Event::kRowExpanded: + case ax::mojom::Event::kScrollPositionChanged: + case ax::mojom::Event::kScrolledToAnchor: + case ax::mojom::Event::kSelectedChildrenChanged: + case ax::mojom::Event::kTextSelectionChanged: + case ax::mojom::Event::kShow: + case ax::mojom::Event::kTextChanged: + case ax::mojom::Event::kValueChanged: + SetActiveObjectChangedFlag(true); + break; + default: + break; + } +#endif + Document& document = *object->GetDocument(); // It's possible for FireAXEventImmediately to post another notification. @@ -4273,6 +4372,11 @@ void AXObjectCacheImpl::HandleFocusedUIElementChanged( SCOPED_DISALLOW_LIFECYCLE_TRANSITION(); #endif // DCHECK_IS_ON() +#if BUILDFLAG(IS_TIZEN_TV) + // Mark the operation that could be triggered by arrow key + SetActiveObjectChangedFlag(true); +#endif + if (focused_doc.GetPage() && focused_doc.GetPage()->InsidePortal()) return; // Elements inside a portal are not considered focusable. @@ -4917,6 +5021,11 @@ void AXObjectCacheImpl::HandleScrollPositionChanged( LocalFrameView* frame_view) { SCOPED_DISALLOW_LIFECYCLE_TRANSITION(); +#if BUILDFLAG(IS_TIZEN_TV) + // Mark the operation that could be triggered by arrow key + SetActiveObjectChangedFlag(true); +#endif + InvalidateBoundingBoxForFixedOrStickyPosition(); need_to_send_location_changes_ = true; MarkElementDirty(document_); @@ -4925,6 +5034,12 @@ void AXObjectCacheImpl::HandleScrollPositionChanged( void AXObjectCacheImpl::HandleScrollPositionChanged( LayoutObject* layout_object) { SCOPED_DISALLOW_LIFECYCLE_TRANSITION(); + +#if BUILDFLAG(IS_TIZEN_TV) + // Mark the operation that could be triggered by arrow key + SetActiveObjectChangedFlag(true); +#endif + InvalidateBoundingBoxForFixedOrStickyPosition(); Node* node = GetClosestNodeForLayoutObject(layout_object); if (node) { @@ -5098,4 +5213,53 @@ void AXObjectCacheImpl::SetAutofillState(AXID id, WebAXAutofillState state) { } } +#if BUILDFLAG(IS_TIZEN_TV) +void AXObjectCacheImpl::SetActiveObjectChangedFlag(bool flag) { + active_object_changed_ = flag; +}; + +bool AXObjectCacheImpl::GetActiveObjectChangedFlag() { + return active_object_changed_; +}; + +bool AXObjectCacheImpl::ShouldFakeTabKeyEvent(KeyboardEvent* event, + Node* node) { + // Defaultly no need to check if arrow key have made actual changes + SetActiveObjectChangedFlag(true); + + AXObject* obj = Get(node); + if (!obj || obj->AccessibilityIsIgnored()) + return false; + + SpatialNavigationDirection type = + SpatialNavigationController::GetNavigationDirectionFromKeyEvent(event); + AXObject* widget = nullptr; + if (obj->IsSlider() || obj->IsContainerWidget()) + widget = obj; + else if (obj->ContainerWidget()) + widget = obj->ContainerWidget(); + + if (widget && ShouldFakeTabByOrientation(widget, type)) + return true; + + // ActiveObjectChangedFlag have been set true defaultly at the begin of this + // function, here set false for elements that need check in + // EventDispatcher::DispatchEventPostProcess, in which if the flag changes to + // true that means the arrow key has made actual change for current object so + // we don't use the arrow anymore, or else if it's still false then we can use + // it to navigate + if (obj->ContainerWidget()) { + // For Grid widget case: + // https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html + if (ax::mojom::Role::kGrid == obj->ContainerWidget()->RoleValue()) + SetActiveObjectChangedFlag(false); + } else { + // For the "cached" drop down list in Google search result page + if (obj->IsButton()) + SetActiveObjectChangedFlag(false); + } + + return false; +} +#endif } // namespace blink diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h index e4a45a7..6c7683a 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h @@ -658,6 +658,12 @@ class MODULES_EXPORT AXObjectCacheImpl void ProcessDeferredAccessibilityEventsImpl(Document&); void UpdateLifecycleIfNeeded(Document& document); +#if BUILDFLAG(IS_TIZEN_TV) + void SetActiveObjectChangedFlag(bool flag) override; + bool GetActiveObjectChangedFlag() override; + bool ShouldFakeTabKeyEvent(KeyboardEvent*, Node*) override; +#endif + // Is the main document currently parsing content, as opposed to being blocked // by script execution or being load complete state. bool IsParsingMainDocument() const; @@ -989,6 +995,9 @@ class MODULES_EXPORT AXObjectCacheImpl HeapMojoRemote permission_service_; HeapMojoReceiver permission_observer_receiver_; +#if BUILDFLAG(IS_TIZEN_TV) + bool active_object_changed_ = false; +#endif // Queued callbacks. TreeUpdateCallbackQueue tree_update_callback_queue_main_; -- 2.7.4 From c583c6bee3a60494cad031289f7a6513cab6a55f Mon Sep 17 00:00:00 2001 From: fangfengrong Date: Mon, 1 Apr 2024 19:23:46 +0800 Subject: [PATCH 04/16] [M120 Migration][VD] Support "XF86KeySweetTV" and "XF86HotelSolution" key Support "XF86KeySweetTV" key: "XF86KeySweetTV": { keyName: "XF86KeySweetTV", keyCode: 10605 } Support "XF86HotelSolution" key: "XF86HotelSolution": { keyName: "XF86HotelSolution", keyCode: 10489 } Reference: https://review.tizen.org/gerrit/#/c/302556/ https://review.tizen.org/gerrit/#/c/297512/ Change-Id: I7cdce44514b074d64b973abc77ece0a94eac8d1f Signed-off-by: fangfengrong --- third_party/blink/renderer/platform/keyboard_codes.h | 6 ++++++ third_party/blink/renderer/platform/windows_keyboard_codes.h | 2 ++ tizen_src/chromium_impl/ui/ozone/platform/efl/efl_keycode_map.h | 2 ++ ui/events/keycodes/dom/dom_key_data.inc | 2 ++ ui/events/keycodes/keyboard_codes_posix.h | 2 ++ 5 files changed, 14 insertions(+) diff --git a/third_party/blink/renderer/platform/keyboard_codes.h b/third_party/blink/renderer/platform/keyboard_codes.h index 18b96a5..62d28ba 100644 --- a/third_party/blink/renderer/platform/keyboard_codes.h +++ b/third_party/blink/renderer/platform/keyboard_codes.h @@ -955,6 +955,9 @@ enum { // VKEY_QUICK_ACCESS (28F8) VKEY_QUICK_ACCESS = VK_QUICK_ACCESS, + // VKEY_HOTEL_SOLUTION (28F9) + VKEY_HOTEL_SOLUTION = VK_HOTEL_SOLUTION, + // VKEY_FOCUS (28FA) VKEY_FOCUS = VK_FOCUS, @@ -1114,6 +1117,9 @@ enum { // VKEY_VOICEGUIDE_REPEAT (296C) VKEY_VOICEGUIDE_REPEAT = VK_VOICEGUIDE_REPEAT, + // VKEY_SWEET_TV (296D) + VKEY_SWEET_TV = VK_SWEET_TV, + // VKEY_CC_ONOFF (2978) VKEY_CC_ONOFF = VK_CC_ONOFF, diff --git a/third_party/blink/renderer/platform/windows_keyboard_codes.h b/third_party/blink/renderer/platform/windows_keyboard_codes.h index 2d4e6d8..b59d90b 100644 --- a/third_party/blink/renderer/platform/windows_keyboard_codes.h +++ b/third_party/blink/renderer/platform/windows_keyboard_codes.h @@ -493,6 +493,7 @@ #define VK_SRDCH_SELECT 0x28D4 #define VK_BATTERY_ALARM 0x28F6 #define VK_QUICK_ACCESS 0x28F8 +#define VK_HOTEL_SOLUTION 0x28F9 #define VK_FOCUS 0x28FA @@ -559,6 +560,7 @@ #define VK_UNIVERSAL_SWITCH 0x296A #define VK_VOICEGUIDE_PLAY_PAUSE 0x296B #define VK_VOICEGUIDE_REPEAT 0x296C +#define VK_SWEET_TV 0x296D #define VK_CC_ONOFF 0x2978 #define VK_AUTO_CC 0x2979 diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_keycode_map.h b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_keycode_map.h index 4d98157..92a7845 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_keycode_map.h +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_keycode_map.h @@ -296,6 +296,7 @@ static ui::KeyboardCode UIKeyCodeFromEflKey(const char* key) { {"XF86SrdChSelect", ui::VKEY_SRDCH_SELECT}, {"XF86BatteryAlarm", ui::VKEY_BATTERY_ALARM}, {"XF86QuickAccess", ui::VKEY_QUICK_ACCESS}, + {"XF86HotelSolution", ui::VKEY_HOTEL_SOLUTION}, {"XF86Focus", ui::VKEY_FOCUS}, {"XF86NoiseReduction", ui::VKEY_NOISE_REDUCTION}, @@ -360,6 +361,7 @@ static ui::KeyboardCode UIKeyCodeFromEflKey(const char* key) { {"XF86KeyUniversalSwitch", ui::VKEY_UNIVERSAL_SWITCH}, {"XF86VoiceGuidePlayPause", ui::VKEY_VOICEGUIDE_PLAY_PAUSE}, {"XF86KeyVoiceGuideRepeat", ui::VKEY_VOICEGUIDE_REPEAT}, + {"XF86KeySweetTV", ui::VKEY_SWEET_TV}, {"XF86CCOnOff", ui::VKEY_CC_ONOFF}, {"XF86KeyAutoCC", ui::VKEY_AUTO_CC}, diff --git a/ui/events/keycodes/dom/dom_key_data.inc b/ui/events/keycodes/dom/dom_key_data.inc index 216de79..f865a81 100644 --- a/ui/events/keycodes/dom/dom_key_data.inc +++ b/ui/events/keycodes/dom/dom_key_data.inc @@ -674,6 +674,7 @@ DOM_KEY_MAP_DECLARATION { DOM_KEY_MAP("XF86SrdChSelect", XF86SrdChSelect, 0x28D4), DOM_KEY_MAP("XF86BatteryAlarm", XF86BatteryAlarm, 0x28F6), DOM_KEY_MAP("XF86QuickAccess", XF86QuickAccess, 0x28F8), + DOM_KEY_MAP("XF86HotelSolution", XF86HotelSolution, 0x28F9), DOM_KEY_MAP("XF86Focus", XF86Focus, 0x28FA), DOM_KEY_MAP("XF86HotelMovies", XF86HotelMovies, 0x28FE), DOM_KEY_MAP("XF86HotelLanguage", XF86HotelLanguage, 0x28FF), @@ -728,6 +729,7 @@ DOM_KEY_MAP_DECLARATION { DOM_KEY_MAP("XF86KeyUniversalSwitch", XF86KeyUniversalSwitch, 0x296A), DOM_KEY_MAP("XF86VoiceGuidePlayPause",XF86VoiceGuidePlayPause, 0x296B), DOM_KEY_MAP("XF86KeyVoiceGuideRepeat",XF86KeyVoiceGuideRepeat, 0x296C), + DOM_KEY_MAP("XF86KeySweetTV", XF86KeySweetTV, 0x296D), DOM_KEY_MAP("XF86CCOnOff", XF86CCOnOff, 0x2978), DOM_KEY_MAP("XF86KeyAutoCC", XF86KeyAutoCC, 0x2979), DOM_KEY_MAP("XF86KeyAvatarSignLanguage",XF86KeyAvatarSignLanguage,0x297A), diff --git a/ui/events/keycodes/keyboard_codes_posix.h b/ui/events/keycodes/keyboard_codes_posix.h index 86915fc..fbfeb23 100644 --- a/ui/events/keycodes/keyboard_codes_posix.h +++ b/ui/events/keycodes/keyboard_codes_posix.h @@ -432,6 +432,7 @@ enum KeyboardCode { VKEY_SRDCH_SELECT = 0x28D4, VKEY_BATTERY_ALARM = 0x28F6, VKEY_QUICK_ACCESS = 0x28F8, + VKEY_HOTEL_SOLUTION = 0x28F9, VKEY_FOCUS = 0x28FA, VKEY_HOTEL_MOVIES = 0x28FE, @@ -496,6 +497,7 @@ enum KeyboardCode { VKEY_UNIVERSAL_SWITCH = 0x296A, VKEY_VOICEGUIDE_PLAY_PAUSE = 0x296B, VKEY_VOICEGUIDE_REPEAT = 0x296C, + VKEY_SWEET_TV = 0x296D, VKEY_CC_ONOFF = 0x2978, VKEY_AUTO_CC = 0x2979, -- 2.7.4 From e503926ac19db158edb5aeb2f5938dbf67ba1f72 Mon Sep 17 00:00:00 2001 From: wangjing Date: Wed, 3 Apr 2024 09:23:41 +0800 Subject: [PATCH 05/16] Fix emulator build error Fix patch: https://review.tizen.org/gerrit/308656 Change-Id: I78c464bda942f8ee3be96ccad8554ab6e651e279 Signed-off-by: wangjing --- .../browser/renderer_host/render_widget_host_view_aura.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 584a022..a3d24c3 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -489,6 +489,13 @@ bool RenderWidgetHostViewAura::IsMultiviewMode() { } #endif +void RenderWidgetHostViewAura::DidMoveWebView() { +#if defined(TIZEN_VIDEO_HOLE) + if (!on_webview_moved_callback_.is_null()) + on_webview_moved_callback_.Run(); +#endif +} + void RenderWidgetHostViewAura::SetSize(const gfx::Size& size) { // For a SetSize operation, we don't care what coordinate system the origin // of the window is in, it's only important to make sure that the origin @@ -2345,11 +2352,6 @@ void RenderWidgetHostViewAura::FocusedNodeChanged( } #if defined(TIZEN_VIDEO_HOLE) -void RenderWidgetHostViewAura::DidMoveWebView() { - if (!on_webview_moved_callback_.is_null()) - on_webview_moved_callback_.Run(); -} - void RenderWidgetHostViewAura::SetWebViewMovedCallback( const base::RepeatingClosure on_webview_moved) { on_webview_moved_callback_ = std::move(on_webview_moved); -- 2.7.4 From 01fc296558a3f86fbea32546ff8f4db8f2f70c4b Mon Sep 17 00:00:00 2001 From: Nikhil Shingne Date: Tue, 2 Apr 2024 16:05:41 +0530 Subject: [PATCH 06/16] Fixing SVACE Issues This patch fixes the following type of issues: 1) DEREF_OF_NULL 2) missed return statement 3) unnecessary performance loss while passing by value 4) uninitialized data 5) string object was destroyed 6) class member not initialize Change-Id: I64d15890d3a5cd9f16ae676c460e8713ed9759e2 Signed-off-by: Nikhil Shingne --- .../components/xwalk_extensions/browser/xwalk_extension.cc | 2 +- .../browser/context_menu/context_menu_controller_base.cc | 5 +++-- tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc | 2 +- tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.h | 2 +- .../ewk/efl_integration/browser/render_message_filter_efl.cc | 3 ++- .../ewk/efl_integration/browser/render_message_filter_efl.h | 2 +- .../ewk/efl_integration/browser/ssl_host_state_delegate_efl.cc | 5 +++++ .../ewk/efl_integration/browser/ssl_host_state_delegate_efl.h | 2 +- .../renderer/gin_native_function_invocation_helper.cc | 2 +- .../renderer/plugins/plugin_placeholder_hole.cc | 4 +++- tizen_src/ewk/ubrowser/main.cc | 5 ++++- wrt/src/browser/wrt_render_message_filter.cc | 2 +- wrt/src/browser/wrt_render_message_filter.h | 2 +- wrt/src/browser/wrt_web_contents.cc | 10 +++++----- wrt/src/browser/wrt_window_tree_host.cc | 2 +- wrt/src/browser/wrt_window_tree_host.h | 2 +- 16 files changed, 32 insertions(+), 20 deletions(-) diff --git a/tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension.cc b/tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension.cc index 361b43d..b4df023 100644 --- a/tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension.cc +++ b/tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension.cc @@ -168,7 +168,7 @@ class XWalkExtension::Interface { static const char* RuntimeGetMetadataValue(const char* key) { auto* extension_manager = XWalkExtensionManager::GetInstance(); auto value = extension_manager->GetMetadataValue(key); - return value.c_str(); + return strdup(value.c_str()); } static int PermissionsCheckAPIAccessControl( diff --git a/tizen_src/chromium_impl/content/browser/context_menu/context_menu_controller_base.cc b/tizen_src/chromium_impl/content/browser/context_menu/context_menu_controller_base.cc index 0fdf255..02d9ec4 100644 --- a/tizen_src/chromium_impl/content/browser/context_menu/context_menu_controller_base.cc +++ b/tizen_src/chromium_impl/content/browser/context_menu/context_menu_controller_base.cc @@ -292,8 +292,9 @@ void ContextMenuControllerBase::ContextMenuItemSelectedCallback( } void ContextMenuControllerBase::RequestSelectionRect() const { - CHECK(rwhva()); - rwhva()->host()->RequestSelectionRect(); + if (rwhva()) { + rwhva()->host()->RequestSelectionRect(); + } } gfx::Point ContextMenuControllerBase::CalculateSelectionMenuPosition( 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 4e96bc0..b24cff0 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 @@ -83,7 +83,7 @@ void EflWindow::SetPreparedEvasObject(Ecore_Evas* ee) { } EflWindow::EflWindow(PlatformWindowDelegate* delegate, - PlatformWindowInitProperties properties, + const PlatformWindowInitProperties& properties, EflWindowManager* manager) : delegate_(delegate), window_manager_(manager) { LOG(INFO) << this; 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 1e99f25..476367b 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 @@ -29,7 +29,7 @@ class EflWindow : public PlatformWindow, public PlatformEventDispatcher { static void SetPreparedEvasObject(Ecore_Evas* ee); EflWindow(PlatformWindowDelegate* delegate, - PlatformWindowInitProperties properties, + const PlatformWindowInitProperties& properties, EflWindowManager* manager); EflWindow(const EflWindow&) = delete; diff --git a/tizen_src/ewk/efl_integration/browser/render_message_filter_efl.cc b/tizen_src/ewk/efl_integration/browser/render_message_filter_efl.cc index f74d5bf..139db68 100644 --- a/tizen_src/ewk/efl_integration/browser/render_message_filter_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/render_message_filter_efl.cc @@ -48,7 +48,8 @@ bool RenderMessageFilterEfl::OnMessageReceived(const IPC::Message& message) { } void RenderMessageFilterEfl::OnDecideNavigationPolicy( - NavigationPolicyParams params, bool* handled) { + const NavigationPolicyParams& params, + bool* handled) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (content::WebContents* web_contents = diff --git a/tizen_src/ewk/efl_integration/browser/render_message_filter_efl.h b/tizen_src/ewk/efl_integration/browser/render_message_filter_efl.h index 27d1f0f..75ae5af 100644 --- a/tizen_src/ewk/efl_integration/browser/render_message_filter_efl.h +++ b/tizen_src/ewk/efl_integration/browser/render_message_filter_efl.h @@ -32,7 +32,7 @@ class RenderMessageFilterEfl : public content::BrowserMessageFilter { content::BrowserThread::ID*) override; private: - void OnDecideNavigationPolicy(NavigationPolicyParams, bool* handled); + void OnDecideNavigationPolicy(const NavigationPolicyParams&, bool* handled); void OnReceivedHitTestData(int view, const _Ewk_Hit_Test& hit_test_data, const NodeAttributesMap& node_attributes); diff --git a/tizen_src/ewk/efl_integration/browser/ssl_host_state_delegate_efl.cc b/tizen_src/ewk/efl_integration/browser/ssl_host_state_delegate_efl.cc index 9526940..d660c83 100644 --- a/tizen_src/ewk/efl_integration/browser/ssl_host_state_delegate_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/ssl_host_state_delegate_efl.cc @@ -118,4 +118,9 @@ bool SSLHostStateDelegateEfl::HasAllowException( StoragePartition* storage_partition) { return false; } + +bool SSLHostStateDelegateEfl::HasAllowExceptionForAnyHost( + StoragePartition* storage_partition) { + return false; +} } diff --git a/tizen_src/ewk/efl_integration/browser/ssl_host_state_delegate_efl.h b/tizen_src/ewk/efl_integration/browser/ssl_host_state_delegate_efl.h index a13dd5d..22b1fef 100644 --- a/tizen_src/ewk/efl_integration/browser/ssl_host_state_delegate_efl.h +++ b/tizen_src/ewk/efl_integration/browser/ssl_host_state_delegate_efl.h @@ -100,7 +100,7 @@ class SSLHostStateDelegateEfl : public SSLHostStateDelegate { StoragePartition* storage_partition) override; bool HasAllowExceptionForAnyHost( - StoragePartition* storage_partition) override {} + StoragePartition* storage_partition) override; private: // Certificate policies for each host. diff --git a/tizen_src/ewk/efl_integration/renderer/gin_native_function_invocation_helper.cc b/tizen_src/ewk/efl_integration/renderer/gin_native_function_invocation_helper.cc index 8906fdd..f61efb5 100644 --- a/tizen_src/ewk/efl_integration/renderer/gin_native_function_invocation_helper.cc +++ b/tizen_src/ewk/efl_integration/renderer/gin_native_function_invocation_helper.cc @@ -68,7 +68,7 @@ v8::Local GinNativeFunctionInvocationHelper::Invoke( } } - GinNativeBridgeError error; + GinNativeBridgeError error = kGinNativeBridgeNoError; std::unique_ptr result = dispatcher_->InvokeNativeMethod( object->object_id(), method_name_, arguments, &error); if (!result.get()) { diff --git a/tizen_src/ewk/efl_integration/renderer/plugins/plugin_placeholder_hole.cc b/tizen_src/ewk/efl_integration/renderer/plugins/plugin_placeholder_hole.cc index a13d00e..f588e83 100644 --- a/tizen_src/ewk/efl_integration/renderer/plugins/plugin_placeholder_hole.cc +++ b/tizen_src/ewk/efl_integration/renderer/plugins/plugin_placeholder_hole.cc @@ -149,7 +149,9 @@ PluginPlaceholderHole::PluginPlaceholderHole( hole_layer_->SetBackgroundColor(SkColor4f::FromColor(SK_ColorTRANSPARENT)); hole_layer_->SetContentsOpaque(true); hole_layer_->SetContentsOpaqueFixed(true); - plugin()->SetCcLayer(hole_layer_.get()); + if (plugin()) { + plugin()->SetCcLayer(hole_layer_.get()); + } } PluginPlaceholderHole::~PluginPlaceholderHole() { diff --git a/tizen_src/ewk/ubrowser/main.cc b/tizen_src/ewk/ubrowser/main.cc index f26eb3c..d5d9ce9 100644 --- a/tizen_src/ewk/ubrowser/main.cc +++ b/tizen_src/ewk/ubrowser/main.cc @@ -52,7 +52,10 @@ const unsigned int kWaitTimeout = 5000; #endif struct AppData { - AppData() : browser(nullptr), ewk_initialized(false) { } + AppData() + : browser(nullptr), + browser_autostart_webinspector(false), + ewk_initialized(false) {} std::vector urls; Browser* browser; diff --git a/wrt/src/browser/wrt_render_message_filter.cc b/wrt/src/browser/wrt_render_message_filter.cc index bfd8ab8..73b0d48 100644 --- a/wrt/src/browser/wrt_render_message_filter.cc +++ b/wrt/src/browser/wrt_render_message_filter.cc @@ -44,7 +44,7 @@ bool WRTRenderMessageFilter::OnMessageReceived(const IPC::Message& message) { } void WRTRenderMessageFilter::OnDecideNavigationPolicy( - NavigationPolicyParams params, + const NavigationPolicyParams& params, bool* handled) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); diff --git a/wrt/src/browser/wrt_render_message_filter.h b/wrt/src/browser/wrt_render_message_filter.h index 638f374..0409f54 100644 --- a/wrt/src/browser/wrt_render_message_filter.h +++ b/wrt/src/browser/wrt_render_message_filter.h @@ -24,7 +24,7 @@ class WRTRenderMessageFilter : public content::BrowserMessageFilter { content::BrowserThread::ID*) override; private: - void OnDecideNavigationPolicy(NavigationPolicyParams, bool* handled); + void OnDecideNavigationPolicy(const NavigationPolicyParams&, bool* handled); }; } // namespace wrt diff --git a/wrt/src/browser/wrt_web_contents.cc b/wrt/src/browser/wrt_web_contents.cc index 0486b09..8b6ecbf 100644 --- a/wrt/src/browser/wrt_web_contents.cc +++ b/wrt/src/browser/wrt_web_contents.cc @@ -346,10 +346,9 @@ void WRTWebContents::ShowContextMenuInternal( auto* renderer = GetRendererInterface(); if (!renderer) return; - renderer->QueryInputType( - base::BindOnce([](content::WebContents* web_contents, - content::ContextMenuParams params, - bool is_password_input) -> void { + renderer->QueryInputType(base::BindOnce( + [](content::WebContents* web_contents, + content::ContextMenuParams& params, bool is_password_input) -> void { auto* wrt_web_contents = WRTWebContents::FromWebContents(web_contents); if (!wrt_web_contents) @@ -360,7 +359,8 @@ void WRTWebContents::ShowContextMenuInternal( blink::mojom::FormControlType::kInputPassword; } wrt_web_contents->UpdateContextMenuWithParams(params); - }, web_contents(), params)); + }, + web_contents(), base::OwnedRef(params))); } else { UpdateContextMenuWithParams(params); } diff --git a/wrt/src/browser/wrt_window_tree_host.cc b/wrt/src/browser/wrt_window_tree_host.cc index c5455ea..cda5975 100644 --- a/wrt/src/browser/wrt_window_tree_host.cc +++ b/wrt/src/browser/wrt_window_tree_host.cc @@ -35,7 +35,7 @@ const struct tizen_policy_listener policy_listener = { } // namespace WRTWindowTreeHost::WRTWindowTreeHost( - ui::PlatformWindowInitProperties properties, + ui::PlatformWindowInitProperties&& properties, std::unique_ptr window) : aura::WindowTreeHostPlatform(std::move(properties), std::move(window)) { #if defined(USE_WAYLAND) diff --git a/wrt/src/browser/wrt_window_tree_host.h b/wrt/src/browser/wrt_window_tree_host.h index 0afaafe..cb135c5 100644 --- a/wrt/src/browser/wrt_window_tree_host.h +++ b/wrt/src/browser/wrt_window_tree_host.h @@ -33,7 +33,7 @@ class WRTWindowTreeHost : public aura::WindowTreeHostPlatform, bool is_active() const { return is_active_; } private: - WRTWindowTreeHost(ui::PlatformWindowInitProperties properties, + WRTWindowTreeHost(ui::PlatformWindowInitProperties&& properties, std::unique_ptr window); // ui::PlatformWindowDelegate: -- 2.7.4 From 8c5304a938ae05f64b9544d9606cf8c4edce476c Mon Sep 17 00:00:00 2001 From: Manjeet Date: Mon, 1 Apr 2024 15:56:36 +0530 Subject: [PATCH 07/16] [M120 Migration] Possible fix for crash during shutdown insideSelectionControllerEfl::CancelContextMenu In pre-aura, WebContentViewEfl was owned by RWHVEfl, so the order of destruction was guaranteed. But in post-aura, WCVAHelper is owned by WCVA, so during shutdown, sometimes due to destruction sync issue, WCVAHelper may not be a valid pointer in SelectionControllerEfl (which is a member of RWHVHelper). So instead of using WCVAHelper, use WebContentsEflDelegate directly to show and cancel context menu in SelectionControllerEfl class. Reference: https://review.tizen.org/gerrit/295842 Change-Id: Ic01aa40000567e8605af47a46163462e3196e57e --- .../browser/selection/selection_controller_efl.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc b/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc index bde133e..c148e38 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc +++ b/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc @@ -15,6 +15,7 @@ #include "content/browser/web_contents/web_contents_view_aura.h" #include "content/public/browser/context_menu_params.h" #include "content/public/browser/web_contents.h" +#include "ewk/efl_integration/webview_delegate_efl.h" #include "tizen/system_info.h" #include "ui/base/clipboard/clipboard_helper_efl.h" #include "ui/display/device_display_info_efl.h" @@ -467,20 +468,23 @@ void SelectionControllerEfl::ShowContextMenu() { // TODO(a1.gomes): In case of EWK apps, the call below end up calling // EWebView::ShowContextMenu. We have to make sure parameters // are correct. - WebContentsImpl* wci = static_cast(web_contents()); - WebContentsViewAura* wcva = static_cast(wci->GetView()); - wcva->wcva_helper()->ShowContextMenu(convertedParams); -} + WebContentsImplEfl* wcie = static_cast(web_contents()); + if (!wcie || !wcie->GetEflDelegate()) + return; + wcie->GetEflDelegate()->ShowContextMenu(convertedParams); +} void SelectionControllerEfl::CancelContextMenu(int request_id) { if (IsMobileProfile() && (context_menu_status_ == ContextMenuStatus::HIDDEN || context_menu_status_ == ContextMenuStatus::NONE)) { return; } - WebContentsImpl* wci = static_cast(web_contents()); - WebContentsViewAura* wcva = static_cast(wci->GetView()); - wcva->wcva_helper()->CancelContextMenu(request_id); + WebContentsImplEfl* wcie = static_cast(web_contents()); + if (!wcie || !wcie->GetEflDelegate()) + return; + + wcie->GetEflDelegate()->CancelContextMenu(request_id); } void SelectionControllerEfl::HideHandles() { -- 2.7.4 From 38b90321b7809fd28da5cc18d3170f0b68f97b78 Mon Sep 17 00:00:00 2001 From: uzair Date: Wed, 3 Apr 2024 10:38:53 +0530 Subject: [PATCH 08/16] [M120 Migration][Emulator32] Add definition in emulator32 1. When repository is "emulator32", tizen_emulator_support is true. 2. Define TIZEN_EMULATOR_SUPPORT. 3. Also adds support for macro BUIDFLAG(IS_TIZEN_EMULATOR) Reference Patch: https://review.tizen.org/gerrit/#/c/273194 Change-Id: I7c8717b5f694d2444d3505745b5e353a4c0ec359 Signed-off-by: uzair --- build/build_config.h | 6 ++++++ packaging/chromium-efl.spec | 2 +- tizen_src/build/config/BUILD.gn | 6 +++++- tizen_src/build/config/tizen_features.gni | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build/build_config.h b/build/build_config.h index c368f65..7410373 100644 --- a/build/build_config.h +++ b/build/build_config.h @@ -164,6 +164,12 @@ #define BUILDFLAG_INTERNAL_IS_EFL() (0) #endif +#if defined(TIZEN_EMULATOR_SUPPORT) +#define BUILDFLAG_INTERNAL_IS_TIZEN_EMULATOR() (1) +#else +#define BUILDFLAG_INTERNAL_IS_TIZEN_EMULATOR() (0) +#endif + #if defined(OS_AIX) #define BUILDFLAG_INTERNAL_IS_AIX() (1) #else diff --git a/packaging/chromium-efl.spec b/packaging/chromium-efl.spec index 31d62ab6..a2934b7 100644 --- a/packaging/chromium-efl.spec +++ b/packaging/chromium-efl.spec @@ -528,7 +528,7 @@ touch ./tizen_src/downloadable/ewk_api_wrapper_generator.py %if "%{?_with_wayland}" == "1" "use_wayland=true" \ %endif -%if "%{?_repository}" == "emulator" || "%{?_repository}" == "emulator32-x11" +%if "%{?_repository}" == "emulator" || "%{?_repository}" == "emulator32-x11" || "%{?_repository}" == "emulator32" "tizen_emulator_support=true" \ %endif %if "%{?tizen_profile_name}" == "tv" diff --git a/tizen_src/build/config/BUILD.gn b/tizen_src/build/config/BUILD.gn index 2742003..81937bb 100644 --- a/tizen_src/build/config/BUILD.gn +++ b/tizen_src/build/config/BUILD.gn @@ -126,6 +126,10 @@ config("tizen_feature_flags") { } if (tizen_vd_lfd || tizen_vd_iwb) { - defines += ["TIZEN_VD_ENTERPRISE_FEATURE" ] + defines += [ "TIZEN_VD_ENTERPRISE_FEATURE" ] + } + + if (tizen_emulator_support) { + defines += [ "TIZEN_EMULATOR_SUPPORT" ] } } diff --git a/tizen_src/build/config/tizen_features.gni b/tizen_src/build/config/tizen_features.gni index 32ac689..46dcfe9 100644 --- a/tizen_src/build/config/tizen_features.gni +++ b/tizen_src/build/config/tizen_features.gni @@ -56,6 +56,7 @@ declare_args() { enable_wrt_js = false tizen_atmos_decoder_enable = false + tizen_emulator_support = false tizen_pepper_extensions = false # Tizen multimedia related -- 2.7.4 From 713f5de588573c562e995947e18a212ecb690dfc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=9Awiniarski?= Date: Mon, 18 Mar 2024 09:23:31 +0100 Subject: [PATCH 09/16] Fix for building with Tizen X Repo MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Currently for building with Tizen X repo we are using directory of form out.tz_v9.0* to store object files, which is the same format of directory, as when creating with standard repositories. Due to this object files from these builds get mixed in the same directory. This patch fixes this by use of conditional in .spec file. When the Tizen X is detected, the directory of form out.tz_X* will be used instead Change-Id: Ia57797b5e1d8cfb865ecc72887877abd8d0c9a7b Signed-off-by: Aleksander Świniarski --- packaging/chromium-efl.spec | 10 ++++++++++ tizen_src/build/common.sh | 1 + 2 files changed, 11 insertions(+) diff --git a/packaging/chromium-efl.spec b/packaging/chromium-efl.spec index a2934b7..f6624ae 100644 --- a/packaging/chromium-efl.spec +++ b/packaging/chromium-efl.spec @@ -46,6 +46,12 @@ Source1: content_shell.in %define tizen_version %{tizen_version_major}%{tizen_version_minor} +%if "%{?_is_tizen_x}" == "1" +%define __is_tizen_x 1 +%else +%define __is_tizen_x 0 +%endif + %if "%{?_build_chrome}" == "1" %define __build_chrome 1 %else @@ -481,8 +487,12 @@ Chromium gcov objects %if %{__build_chrome} == 1 %define OUTPUT_BASE_FOLDER out.chrome.tz_v%{tizen_version_major}.%{tizen_version_minor}.%{repo_name}.%{ARCHITECTURE} %else +%if %{__is_tizen_x} == 1 +%define OUTPUT_BASE_FOLDER out.tz_X.%{repo_name}.%{ARCHITECTURE} +%else %define OUTPUT_BASE_FOLDER out.tz_v%{tizen_version_major}.%{tizen_version_minor}.%{repo_name}.%{ARCHITECTURE} %endif +%endif export GN_GENERATOR_OUTPUT=$PWD/%{OUTPUT_BASE_FOLDER} diff --git a/tizen_src/build/common.sh b/tizen_src/build/common.sh index 7ed7887..3fcf1eb 100755 --- a/tizen_src/build/common.sh +++ b/tizen_src/build/common.sh @@ -363,6 +363,7 @@ function setupAndExecuteTargetBuild() { PROFILE=tzwr_5.5_arm-spin elif [[ $platform == "Base-X" ]]; then PROFILE=tz_X + ARGS+=(--define "_is_tizen_x 1") else echo "Cannot set default PROFILE for platform=${platform}" exit 1 -- 2.7.4 From 4973ea732b37891f7e057f3cf91f2a69031533c7 Mon Sep 17 00:00:00 2001 From: uzair Date: Wed, 3 Apr 2024 10:42:41 +0530 Subject: [PATCH 10/16] [M120 Migration][HOTFIX][EMULATOR] Fix for output surface creation failure The emulator platform DDK api glGetInternalformativ is returning incorrect GL_SAMPLES count which results in black screen. Ideally it needs to checked as to why emulator DDK returns GL_SAMPLES as 0 whereas all other profiles DDK return correct GL_SAMPLES count. Referece: https://review.tizen.org/gerrit/c/290611 Change-Id: I1e1c5e6fe2a0c438f60a22c307cd23394dbbdd60 Signed-off-by: uzair --- third_party/skia/src/gpu/ganesh/gl/GrGLCaps.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/third_party/skia/src/gpu/ganesh/gl/GrGLCaps.cpp b/third_party/skia/src/gpu/ganesh/gl/GrGLCaps.cpp index 0c4a07d..46e5964 100644 --- a/third_party/skia/src/gpu/ganesh/gl/GrGLCaps.cpp +++ b/third_party/skia/src/gpu/ganesh/gl/GrGLCaps.cpp @@ -52,6 +52,8 @@ class SkJSONWriter; #include #endif +#include "build/build_config.h" + GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions, const GrGLContextInfo& ctxInfo, const GrGLInterface* glInterface) : INHERITED(contextOptions) { @@ -3442,11 +3444,17 @@ void GrGLCaps::setupSampleCounts(const GrGLContextInfo& ctxInfo, const GrGLInter GrGLenum glFormat = this->getRenderbufferInternalFormat(grGLFormat); GR_GL_GetInternalformativ(gli, GR_GL_RENDERBUFFER, glFormat, GR_GL_NUM_SAMPLE_COUNTS, 1, &count); +#if BUILDFLAG(IS_TIZEN_EMULATOR) + count = 1; +#endif if (count) { std::unique_ptr temp(new int[count]); GR_GL_GetInternalformativ(gli, GR_GL_RENDERBUFFER, glFormat, GR_GL_SAMPLES, count, temp.get()); // GL has a concept of MSAA rasterization with a single sample but we do not. +#if BUILDFLAG(IS_TIZEN_EMULATOR) + temp[0] = 1; +#endif if (count && temp[count - 1] == 1) { --count; SkASSERT(!count || temp[count -1] > 1); -- 2.7.4 From 406a40ddf1570440ccc836ad4862941eb9265864 Mon Sep 17 00:00:00 2001 From: zhaosy Date: Mon, 25 Mar 2024 10:52:30 +0800 Subject: [PATCH 11/16] [M120 Migration][WRTjs][VD] set screen solution for ultra width screen products For ultra width screen products(21:9 or 32:9), if app has "base_screen_resolution" metadata, when app is launched, window system will change window to 2580*1080 or 3840*1080. But view is not updated, so app still is displayed as 1920*1080. So when app is launched, set screen solution again. Reference: https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/308471/ Change-Id: I9de89e1a3aed79a0c1d91ada401f53e4b64a6aed Signed-off-by: zhaosy Signed-off-by: DongHyun Song (cherry picked from commit ba2b872240f3148c4f4d00fe7849b1538aac7750) --- tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc | 5 +++++ tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h | 1 + wrt/src/browser/tv/wrt_native_window_tv.cc | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc index 5df11cb..840af03 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc @@ -30,6 +30,11 @@ std::vector screen_list; } // namespace // static +void EflScreen::ClearCachedDisplaySize() { + screen_width = screen_height = 0; +} + +// static gfx::Rect EflScreen::GetDisplaySize() { if (!screen_width || !screen_height) { #if defined(USE_WAYLAND) diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h index ba37c4b..c5ce65d 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h @@ -21,6 +21,7 @@ namespace ui { class EflScreen : public PlatformScreen { public: static gfx::Rect GetDisplaySize(); + static void ClearCachedDisplaySize(); EflScreen(); diff --git a/wrt/src/browser/tv/wrt_native_window_tv.cc b/wrt/src/browser/tv/wrt_native_window_tv.cc index 5684d27..27b07cf 100644 --- a/wrt/src/browser/tv/wrt_native_window_tv.cc +++ b/wrt/src/browser/tv/wrt_native_window_tv.cc @@ -81,6 +81,8 @@ const char* kProxyVconfKey = "memory/dnet/proxy"; const char* kWebAppProxyVconfKey = "db/webapp/proxy"; // metadata +const char* kBaseScreenResolution = + "http://tizen.org/metadata/app_ui_type/base_screen_resolution"; const char* kDualDecodingWebRTC = "http://samsung.com/tv/metadata/dual.decoding.support"; const char* kContentZoomFill = @@ -844,6 +846,15 @@ void WRTNativeWindowTV::SetAppMetaDataInfo() { LOG(INFO) << "zoom fill is " << zoom_fill; menu_zoom_fill_ = meta_data_info.GetValue(kContentZoomFill); } + + auto base_screen_resolution = meta_data_info.GetValue(kBaseScreenResolution); + if (!base_screen_resolution.empty()) { + LOG(INFO) << "base screen resolution is " << base_screen_resolution; + int width = 1920, height = 1080; + ui::EflScreen::ClearCachedDisplaySize(); + GetScreenResolution(width, height); + SetScreenResolution(width, height); + } } void WRTNativeWindowTV::SetAppMetaDataInfoRelatedWindow() { -- 2.7.4 From 716d4a834eba54bab3ca01b90fc410dc213893c4 Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Thu, 4 Apr 2024 09:34:43 +0000 Subject: [PATCH 12/16] Revert "[M120 Migration][WRTjs][VD] set screen solution for ultra width screen products" merged by mistake This reverts commit 406a40ddf1570440ccc836ad4862941eb9265864. Change-Id: Id72e75f0c9bb6b32b49800fea9f0a2f02ea74136 --- tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc | 5 ----- tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h | 1 - wrt/src/browser/tv/wrt_native_window_tv.cc | 11 ----------- 3 files changed, 17 deletions(-) diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc index 840af03..5df11cb 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.cc @@ -30,11 +30,6 @@ std::vector screen_list; } // namespace // static -void EflScreen::ClearCachedDisplaySize() { - screen_width = screen_height = 0; -} - -// static gfx::Rect EflScreen::GetDisplaySize() { if (!screen_width || !screen_height) { #if defined(USE_WAYLAND) diff --git a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h index c5ce65d..ba37c4b 100644 --- a/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h +++ b/tizen_src/chromium_impl/ui/ozone/platform/efl/efl_screen.h @@ -21,7 +21,6 @@ namespace ui { class EflScreen : public PlatformScreen { public: static gfx::Rect GetDisplaySize(); - static void ClearCachedDisplaySize(); EflScreen(); diff --git a/wrt/src/browser/tv/wrt_native_window_tv.cc b/wrt/src/browser/tv/wrt_native_window_tv.cc index 27b07cf..5684d27 100644 --- a/wrt/src/browser/tv/wrt_native_window_tv.cc +++ b/wrt/src/browser/tv/wrt_native_window_tv.cc @@ -81,8 +81,6 @@ const char* kProxyVconfKey = "memory/dnet/proxy"; const char* kWebAppProxyVconfKey = "db/webapp/proxy"; // metadata -const char* kBaseScreenResolution = - "http://tizen.org/metadata/app_ui_type/base_screen_resolution"; const char* kDualDecodingWebRTC = "http://samsung.com/tv/metadata/dual.decoding.support"; const char* kContentZoomFill = @@ -846,15 +844,6 @@ void WRTNativeWindowTV::SetAppMetaDataInfo() { LOG(INFO) << "zoom fill is " << zoom_fill; menu_zoom_fill_ = meta_data_info.GetValue(kContentZoomFill); } - - auto base_screen_resolution = meta_data_info.GetValue(kBaseScreenResolution); - if (!base_screen_resolution.empty()) { - LOG(INFO) << "base screen resolution is " << base_screen_resolution; - int width = 1920, height = 1080; - ui::EflScreen::ClearCachedDisplaySize(); - GetScreenResolution(width, height); - SetScreenResolution(width, height); - } } void WRTNativeWindowTV::SetAppMetaDataInfoRelatedWindow() { -- 2.7.4 From bb345c85101b7e8f78f03c2f39c2d9de79dd60e8 Mon Sep 17 00:00:00 2001 From: saurabh-2 Date: Fri, 5 Apr 2024 10:23:41 +0530 Subject: [PATCH 13/16] Fixing COVERITY Issue This patch fixes the COVERITY issues of following types: AUTO_CAUSES_COPY Change-Id: Ie6a7814070590a64fd03f2005ccec6aa9f39fd3f Signed-off-by: saurabh-2 --- .../chromium_impl/media/capture/video/tizen/camera_device_tizen.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tizen_src/chromium_impl/media/capture/video/tizen/camera_device_tizen.cc b/tizen_src/chromium_impl/media/capture/video/tizen/camera_device_tizen.cc index 2fab2f0..39fdd16 100644 --- a/tizen_src/chromium_impl/media/capture/video/tizen/camera_device_tizen.cc +++ b/tizen_src/chromium_impl/media/capture/video/tizen/camera_device_tizen.cc @@ -181,8 +181,8 @@ void GenerateChromiumVideoCaptureFormat( std::vector& capabilities, const std::vector& formats, std::vector& outSupportedFormats) { - for (auto supportedFrameInfo : capabilities) { - for (auto supportedFormat : formats) { + for (const auto& supportedFrameInfo : capabilities) { + for (const auto& supportedFormat : formats) { media::VideoCaptureFormat format; format.frame_size = supportedFrameInfo.resolution; format.frame_rate = supportedFrameInfo.fps; -- 2.7.4 From 3953af1cef55131bb676a8df272fba5b1ee8254d Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Wed, 3 Apr 2024 09:54:38 +0900 Subject: [PATCH 14/16] [XWalkExtension] Fix dangling issue of GetMetadataValue It cannot return local std::string's c_str() value as a return value. It can be a dangling pointer. Change-Id: I6e00b594e267433b17f56998886fd9344c9d0a80 Signed-off-by: DongHyun Song --- .../components/xwalk_extensions/browser/xwalk_extension.cc | 9 ++++++--- .../components/xwalk_extensions/public/XW_Extension_Runtime.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension.cc b/tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension.cc index b4df023..247f283 100644 --- a/tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension.cc +++ b/tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension.cc @@ -165,10 +165,13 @@ class XWalkExtension::Interface { extension_manager->SendMouseEvent(event, btn, x, y); } - static const char* RuntimeGetMetadataValue(const char* key) { + static void RuntimeGetMetadataValue(const char* key, + char* value, + unsigned int len) { auto* extension_manager = XWalkExtensionManager::GetInstance(); - auto value = extension_manager->GetMetadataValue(key); - return strdup(value.c_str()); + auto metadata_value = extension_manager->GetMetadataValue(key); + if (!metadata_value.empty()) + std::snprintf(value, len, "%s", metadata_value.c_str()); } static int PermissionsCheckAPIAccessControl( diff --git a/tizen_src/chromium_impl/components/xwalk_extensions/public/XW_Extension_Runtime.h b/tizen_src/chromium_impl/components/xwalk_extensions/public/XW_Extension_Runtime.h index d7b3cea..7d284a7 100644 --- a/tizen_src/chromium_impl/components/xwalk_extensions/public/XW_Extension_Runtime.h +++ b/tizen_src/chromium_impl/components/xwalk_extensions/public/XW_Extension_Runtime.h @@ -45,7 +45,7 @@ typedef struct XW_Internal_WindowInterface_ { void (*RemoveWindowEventListener)(XW_Instance instance); void (*SendKeyEvent)(const char* event, const char* key_code); void (*SendMouseEvent)(const char* event, int button, int x, int y); - const char* (*GetMetadataValue)(const char* key); + void (*GetMetadataValue)(const char* key, char* value, unsigned int len); } XW_Internal_WindowInterface; #ifdef __cplusplus -- 2.7.4 From 3e0816ba6e10505268902b3146e9e3cb86a9a888 Mon Sep 17 00:00:00 2001 From: jiangyuwei Date: Sun, 7 Apr 2024 14:46:19 +0800 Subject: [PATCH 15/16] [M120 Migration] Add guard code to avoid crash during webview clean In low memory case, browser will clean webview and create new one, driver will release and cause autofill crash. References: - https://review.tizen.org/gerrit/300788/ Change-Id: Iedd4a8a2a7005fc472ee00bb4e26599c8507e642 Signed-off-by: jiangyuwei --- components/password_manager/core/browser/password_form_filling.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/password_manager/core/browser/password_form_filling.cc b/components/password_manager/core/browser/password_form_filling.cc index ca45a25..16a62c3 100644 --- a/components/password_manager/core/browser/password_form_filling.cc +++ b/components/password_manager/core/browser/password_form_filling.cc @@ -129,7 +129,10 @@ LikelyFormFilling SendFillInformationToRenderer( bool webauthn_suggestions_available) { DCHECK(driver); DCHECK_EQ(PasswordForm::Scheme::kHtml, observed_form.scheme); - + if (!driver) { + LOG(ERROR) << "driver already released, fill will not work"; + return LikelyFormFilling::kNoFilling; + } if (autofill::IsShowAutofillSignaturesEnabled()) { driver->AnnotateFieldsWithParsingResult( {.username_renderer_id = observed_form.username_element_renderer_id, -- 2.7.4 From 29ad5a946f64ca23da19e716089adf5659f49505 Mon Sep 17 00:00:00 2001 From: jiangyuwei Date: Sun, 7 Apr 2024 14:04:59 +0800 Subject: [PATCH 16/16] [M120 Migration][VD][Accessibility] Add smart callbacks for spatial navigation This patch is for changing focus from web view in Tizen TV to browser when cannot move focus any more by press arrow keys in spatial navigation. References: - https://review.tizen.org/gerrit/291208/ Change-Id: I3c7d860b9f42e6f863c0174ce918490b6fcf0202 Signed-off-by: jiangyuwei --- components/plugins/renderer/webview_plugin.h | 1 + .../renderer_host/render_widget_host_impl.cc | 7 +++++ .../renderer_host/render_widget_host_impl.h | 1 + .../renderer_host/render_widget_host_view_aura.cc | 6 ++++ .../renderer_host/render_widget_host_view_aura.h | 1 + .../renderer_host/render_widget_host_view_base.h | 2 ++ content/public/browser/web_contents_delegate.h | 1 + .../public/mojom/widget/platform_widget.mojom | 3 ++ .../renderer/core/frame/web_frame_widget_impl.cc | 4 +++ .../renderer/core/frame/web_frame_widget_impl.h | 1 + .../blink/renderer/core/page/spatial_navigation.h | 12 ++++++++ .../core/page/spatial_navigation_controller.cc | 32 ++++++++++++++++++++++ .../core/page/spatial_navigation_controller.h | 1 + .../blink/renderer/platform/widget/widget_base.cc | 4 +++ .../blink/renderer/platform/widget/widget_base.h | 1 + .../renderer_host/rwhv_aura_common_helper_efl.cc | 5 ++++ .../renderer_host/rwhv_aura_common_helper_efl.h | 1 + .../ewk/efl_integration/eweb_view_callbacks.h | 4 +++ .../efl_integration/web_contents_delegate_efl.cc | 7 +++++ .../efl_integration/web_contents_delegate_efl.h | 1 + 20 files changed, 95 insertions(+) diff --git a/components/plugins/renderer/webview_plugin.h b/components/plugins/renderer/webview_plugin.h index 4d9c310..1ce8690 100644 --- a/components/plugins/renderer/webview_plugin.h +++ b/components/plugins/renderer/webview_plugin.h @@ -197,6 +197,7 @@ class WebViewPlugin : public blink::WebPlugin, public blink::WebViewObserver { void SetCursor(const ui::Cursor& cursor) override; #if BUILDFLAG(IS_TIZEN_TV) void DidEdgeScrollBy(const gfx::Point& point, bool handled) override {} + void MoveFocusToBrowser(int direction) override {} void NotifyTrackInfoToBrowser(int active_track_id, const std::string& url, const std::string& lang) override {} diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 474dd2d..e19024b 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -2902,6 +2902,13 @@ void RenderWidgetHostImpl::DidEdgeScrollBy(const gfx::Point& offset, bool handle view_->DidEdgeScrollBy(offset, handled); } +void RenderWidgetHostImpl::MoveFocusToBrowser(int direction) { + if (!GetView()) + return; + + view_->MoveFocusToBrowser(direction); +} + void RenderWidgetHostImpl::SetTranslatedURL(const std::string& url) { if (!blink_widget_) return; diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index d9abcd9..c542a51 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -322,6 +322,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl #if BUILDFLAG(IS_TIZEN_TV) //Browser edge scroll void DidEdgeScrollBy(const gfx::Point& point, bool handled) override; + void MoveFocusToBrowser(int direction) override; void NotifyTrackInfoToBrowser(int active_track_id, const std::string& url, const std::string& lang) override; 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 a3d24c3..8dc88b6 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -2364,6 +2364,12 @@ void RenderWidgetHostViewAura::DidEdgeScrollBy(const gfx::Point& offset, efl_helper_->DidEdgeScrollBy(offset, handled); } +void RenderWidgetHostViewAura::MoveFocusToBrowser(int direction) { + if (aura_efl_helper()) { + aura_efl_helper()->MoveFocusToBrowser(direction); + } +} + void RenderWidgetHostViewAura::NotifyTrackInfoToBrowser( int active_track_id, const std::string& url, diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 80bb89f..fa133fa 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -235,6 +235,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura #if BUILDFLAG(IS_TIZEN_TV) //Browser edge scroll void DidEdgeScrollBy(const gfx::Point& offset, bool handled) override ; + void MoveFocusToBrowser(int direction) override; void NotifyTrackInfoToBrowser(int active_track_id, const std::string& url, const std::string& lang) override; diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index 2b55acf..5076dde 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -507,6 +507,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { #if BUILDFLAG(IS_TIZEN_TV) //Browser edge scroll virtual void DidEdgeScrollBy(const gfx::Point& offset, bool handled) {} + virtual void MoveFocusToBrowser(int direction) {} + // notify web browser video playing status virtual void VideoPlayingStatusReceived(bool is_playing, int callback_id) {} diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index d2d66ab..57d3318 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -409,6 +409,7 @@ class CONTENT_EXPORT WebContentsDelegate { #if BUILDFLAG(IS_TIZEN_TV) virtual void DidEdgeScrollBy(const gfx::Point& offset, bool handled) {} + virtual void MoveFocusToBrowser(int direction) {} virtual void ShowMicOpenedNotification(bool show) {} #endif diff --git a/third_party/blink/public/mojom/widget/platform_widget.mojom b/third_party/blink/public/mojom/widget/platform_widget.mojom index 0f8367e..9c2cd90c 100644 --- a/third_party/blink/public/mojom/widget/platform_widget.mojom +++ b/third_party/blink/public/mojom/widget/platform_widget.mojom @@ -41,6 +41,9 @@ interface WidgetHost { //Browser edge scroll DidEdgeScrollBy(gfx.mojom.Point offset, bool handled); + [EnableIf=is_tizen_tv] + MoveFocusToBrowser(int32 direction); + // Sent by a widget to the browser to set the tooltip text for the current // cursor position. An empty |tooltip_text| will hide the tooltip view. UpdateTooltipUnderCursor(mojo_base.mojom.String16 tooltip_text, 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 beb29d0..153089a 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 @@ -5189,6 +5189,10 @@ void WebFrameWidgetImpl::NotifyTrackInfoToBrowser(int active_track_id, << " url:" << url << " lang:" << lang; widget_base_->NotifyTrackInfoToBrowser(active_track_id, url, lang); } + +void WebFrameWidgetImpl::MoveFocusToBrowser(int direction) { + widget_base_->MoveFocusToBrowser(direction); +} #endif #if BUILDFLAG(IS_TIZEN) diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h index c327506..64d8a9b 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h @@ -713,6 +713,7 @@ class CORE_EXPORT WebFrameWidgetImpl void NotifyTrackInfoToBrowser(int active_track_id, const std::string& url, const std::string& lang); + void MoveFocusToBrowser(int direction); #endif protected: diff --git a/third_party/blink/renderer/core/page/spatial_navigation.h b/third_party/blink/renderer/core/page/spatial_navigation.h index 5963970..c7de3c5 100644 --- a/third_party/blink/renderer/core/page/spatial_navigation.h +++ b/third_party/blink/renderer/core/page/spatial_navigation.h @@ -35,6 +35,18 @@ class HTMLFrameOwnerElement; enum class SpatialNavigationDirection { kNone, kUp, kRight, kDown, kLeft }; +// The direction value in WebFocusType (before Tizen 5.5) is different from +// SpatialNavigationDirection. While ewk callback is using the int value of +// them, if can not change ewk interface then we need compatible adaptation +enum CompatibilityFocusType { + kFocusTypeNone = 0, + // Spatial navigation. + kFocusTypeUp = 3, + kFocusTypeDown, + kFocusTypeLeft, + kFocusTypeRight +}; + constexpr double kMaxDistance = std::numeric_limits::max(); CORE_EXPORT bool IsSpatialNavigationEnabled(const LocalFrame*); diff --git a/third_party/blink/renderer/core/page/spatial_navigation_controller.cc b/third_party/blink/renderer/core/page/spatial_navigation_controller.cc index 47f16c4..fb654f4 100644 --- a/third_party/blink/renderer/core/page/spatial_navigation_controller.cc +++ b/third_party/blink/renderer/core/page/spatial_navigation_controller.cc @@ -37,6 +37,7 @@ #include "third_party/blink/renderer/core/css/style_change_reason.h" #if BUILDFLAG(IS_TIZEN_TV) +#include "third_party/blink/renderer/core/frame/web_frame_widget_impl.h" #include "third_party/blink/renderer/platform/keyboard_codes.h" #endif @@ -309,6 +310,25 @@ void SpatialNavigationController::Trace(Visitor* visitor) const { visitor->Trace(page_); } +int SpatialNavigationController::ToCompatibilityFocusType( + SpatialNavigationDirection direction) { + switch (direction) { + case SpatialNavigationDirection::kUp: + return CompatibilityFocusType::kFocusTypeUp; + case SpatialNavigationDirection::kDown: + return CompatibilityFocusType::kFocusTypeDown; + case SpatialNavigationDirection::kLeft: + return CompatibilityFocusType::kFocusTypeLeft; + case SpatialNavigationDirection::kRight: + return CompatibilityFocusType::kFocusTypeRight; + case SpatialNavigationDirection::kNone: + return CompatibilityFocusType::kFocusTypeNone; + default: + NOTREACHED(); + return CompatibilityFocusType::kFocusTypeNone; + } +} + bool SpatialNavigationController::Advance( SpatialNavigationDirection direction) { Node* interest_node = StartingNode(); @@ -357,6 +377,18 @@ bool SpatialNavigationController::Advance( document->UpdateStyleAndLayout(DocumentUpdateReason::kSpatialNavigation); } +#if BUILDFLAG(IS_TIZEN_TV) + Frame* frame = page_->GetFocusController().FocusedOrMainFrame(); + auto* local_frame = DynamicTo(frame); + if (!local_frame) + return false; + WebFrameWidgetImpl* wfwgt = + static_cast(local_frame->GetWidgetForLocalRoot()); + if (!wfwgt) + return false; + wfwgt->MoveFocusToBrowser(ToCompatibilityFocusType(direction)); +#endif + return false; } diff --git a/third_party/blink/renderer/core/page/spatial_navigation_controller.h b/third_party/blink/renderer/core/page/spatial_navigation_controller.h index 5ec3087..922c340 100644 --- a/third_party/blink/renderer/core/page/spatial_navigation_controller.h +++ b/third_party/blink/renderer/core/page/spatial_navigation_controller.h @@ -55,6 +55,7 @@ class CORE_EXPORT SpatialNavigationController final #endif private: + int ToCompatibilityFocusType(SpatialNavigationDirection direction); // Entry-point into SpatialNavigation advancement. Will return true if an // action (moving interest or scrolling), false otherwise. bool Advance(SpatialNavigationDirection direction); diff --git a/third_party/blink/renderer/platform/widget/widget_base.cc b/third_party/blink/renderer/platform/widget/widget_base.cc index 5cd531a..d1446fe 100644 --- a/third_party/blink/renderer/platform/widget/widget_base.cc +++ b/third_party/blink/renderer/platform/widget/widget_base.cc @@ -1169,6 +1169,10 @@ void WidgetBase::DidEdgeScrollBy(const gfx::Point& offset, bool handled) { widget_host_->DidEdgeScrollBy(offset, handled); } +void WidgetBase::MoveFocusToBrowser(int direction) { + widget_host_->MoveFocusToBrowser(direction); +} + void WidgetBase::NotifyTrackInfoToBrowser(int active_track_id, const std::string& url, const std::string& lang) { diff --git a/third_party/blink/renderer/platform/widget/widget_base.h b/third_party/blink/renderer/platform/widget/widget_base.h index d385fc7..b260337 100644 --- a/third_party/blink/renderer/platform/widget/widget_base.h +++ b/third_party/blink/renderer/platform/widget/widget_base.h @@ -266,6 +266,7 @@ class PLATFORM_EXPORT WidgetBase : public mojom::blink::Widget, #if BUILDFLAG(IS_TIZEN_TV) //Browser edge scroll void DidEdgeScrollBy(const gfx::Point& offset, bool handled); + void MoveFocusToBrowser(int direction); void NotifyTrackInfoToBrowser(int active_track_id, const std::string& url, const std::string& lang); diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.cc index c9ad3a8..e9192bc 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.cc @@ -451,6 +451,11 @@ void RWHVAuraCommonHelperEfl::DidEdgeScrollBy(const gfx::Point& offset, web_contents_->GetDelegate()->DidEdgeScrollBy(offset, handled); } +void RWHVAuraCommonHelperEfl::MoveFocusToBrowser(int direction) { + if (web_contents_) + web_contents_->GetDelegate()->MoveFocusToBrowser(direction); +} + void RWHVAuraCommonHelperEfl::SetParentalRatingResult(const std::string& url, bool is_pass) { if (rwhv_aura_) diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h index d79c7c2..1c1ad6b 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h @@ -137,6 +137,7 @@ class CONTENT_EXPORT RWHVAuraCommonHelperEfl { #if BUILDFLAG(IS_TIZEN_TV) //Browser edge scroll void DidEdgeScrollBy(const gfx::Point& offset, bool handled); + void MoveFocusToBrowser(int direction); void SetPopupMenuVisible(const bool visible); void SetPopupMenuBounds(const gfx::Rect& popup_bounds); void SetCursorByClient(bool enable) { cursor_set_by_client_ = enable; } diff --git a/tizen_src/ewk/efl_integration/eweb_view_callbacks.h b/tizen_src/ewk/efl_integration/eweb_view_callbacks.h index 9a0ac17..06ed6a5 100644 --- a/tizen_src/ewk/efl_integration/eweb_view_callbacks.h +++ b/tizen_src/ewk/efl_integration/eweb_view_callbacks.h @@ -170,6 +170,7 @@ enum CallbackType { NewWindowNavigationPolicyDecision, #endif // IS_TIZEN #if BUILDFLAG(IS_TIZEN_TV) + AtkKeyEventNotHandled, HoverOverLink, HoverOutLink, ParentalRatingInfo, @@ -369,6 +370,9 @@ DECLARE_EWK_VIEW_CALLBACK(NewWindowNavigationPolicyDecision, "policy,decision,ne #if BUILDFLAG(IS_TIZEN_TV) DECLARE_EWK_VIEW_CALLBACK(ParentalRatingInfo, "on,parentalrating,info", void*); +DECLARE_EWK_VIEW_CALLBACK(AtkKeyEventNotHandled, + "atk,keyevent,nothandled", + int*); DECLARE_EWK_VIEW_CALLBACK(HoverOverLink, "hover,over,link", const char*); DECLARE_EWK_VIEW_CALLBACK(HoverOutLink, "hover,out,link", const char*); DECLARE_EWK_VIEW_CALLBACK(LoginFormSubmitted, 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 6c4c6e3..7eb7f0f 100644 --- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc +++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc @@ -823,6 +823,13 @@ void WebContentsDelegateEfl::DidEdgeScrollBy(const gfx::Point& offset, web_view_->InvokeEdgeScrollByCallback(offset, handled); } +void WebContentsDelegateEfl::MoveFocusToBrowser(int direction) { + if (web_view_) { + web_view_->SmartCallback().call( + &direction); + } +} + void WebContentsDelegateEfl::WillDraw(int new_rotation, gfx::Size frame_data_output_size) { if (web_view_) { diff --git a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h index 5dc1bd5..4e1b834 100644 --- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h +++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h @@ -77,6 +77,7 @@ class WebContentsDelegateEfl : public WebContentsDelegate { #if BUILDFLAG(IS_TIZEN_TV) //Browser edge scroll void DidEdgeScrollBy(const gfx::Point& offset, bool handled) override; + void MoveFocusToBrowser(int direction) override; void NotifyDownloadableFontInfo(const std::string& scheme_id_uri, const std::string& value, const std::string& data, -- 2.7.4