From 1e81a38e934e34342be23bb43db9489aa11cb638 Mon Sep 17 00:00:00 2001 From: v-saha Date: Tue, 7 Feb 2023 10:55:22 +0530 Subject: [PATCH 01/16] [M108 Migration] Apply device scale factor Fix for web page incorrectly displayed on mobile by applying correct device scale factor. Reference: https://review.tizen.org/gerrit/274908 https://review.tizen.org/gerrit/275246 Change-Id: I2aa127a3d5577dcd74507d8fa9e705e88ccb04c8 Signed-off-by: v-saha --- content/browser/web_contents/web_contents_impl.cc | 3 ++ .../ui/display/device_display_info_efl.cc | 38 ++++++++++++++----- .../ui/display/device_display_info_efl.h | 4 +- .../ui/ozone/platform/efl/efl_screen.cc | 43 +++++++++++++++++++++- .../ui/ozone/platform/efl/efl_screen.h | 4 ++ .../ui/ozone/platform/efl/efl_window.cc | 2 + 6 files changed, 81 insertions(+), 13 deletions(-) diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index ec3d50f..106f6f1 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -9654,6 +9654,9 @@ void WebContentsImpl::CreateEflNativeView() { "main_layout"); GLSharedContextEfl::Initialize(root_window); + + auto* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(efl_native_view_)); + ui::EflScreen::UpdateDisplayInfo(ee); } void WebContentsImpl::SetSpatialNavigationEnabled(bool enabled) { diff --git a/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc b/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc index 9e4c91b..a39def2 100644 --- a/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc +++ b/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc @@ -62,7 +62,9 @@ class DISPLAY_EXPORT DeviceDisplayInfoEflImpl { public: static DeviceDisplayInfoEflImpl* GetInstance(); - void Update(int display_width, int display_height, double dip_scale, + bool Update(int display_width, + int display_height, + double dip_scale, int rotation_degrees); void SetRotationDegrees(int rotation_degrees); int GetDisplayWidth() const; @@ -97,13 +99,20 @@ DeviceDisplayInfoEflImpl* DeviceDisplayInfoEflImpl::GetInstance() { return base::Singleton::get(); } -void DeviceDisplayInfoEflImpl::Update(int display_width, int display_height, - double dip_scale, int rotation_degrees) { +bool DeviceDisplayInfoEflImpl::Update(int display_width, + int display_height, + double dip_scale, + int rotation_degrees) { + bool changed = false; { base::AutoLock autolock(display_info_accessor_); - display_width_ = display_width; - display_height_ = display_height; - dip_scale_ = dip_scale; + if (display_width_ != display_width || display_height_ != display_height || + dip_scale_ != dip_scale) { + changed = true; + display_width_ = display_width; + display_height_ = display_height; + dip_scale_ = dip_scale; + } DCHECK_NE(0, display_width_); DCHECK_NE(0, display_height_); @@ -112,11 +121,18 @@ void DeviceDisplayInfoEflImpl::Update(int display_width, int display_height, { base::AutoLock autolock(rotation_accessor_); - rotation_degrees_ = rotation_degrees; + if (rotation_degrees_ != rotation_degrees) { + changed = true; + rotation_degrees_ = rotation_degrees; + } DCHECK_NE(kInvalidRotationDegrees, rotation_degrees_); } + if (!changed) + return false; + NotifyDeviceDisplayInfoChanged(); + return true; } void DeviceDisplayInfoEflImpl::SetRotationDegrees(int rotation_degrees) { @@ -178,9 +194,11 @@ DeviceDisplayInfoEfl::DeviceDisplayInfoEfl() { DCHECK(DeviceDisplayInfoEflImpl::GetInstance()); } -void DeviceDisplayInfoEfl::Update(int display_width, int display_height, - double dip_scale, int rotation_degrees) { - DeviceDisplayInfoEflImpl::GetInstance()->Update( +bool DeviceDisplayInfoEfl::Update(int display_width, + int display_height, + double dip_scale, + int rotation_degrees) { + return DeviceDisplayInfoEflImpl::GetInstance()->Update( display_width, display_height, dip_scale, rotation_degrees); } diff --git a/tizen_src/chromium_impl/ui/display/device_display_info_efl.h b/tizen_src/chromium_impl/ui/display/device_display_info_efl.h index beb26c7..96359f0 100644 --- a/tizen_src/chromium_impl/ui/display/device_display_info_efl.h +++ b/tizen_src/chromium_impl/ui/display/device_display_info_efl.h @@ -22,7 +22,9 @@ class DISPLAY_EXPORT DeviceDisplayInfoEfl { DeviceDisplayInfoEfl& operator=(const DeviceDisplayInfoEfl&) = delete; // Update all info. - void Update(int display_width, int display_height, double dip_scale, + bool Update(int display_width, + int display_height, + double dip_scale, int rotation_degrees); // Sets rotation degrees. Expected values are one of { 0, 90, 180, 270 }. 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 f6aed36..fde4853 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 @@ -4,10 +4,13 @@ #include "ui/ozone/platform/efl/efl_screen.h" +#include + #include "base/logging.h" #include "base/stl_util.h" #include "ecore_wrapper/ecore_x_wayland_wrapper.h" #include "tizen/system_info.h" +#include "ui/display/device_display_info_efl.h" #include "ui/display/display.h" #include "ui/display/display_finder.h" #include "ui/display/display_observer.h" @@ -16,6 +19,14 @@ namespace ui { +namespace { + +const int kDisplayId = 0; + +std::vector screen_list; + +} // namespace + EflScreen::EflScreen() { int width = 0, height = 0; #if defined(USE_WAYLAND) @@ -24,12 +35,40 @@ EflScreen::EflScreen() { #else ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height); #endif - display::Display display(0); + display::Display display(kDisplayId); display.set_bounds(gfx::Rect(width, height)); display_list_.AddDisplay(display, display::DisplayList::Type::PRIMARY); + + screen_list.push_back(this); } -EflScreen::~EflScreen() = default; +EflScreen::~EflScreen() { + screen_list.erase(std::remove(screen_list.begin(), screen_list.end(), this)); +} + +// static +void EflScreen::UpdateDisplayInfo(Ecore_Evas* ee) { + int width = 0, height = 0, dpi = 0; + ecore_evas_screen_geometry_get(ee, nullptr, nullptr, &width, &height); + ecore_evas_screen_dpi_get(ee, &dpi, nullptr); + + display::DeviceDisplayInfoEfl display_info; + const float device_scale_factor = + display::Display::HasForceDeviceScaleFactor() + ? display::Display::GetForcedDeviceScaleFactor() + : display_info.ComputeDIPScale(dpi); + int rotation = ecore_evas_rotation_get(ee); + if (!display_info.Update(width, height, device_scale_factor, rotation)) + return; + + display::Display display(kDisplayId); + display.set_bounds(gfx::Rect(width, height)); + display.SetRotationAsDegree(rotation); + display.set_device_scale_factor(device_scale_factor); + + for (auto* screen : screen_list) + screen->display_list_.UpdateDisplay(display); +} const std::vector& EflScreen::GetAllDisplays() const { return display_list_.displays(); 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 ebfabd7..4c06614 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 @@ -13,6 +13,8 @@ #include "ui/gfx/geometry/point.h" #include "ui/ozone/public/platform_screen.h" +typedef struct _Ecore_Evas Ecore_Evas; + namespace ui { // A PlatformScreen implementation for EFL. @@ -25,6 +27,8 @@ class EflScreen : public PlatformScreen { ~EflScreen() override; + static void UpdateDisplayInfo(Ecore_Evas* ee); + // PlatformScreen overrides: const std::vector& GetAllDisplays() const override; display::Display GetPrimaryDisplay() const override; 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 4b94f31..5db5cb9 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 @@ -316,6 +316,8 @@ void EflWindow::Initialize(const PlatformWindowInitProperties& properties) { #if BUILDFLAG(IS_TIZEN_TV) CreateMouseCursor(); #endif + + EflScreen::UpdateDisplayInfo(ee_); } #if BUILDFLAG(IS_TIZEN_TV) -- 2.7.4 From 2540e206b50ea0d36afb6639d77d86dd7e761ffc Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 10 Feb 2023 08:42:20 +0530 Subject: [PATCH 02/16] [M108 Migration][NativeControl] Select Picker This CL 1. Includes changes required for select picker feature and its refactoring. 2. Fixes Backward/Foward buttons in SelectPicker TC. 3. Makes changes to handle popup resize in a better way. 4. Segregates SelectPicker into ewk independant base classes 5. Removes Listbox rendering for Multiple Select for TV Reference: https://review.tizen.org/gerrit/280120/ https://review.tizen.org/gerrit/280208/ https://review.tizen.org/gerrit/280225/ https://review.tizen.org/gerrit/280633/ https://review.tizen.org/gerrit/281109/ Change-Id: I104484fe74197e104537c01f53b57dc9e65546e3 Signed-off-by: Ayush Kumar --- third_party/blink/public/web/web_view.h | 29 + .../blink/renderer/core/exported/web_view_impl.cc | 236 +++ .../blink/renderer/core/exported/web_view_impl.h | 35 + .../core/html/forms/external_popup_menu.cc | 6 + .../chromium_impl/content/browser/browser_efl.gni | 10 + .../browser/select_picker/form_navigable_picker.cc | 207 +++ .../browser/select_picker/form_navigable_picker.h | 73 + .../browser/select_picker/select_picker_base.cc | 231 +++ .../browser/select_picker/select_picker_base.h | 78 + .../select_picker/select_picker_mobile_base.cc | 164 ++ .../select_picker/select_picker_mobile_base.h | 39 + .../browser/select_picker/select_picker_tv_base.cc | 55 + .../browser/select_picker/select_picker_tv_base.h | 31 + .../browser/select_picker/select_picker_util.cc | 62 + .../browser/select_picker/select_picker_util.h | 43 + .../core/layout/layout_theme_chromium_tizen.cc | 2 +- tizen_src/ewk/efl_integration/BUILD.gn | 9 +- .../browser/select_picker/select_picker_mobile.cc | 45 + .../browser/select_picker/select_picker_mobile.h | 34 + .../browser/select_picker/select_picker_tv.cc | 49 + .../browser/select_picker/select_picker_tv.h | 34 + .../browser/selectpicker/popup_menu_item.cc | 77 - .../browser/selectpicker/popup_menu_item.h | 144 -- .../browser/selectpicker/popup_menu_item_private.h | 35 - .../browser/selectpicker/popup_picker.cc | 492 ------ .../browser/selectpicker/popup_picker.h | 68 - .../browser/web_view_browser_message_filter.cc | 11 + tizen_src/ewk/efl_integration/eweb_view.cc | 249 +-- tizen_src/ewk/efl_integration/eweb_view.h | 31 +- .../renderer/render_frame_observer_efl.cc | 42 +- .../renderer/render_frame_observer_efl.h | 3 - tizen_src/ewk/efl_integration/resource/BUILD.gn | 9 +- tizen_src/ewk/efl_integration/resource/control.edc | 9 +- .../ewk/efl_integration/resource/controlTV.edc | 1833 ++++++++++++++++++++ .../resource/images/highlight_stroke.png | Bin 0 -> 1134 bytes .../resource/images/obe_list_scroll_down.png | Bin 0 -> 3183 bytes .../resource/images/obe_list_scroll_down_f.png | Bin 0 -> 3186 bytes .../resource/images/obe_list_scroll_up.png | Bin 0 -> 3198 bytes .../resource/images/obe_list_scroll_up_f.png | Bin 0 -> 3200 bytes .../web_contents_efl_delegate_ewk.cc | 2 +- .../efl_integration/web_contents_observer_efl.cc | 7 +- 41 files changed, 3407 insertions(+), 1077 deletions(-) create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.h create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc create mode 100644 tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h create mode 100644 tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc create mode 100644 tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h create mode 100644 tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc create mode 100644 tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.cc delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.h delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item_private.h delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.cc delete mode 100644 tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.h create mode 100644 tizen_src/ewk/efl_integration/resource/controlTV.edc create mode 100644 tizen_src/ewk/efl_integration/resource/images/highlight_stroke.png create mode 100644 tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down.png create mode 100644 tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down_f.png create mode 100644 tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up.png create mode 100644 tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up_f.png diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h index 91135d7..f8ad0aa 100644 --- a/third_party/blink/public/web/web_view.h +++ b/third_party/blink/public/web/web_view.h @@ -366,6 +366,20 @@ class BLINK_EXPORT WebView { virtual void SetDeviceColorSpaceForTesting( const gfx::ColorSpace& color_space) = 0; +#if BUILDFLAG(IS_EFL) + enum class TraverseFocusThrough : char { + EditableElement = 1 << 0, + SelectElement = 1 << 1, + EditableAndSelectElements = EditableElement | SelectElement + }; + virtual bool MoveFocusToPrevious( + TraverseFocusThrough = + TraverseFocusThrough::EditableAndSelectElements) = 0; + virtual bool MoveFocusToNext( + TraverseFocusThrough = + TraverseFocusThrough::EditableAndSelectElements) = 0; +#endif + // Scheduling ----------------------------------------------------------- virtual PageScheduler* Scheduler() const = 0; @@ -498,4 +512,19 @@ class BLINK_EXPORT WebView { } // namespace blink +#if BUILDFLAG(IS_EFL) +static inline blink::WebView::TraverseFocusThrough operator|( + blink::WebView::TraverseFocusThrough a, + blink::WebView::TraverseFocusThrough b) { + return static_cast( + static_cast(a) | static_cast(b)); +} +static inline blink::WebView::TraverseFocusThrough operator&( + blink::WebView::TraverseFocusThrough a, + blink::WebView::TraverseFocusThrough b) { + return static_cast( + static_cast(a) & static_cast(b)); +} +#endif + #endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_VIEW_H_ 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 ab133fb..dc80bce 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -196,7 +196,11 @@ #if BUILDFLAG(IS_EFL) #include "third_party/blink/renderer/core/dom/container_node.h" +#include "third_party/blink/renderer/core/dom/parent_node.h" #include "third_party/blink/renderer/core/dom/static_node_list.h" +#include "third_party/blink/renderer/core/html/forms/html_form_element.h" +#include "third_party/blink/renderer/core/html/forms/html_input_element.h" +#include "third_party/blink/renderer/core/html/forms/html_select_element.h" #endif #if BUILDFLAG(IS_TIZEN) @@ -4021,6 +4025,238 @@ void WebViewImpl::ScrollFocusedNodeIntoView() { if (Element* element = FocusedElement()) element->scrollIntoViewIfNeeded(true /*centerIfNeeded*/); } + +bool WebViewImpl::FiltersInSelectElement(WebView::TraverseFocusThrough filter) { + return static_cast((char)filter & + (char)WebView::TraverseFocusThrough::SelectElement); +} + +bool WebViewImpl::FiltersInEditableElement( + WebView::TraverseFocusThrough filter) { + return static_cast( + (char)filter & (char)WebView::TraverseFocusThrough::EditableElement); +} + +bool WebViewImpl::IsFormNavigationTextInput(Element& element) const { + if (element.HasTagName(html_names::kInputTag) && + DynamicTo(element)->IsReadOnly()) { + return false; + } + + LayoutObject* renderer = element.GetLayoutObject(); + return renderer && + (IsEditable(element) || renderer->IsTextControlIncludingNG()); +} + +bool WebViewImpl::IsSelectElement(const Element& element) const { + return element.GetLayoutObject() && + element.HasTagName(html_names::kSelectTag); +} + +gfx::Rect WebViewImpl::GetElementBounds(const Element& element) const { + element.GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kFocus); + gfx::Rect absolute_rect = ToPixelSnappedRect(element.Node::BoundingBox()); + return (element.GetDocument().View() + ? element.GetDocument().View()->FrameToViewport(absolute_rect) + : gfx::Rect()); +} + +bool WebViewImpl::PerformClickOnElement(Element& element) { + if (gfx::Rect() == GetElementBounds(element)) + return false; + + // Set focus to false to compare it with focusedElement of document. + element.Focus(); + + Element* focus_element = FocusedElement(); + + if (!focus_element || focus_element != &element) + return false; + + // SimulatedClickCreationScope::kFromAccessibility simulates MouseUpDown + // Events + focus_element->DispatchSimulatedClick( + nullptr, SimulatedClickCreationScope::kFromAccessibility); + + if (IsFormNavigationTextInput(*focus_element)) { + LocalFrame* focused_frame = DynamicTo(FocusedCoreFrame()); + WebTextInputInfo info = + focused_frame->GetInputMethodController().TextInputInfo(); + focused_frame->GetInputMethodController().SetEditableSelectionOffsets( + PlainTextRange(info.selection_start, info.selection_end)); + } + + return true; +} + +Element* WebViewImpl::NextTextOrSelectElement(Element* element, + TraverseFocusThrough filter) { + if (!element) + return 0; + + Element* next_element = element; + + if (next_element->IsFrameOwnerElement()) { + HTMLFrameOwnerElement& htmlFrameOwnerElement = + *DynamicTo(next_element); + + // Checks if the frame is empty or not. + if (!htmlFrameOwnerElement.ContentFrame()) + return 0; + + Document* owner_document = htmlFrameOwnerElement.contentDocument(); + if (!owner_document || !(next_element = owner_document->body())) + return 0; + + // Checks if content editable flag on body has set. + if (IsEditable(*next_element) && FiltersInEditableElement(filter)) + return next_element; + } + + while ((next_element = ElementTraversal::Next(*next_element))) { + if (next_element->HasTagName(html_names::kIFrameTag) || + next_element->HasTagName(html_names::kFrameTag)) { + Element* frame_owner_element = next_element; + + next_element = NextTextOrSelectElement(next_element, filter); + if (!next_element) { + next_element = frame_owner_element; + continue; + } + } + if (FiltersInSelectElement(filter) && IsSelectElement(*next_element)) + break; + } + + // If couldn't find anything in the current document scope, + // try finding in other document scope if present any. + if (!next_element) { + if (element->GetDocument().GetFrame() != MainFrameImpl()->GetFrame() && + !element->IsFrameOwnerElement()) { + next_element = NextTextOrSelectElement( + ElementTraversal::Next(*element->GetDocument().LocalOwner()), filter); + } + } + + return next_element; +} + +Element* WebViewImpl::PreviousTextOrSelectElement(Element* element, + TraverseFocusThrough filter) { + if (!element) + return 0; + + Element* previous_element = element; + + if (previous_element->IsFrameOwnerElement()) { + HTMLFrameOwnerElement& htmlFrameOwnerElement = + *DynamicTo(previous_element); + // Checks if the frame is empty or not. + if (!htmlFrameOwnerElement.ContentFrame()) + return 0; + + Document* owner_document = htmlFrameOwnerElement.contentDocument(); + if (!owner_document) + return 0; + + previous_element = ParentNode::lastElementChild(*owner_document); + while (previous_element && ElementTraversal::FirstWithin(*previous_element)) + previous_element = ParentNode::lastElementChild(*previous_element); + + if (!previous_element) + return 0; + + if (previous_element->IsFocusable()) { + if (FiltersInEditableElement(filter) && + IsFormNavigationTextInput(*previous_element)) + return previous_element; + if (FiltersInSelectElement(filter) && IsSelectElement(*previous_element)) + return previous_element; + } + } + + while ((previous_element = ElementTraversal::Previous(*previous_element))) { + if (previous_element->HasTagName(html_names::kIFrameTag) || + previous_element->HasTagName(html_names::kFrameTag)) { + Element* frame_owner_element = previous_element; + + previous_element = PreviousTextOrSelectElement(previous_element, filter); + if (!previous_element) { + previous_element = frame_owner_element; + continue; + } + } + + if (!previous_element->IsFocusable()) + continue; + + if (FiltersInEditableElement(filter) && + IsFormNavigationTextInput(*previous_element)) { + break; + } + + if (FiltersInSelectElement(filter) && IsSelectElement(*previous_element)) + break; + } + + // If couldn't find anything in the current document scope, + // try finding in other document scope if present any. + if (!previous_element && + element->GetDocument().GetFrame() != MainFrameImpl()->GetFrame() && + !element->IsFrameOwnerElement()) { + previous_element = PreviousTextOrSelectElement( + ElementTraversal::Previous(*element->GetDocument().LocalOwner()), + filter); + } + + return previous_element; +} + +bool WebViewImpl::MoveFocusToNext(TraverseFocusThrough filter) { + Element* focus_element = FocusedElement(); + if (!focus_element || (!IsFormNavigationTextInput(*focus_element) && + !IsSelectElement(*focus_element))) { + return false; + } + + Element* next_element = NextTextOrSelectElement(focus_element, filter); + if (!next_element) + return false; + + // Scroll the element into center of screen. + next_element->scrollIntoViewIfNeeded(true /*centerIfNeeded*/); + + bool handled = PerformClickOnElement(*next_element); + + if (FocusedFrame() && IsFormNavigationTextInput(*next_element)) + FocusedFrame()->ExecuteCommand(WebString::FromUTF8("MoveToEndOfDocument")); + + return handled; +} + +bool WebViewImpl::MoveFocusToPrevious(TraverseFocusThrough filter) { + Element* focus_element = FocusedElement(); + + if (!focus_element || (!IsFormNavigationTextInput(*focus_element) && + !IsSelectElement(*focus_element))) { + return false; + } + + Element* previous_element = + PreviousTextOrSelectElement(focus_element, filter); + if (!previous_element) + return false; + + // Scroll the element into center of screen. + previous_element->scrollIntoViewIfNeeded(true /*centerIfNeeded*/); + + bool handled = PerformClickOnElement(*previous_element); + + if (FocusedFrame() && IsFormNavigationTextInput(*previous_element)) + FocusedFrame()->ExecuteCommand(WebString::FromUTF8("MoveToEndOfDocument")); + + return handled; +} #endif #if defined(TIZEN_VIDEO_HOLE) diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h index 5c3d4a2..11556ab 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.h +++ b/third_party/blink/renderer/core/exported/web_view_impl.h @@ -151,6 +151,14 @@ class CORE_EXPORT WebViewImpl final : public WebView, void SetNoStatePrefetchClient(WebNoStatePrefetchClient*) override; WebSettings* GetSettings() override; WebString PageEncoding() const override; +#if BUILDFLAG(IS_EFL) + bool MoveFocusToNext( + TraverseFocusThrough = + TraverseFocusThrough::EditableAndSelectElements) override; + bool MoveFocusToPrevious( + TraverseFocusThrough = + TraverseFocusThrough::EditableAndSelectElements) override; +#endif void SetTabKeyCyclesThroughElements(bool value) override; bool IsActive() const override; void SetIsActive(bool value) override; @@ -410,6 +418,10 @@ class CORE_EXPORT WebViewImpl final : public WebView, void MainFrameLayoutUpdated(); void ResizeAfterLayout(); void DidCommitCompositorFrameForLocalMainFrame(); +#if BUILDFLAG(IS_EFL) + bool FiltersInSelectElement(WebView::TraverseFocusThrough filter); + bool FiltersInEditableElement(WebView::TraverseFocusThrough filter); +#endif void DidChangeContentsSize(); void PageScaleFactorChanged(); void OutermostMainFrameScrollOffsetChanged(); @@ -683,6 +695,17 @@ class CORE_EXPORT WebViewImpl final : public WebView, scheduler::WebAgentGroupScheduler& agent_group_scheduler, const SessionStorageNamespaceId& session_storage_namespace_id, absl::optional page_base_background_color); + +#if BUILDFLAG(IS_EFL) + enum FormInputAction { + FormInputNone = 0x00, + FormInputPrevText = 0x01, + FormInputPrevSelect = 0x02, + FormInputNextText = 0x04, + FormInputNextSelect = 0x08, + }; +#endif + ~WebViewImpl() override; void ConfigureAutoResizeMode(); @@ -911,6 +934,18 @@ class CORE_EXPORT WebViewImpl final : public WebView, web_pref::WebPreferences web_preferences_; blink::RendererPreferences renderer_preferences_; +#if BUILDFLAG(IS_EFL) + bool IsFormNavigationTextInput(Element&) const; + bool IsSelectElement(const Element&) const; + bool PerformClickOnElement(Element&); + Element* NextTextOrSelectElement( + Element*, + TraverseFocusThrough = TraverseFocusThrough::EditableAndSelectElements); + Element* PreviousTextOrSelectElement( + Element*, + TraverseFocusThrough = TraverseFocusThrough::EditableAndSelectElements); + gfx::Rect GetElementBounds(const Element&) const; +#endif // The local root whose document has |popup_mouse_wheel_event_listener_| // registered. diff --git a/third_party/blink/renderer/core/html/forms/external_popup_menu.cc b/third_party/blink/renderer/core/html/forms/external_popup_menu.cc index e28ce00..d953952 100644 --- a/third_party/blink/renderer/core/html/forms/external_popup_menu.cc +++ b/third_party/blink/renderer/core/html/forms/external_popup_menu.cc @@ -252,7 +252,13 @@ void ExternalPopupMenu::DidAcceptIndices(const Vector& indices) { list_indices.push_back(ToPopupMenuItemIndex(indices[i], *owner_element)); owner_element->SelectMultipleOptionsByPopup(list_indices); } + +#if !BUILDFLAG(IS_EFL) + // Reset disconnects popup_client which will hide the popup menu. + // Which is not the expected behavior for EFL port after choosing a item in + // select menu. Reset(); +#endif } void ExternalPopupMenu::DidCancel() { diff --git a/tizen_src/chromium_impl/content/browser/browser_efl.gni b/tizen_src/chromium_impl/content/browser/browser_efl.gni index 3c93549..5532b96 100644 --- a/tizen_src/chromium_impl/content/browser/browser_efl.gni +++ b/tizen_src/chromium_impl/content/browser/browser_efl.gni @@ -99,6 +99,16 @@ external_content_browser_efl_sources = [ "//tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.h", "//tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.cc", "//tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.h", + "//tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.h", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc", + "//tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h", "//tizen_src/chromium_impl/content/browser/tracing/tracing_controller_efl.cc", "//tizen_src/chromium_impl/content/browser/tracing/tracing_controller_efl.h", "//tizen_src/chromium_impl/content/browser/web_contents/web_contents_impl_efl.cc", diff --git a/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc b/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc new file mode 100644 index 0000000..2d3d543 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc @@ -0,0 +1,207 @@ +// Copyright 2016 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 "content/browser/select_picker/form_navigable_picker.h" + +#include "base/files/file_path.h" +#include "base/path_service.h" +#include "content/browser/renderer_host/render_frame_host_impl.h" +#include "content/common/paths_efl.h" +#include "tizen_src/ewk/efl_integration/common/web_contents_utils.h" + +#if BUILDFLAG(IS_TIZEN) +#include +#endif + +namespace { +const char* const kMouseClicked1 = "mouse,clicked,1"; +const char* const kImagePrevBgObj = "elm.image.prev_bg"; +const char* const kImageNextBgObj = "elm.image.next_bg"; +const char* const kImageDoneBgObj = "elm.image.done_bg"; +const char* const kDimmObj = "dimm"; +} // namespace + +FormNavigablePicker::FormNavigablePicker(Evas_Object* evas_object, + int selected_index, + bool is_multi_select) + : SelectPickerBase(evas_object, selected_index, is_multi_select), + form_navigator_info_{0, 0, true, true} { + ecore_events_filter_ = + ecore_event_filter_add(nullptr, EcoreEventFilterCallback, nullptr, this); + if (!ecore_events_filter_) + LOG(ERROR) << "Unable to create ecore events filter"; +} + +void FormNavigablePicker::RegisterCallbacks() { + auto edje_obj = elm_layout_edje_get(layout_); + edje_object_signal_callback_add(edje_obj, kMouseClicked1, kImagePrevBgObj, + NavigateToPrevCallback, this); + edje_object_signal_callback_add(edje_obj, kMouseClicked1, kImageNextBgObj, + NavigateToNextCallback, this); + edje_object_signal_callback_add(edje_obj, kMouseClicked1, kImageDoneBgObj, + ListClosedCallback, this); + edje_object_signal_callback_add(edje_obj, kMouseClicked1, kDimmObj, + ListClosedCallback, this); +#if BUILDFLAG(IS_TIZEN) + eext_object_event_callback_add(layout_, EEXT_CALLBACK_BACK, HWBackKeyCallback, + this); +#endif + evas_object_event_callback_add(evas_object_, EVAS_CALLBACK_KEY_UP, + KeyUpCallback, this); + evas_object_propagate_events_set(layout_, false); +} + +void FormNavigablePicker::UnregisterCallbacks() { + auto edje_obj = elm_layout_edje_get(layout_); + edje_object_signal_callback_del(edje_obj, kMouseClicked1, kImagePrevBgObj, + NavigateToPrevCallback); + edje_object_signal_callback_del(edje_obj, kMouseClicked1, kImageNextBgObj, + NavigateToNextCallback); + edje_object_signal_callback_del(edje_obj, kMouseClicked1, kImageDoneBgObj, + ListClosedCallback); + edje_object_signal_callback_del(edje_obj, kMouseClicked1, kDimmObj, + ListClosedCallback); +#if defined(OS_TIZEN) + eext_object_event_callback_del(layout_, EEXT_CALLBACK_BACK, + HWBackKeyCallback); +#endif + evas_object_event_callback_del(evas_object_, EVAS_CALLBACK_KEY_UP, + KeyUpCallback); + if (ecore_events_filter_) + ecore_event_filter_del(ecore_events_filter_); +} + +void FormNavigablePicker::ShowButtons() { + auto edje_obj = elm_layout_edje_get(layout_); + edje_object_signal_emit(edje_obj, "show,prev_button,signal", ""); + edje_object_signal_emit(edje_obj, "show,next_button,signal", ""); + edje_object_signal_emit(edje_obj, "show,picker,signal", ""); +} + +void FormNavigablePicker::UpdateFormNavigation(int form_element_count, + int current_node_index) { + form_navigator_info_ = {form_element_count, current_node_index}; + UpdateNavigationButtons(); +} + +void FormNavigablePicker::UpdateNavigationButtons() { + auto edje_obj = elm_layout_edje_get(layout_); + if (form_navigator_info_.index > 0 && !form_navigator_info_.is_prev) { + edje_object_signal_emit(edje_obj, "enable,prev_button,signal", ""); + form_navigator_info_.is_prev = true; + } else if (form_navigator_info_.index == 0) { + edje_object_signal_emit(edje_obj, "disable,prev_button,signal", ""); + form_navigator_info_.is_prev = false; + } + if (form_navigator_info_.index < form_navigator_info_.count - 1 && + !form_navigator_info_.is_next) { + edje_object_signal_emit(edje_obj, "enable,next_button,signal", ""); + form_navigator_info_.is_next = true; + } else if (form_navigator_info_.index == form_navigator_info_.count - 1) { + edje_object_signal_emit(edje_obj, "disable,next_button,signal", ""); + form_navigator_info_.is_next = false; + } +} + +void FormNavigablePicker::RegisterCallbacks(const char* edj, bool overlay) { + base::FilePath edj_dir; + base::FilePath control_edj; + base::PathService::Get(PathsEfl::EDJE_RESOURCE_DIR, &edj_dir); + control_edj = edj_dir.Append(FILE_PATH_LITERAL(edj)); + if (!elm_layout_file_set(layout_, control_edj.AsUTF8Unsafe().c_str(), + "elm/picker")) { + LOG(ERROR) << "error elm_layout_file_set, " << edj; + } else { + if (overlay) + elm_theme_overlay_add(nullptr, control_edj.AsUTF8Unsafe().c_str()); + RegisterCallbacks(); + } + ShowButtons(); +} + +Evas_Object* FormNavigablePicker::AddBackground() { + Evas_Object* bg = elm_bg_add(layout_); + elm_object_part_content_set(layout_, "bg", bg); + return bg; +} + +void FormNavigablePicker::AddDoneButton() { + edje_object_part_text_set(elm_layout_edje_get(layout_), "elm.text.done", + "Done"); +} + +void FormNavigablePicker::UpdatePickerData( + int selected_index, + std::vector items, + bool is_multiple_selection) { + RequestFormNavigationInformation(); + SelectPickerBase::UpdatePickerData(selected_index, std::move(items), + is_multiple_selection); +} + +void FormNavigablePicker::NavigateToNextCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source) { + auto picker = static_cast(data); + picker->FormNavigate(true); +} + +void FormNavigablePicker::NavigateToPrevCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source) { + auto picker = static_cast(data); + picker->FormNavigate(false); +} + +void FormNavigablePicker::KeyUpCallback(void* data, + Evas* e, + Evas_Object* obj, + void* event_info) { + auto key_struct = static_cast(event_info); + if (!web_contents_utils::MapsToHWBackKey(key_struct->keyname)) + return; +#if BUILDFLAG(IS_TIZEN) + HWBackKeyCallback(data, obj, event_info); +#endif +} + +#if BUILDFLAG(IS_TIZEN) +void FormNavigablePicker::HWBackKeyCallback(void* data, + Evas_Object* obj, + void* event_info) { + ListClosedCallback(data, obj, 0, 0); +} +#endif + +void FormNavigablePicker::ListClosedCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source) { + auto picker = static_cast(data); + if (picker->is_multiple_selection_) + picker->DidMultipleSelectPopupMenuItem(); + else + picker->DidSelectPopupMenuItem(); + picker->HidePopupMenu(); +} + +Eina_Bool FormNavigablePicker::EcoreEventFilterCallback(void* user_data, + void* /*loop_data*/, + int type, + void* event) { + auto picker = static_cast(user_data); + if (type == ECORE_EVENT_KEY_DOWN && picker->IsVisible()) { + std::string key_name = static_cast(event)->keyname; + if (!key_name.compare("Up") || !key_name.compare("Left")) { + picker->FormNavigate(false); + return ECORE_CALLBACK_CANCEL; + } else if (!key_name.compare("Right") || !key_name.compare("Down")) { + picker->FormNavigate(true); + return ECORE_CALLBACK_CANCEL; + } + } + return ECORE_CALLBACK_PASS_ON; +} diff --git a/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h b/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h new file mode 100644 index 0000000..983db71 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h @@ -0,0 +1,73 @@ +// Copyright 2016 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_SELECT_PICKER_FORM_NAVIGABLE_PICKER_H_ +#define CONTENT_BROWSER_SELECT_PICKER_FORM_NAVIGABLE_PICKER_H_ + +#include "content/browser/select_picker/select_picker_base.h" + +class FormNavigablePicker : public SelectPickerBase { + public: + virtual ~FormNavigablePicker() override {} + + FormNavigablePicker(const FormNavigablePicker&) = delete; + FormNavigablePicker& operator=(const FormNavigablePicker&) = delete; + + void UpdateFormNavigation(int form_element_count, + int current_node_index) override; + void UpdatePickerData(int selected_index, + std::vector items, + bool is_multiple_selection) override; + + protected: + explicit FormNavigablePicker(Evas_Object* evas_object, + int selected_index, + bool is_multi_select); + void RegisterCallbacks(const char* edj, bool overlay); + void RegisterCallbacks(); + void UnregisterCallbacks(); + Evas_Object* AddBackground(); + void AddDoneButton(); + void ShowButtons(); + + virtual void FormNavigate(bool direction) = 0; + virtual void RequestFormNavigationInformation() = 0; + virtual void HidePopupMenu() = 0; + + private: + void UpdateNavigationButtons(); + static void KeyUpCallback(void* data, + Evas* e, + Evas_Object* obj, + void* event_info); +#if BUILDFLAG(IS_TIZEN) + static void HWBackKeyCallback(void* data, Evas_Object* obj, void* event_info); +#endif + static void ListClosedCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source); + static void NavigateToPrevCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source); + static void NavigateToNextCallback(void* data, + Evas_Object* obj, + const char* emission, + const char* source); + static Eina_Bool EcoreEventFilterCallback(void* data, + void* loop_data, + int type, + void* event); + + Ecore_Event_Filter* ecore_events_filter_; + struct FormNavigatorInfo { + int count; + int index; + bool is_prev; + bool is_next; + } form_navigator_info_; +}; + +#endif // CONTENT_BROWSER_SELECT_PICKER_FORM_NAVIGABLE_PICKER_H_ diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc new file mode 100644 index 0000000..a4668c7 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc @@ -0,0 +1,231 @@ +// Copyright 2016 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 "content/browser/select_picker/select_picker_base.h" + +#include "base/strings/utf_string_conversions.h" +#include "content/browser/select_picker/select_picker_util.h" +#include "content/browser/web_contents/web_contents_view_aura.h" + +namespace { + +const char* const kSelectedCbName = "selected"; +const char* const kUnselectedCbName = "unselected"; +const char* const kElmText = "elm.text"; + +template +void InsertSorted(std::vector& vec, const T value) { + vec.insert(std::upper_bound(vec.begin(), vec.end(), value), value); +} + +template +size_t SearchValue(const std::vector& vec, const T value) { + auto it = find(vec.begin(), vec.end(), value); + if (it == vec.end()) + return std::string::npos; + return std::distance(vec.begin(), it); +} + +template +void RemoveValue(std::vector& vec, const T value) { + vec.erase(std::remove(vec.begin(), vec.end(), value), vec.end()); +} + +char* LabelGetCallback(void* data, Evas_Object* obj, const char* part) { + auto callback_data = static_cast(data); + if (!strncmp(part, kElmText, strlen(kElmText))) + return elm_entry_utf8_to_markup((callback_data->GetLabel()).c_str()); + return nullptr; +} +} // namespace + +SelectPickerBase::SelectPickerBase(Evas_Object* evas_object, + int selected_index, + bool is_multiple_selection) + : evas_object_(evas_object), + popup_list_(nullptr), + selected_index_(selected_index), + is_multiple_selection_(is_multiple_selection) { + window_ = + elm_object_top_widget_get(elm_object_parent_widget_get(evas_object_)); + layout_ = elm_layout_add(window_); +} + +SelectPickerBase::~SelectPickerBase() { + DestroyPopupList(); + elm_genlist_item_class_free(group_class_); + elm_genlist_item_class_free(item_class_); + evas_object_del(layout_); +} + +void SelectPickerBase::InitializeItemClass() { + item_class_ = elm_genlist_item_class_new(); + item_class_->item_style = GetItemStyle(); + item_class_->func.text_get = LabelGetCallback; + item_class_->func.content_get = nullptr; + item_class_->func.state_get = nullptr; + item_class_->func.del = nullptr; +} + +void SelectPickerBase::InitializeGroupClass() { + group_class_ = elm_genlist_item_class_new(); + group_class_->item_style = "group_index"; + group_class_->func.text_get = LabelGetCallback; + group_class_->func.content_get = nullptr; + group_class_->func.state_get = nullptr; + group_class_->func.del = nullptr; +} + +const char* SelectPickerBase::GetItemStyle() const { + return "default"; +} + +void SelectPickerBase::UpdatePickerData( + int selected_index, + std::vector items, + bool is_multiple_selection) { + ClearData(); + selected_index_ = selected_index; + is_multiple_selection_ = is_multiple_selection; + CreateAndPopulatePopupList(std::move(items)); +} + +gfx::Rect SelectPickerBase::GetGeometryDIP() const { + return gfx::Rect(); +} + +void SelectPickerBase::DestroyPopupList() { + if (popup_list_) { + if (is_multiple_selection_) { + evas_object_smart_callback_del(popup_list_, kSelectedCbName, + MenuItemActivatedCallback); + evas_object_smart_callback_del(popup_list_, kUnselectedCbName, + MenuItemDeactivatedCallback); + } + elm_genlist_clear(popup_list_); + evas_object_del(popup_list_); + } + for (const auto& item : select_picker_data_) + delete item; +} + +void SelectPickerBase::ClearData() { + DestroyPopupList(); + select_picker_data_.clear(); + selected_indexes_.clear(); +} + +void SelectPickerBase::ItemSelectedCallback(void* data, + Evas_Object* obj, + void* event_info) { + auto callback_data = static_cast(data); + callback_data->GetSelectPicker()->ItemSelected(callback_data, event_info); +} + +void SelectPickerBase::ItemSelected(GenlistCallbackData* data, + void* event_info) { + if (data->IsEnabled()) { + selected_index_ = data->GetIndex(); + DidSelectPopupMenuItem(); + } +} + +void SelectPickerBase::DidSelectPopupMenuItem() { + if (select_picker_data_.empty()) + return; + // When user select empty space then no index is selected, so selectedIndex + // value is -1. In that case we should call valueChanged() with -1 index. + // That in turn call popupDidHide() in didChangeSelectedIndex() for reseting + // the value of m_popupIsVisible in RenderMenuList. + if (selected_index_ != -1 && + selected_index_ >= static_cast(select_picker_data_.size())) + return; + // In order to reuse RenderFrameHostImpl::DidSelectPopupMenuItems() method + // in Android, put selectedIndex into std::vector. + std::vector selectedIndices; + selectedIndices.push_back(selected_index_); + if (wcva()) + wcva()->wcva_helper()->DidSelectPopupMenuItems(selectedIndices); +} + +void SelectPickerBase::MenuItemActivatedCallback(void* data, + Evas_Object* obj, + void* event_info) { + auto picker = static_cast(data); + auto selected = static_cast(event_info); + // Subtract 1 from value returned by elm_genlist_item_index_get + // to match webkit expectation (index starting from 0). + int index = elm_genlist_item_index_get(selected) - 1; + if (picker->is_multiple_selection_) { + size_t pos = SearchValue(picker->selected_indexes_, index); + if (pos == std::string::npos) + InsertSorted(picker->selected_indexes_, index); + else + RemoveValue(picker->selected_indexes_, index); + } + picker->DidMultipleSelectPopupMenuItem(); +} + +void SelectPickerBase::MenuItemDeactivatedCallback(void* data, + Evas_Object* obj, + void* event_info) { + auto picker = static_cast(data); + auto deselectedItem = static_cast(event_info); + // Subtract 1 from value returned by elm_genlist_item_index_get + // to match webkit expectation (index starting from 0). + int deselectedIndex = elm_genlist_item_index_get(deselectedItem) - 1; + size_t pos = SearchValue(picker->selected_indexes_, deselectedIndex); + if (pos == std::string::npos) + InsertSorted(picker->selected_indexes_, deselectedIndex); + else + RemoveValue(picker->selected_indexes_, deselectedIndex); + picker->DidMultipleSelectPopupMenuItem(); +} + +void SelectPickerBase::DidMultipleSelectPopupMenuItem() { + if (!wcva() || select_picker_data_.empty()) + return; + wcva()->wcva_helper()->DidSelectPopupMenuItems(selected_indexes_); +} + +void SelectPickerBase::InitializeSelectedPickerData( + std::vector items) { + bool need_scroll_to_top = true; + for (size_t index = 0; index < items.size(); index++) { + bool checked = items[index]->checked; + auto data = new GenlistCallbackData( + index, this, std::move(items[index]), popup_list_, item_class_, + group_class_, is_multiple_selection_, ItemSelectedCallback); + + if (is_multiple_selection_ && checked) { + selected_indexes_.push_back(index); + if (need_scroll_to_top) { + data->ScrollToTop(); + need_scroll_to_top = false; + } + } + select_picker_data_.push_back(data); + } + + if (is_multiple_selection_) { + evas_object_smart_callback_add(popup_list_, kSelectedCbName, + MenuItemActivatedCallback, this); + evas_object_smart_callback_add(popup_list_, kUnselectedCbName, + MenuItemDeactivatedCallback, this); + } else if (selected_index_ >= 0) { + select_picker_data_[selected_index_]->ScrollToTop(); + } +} + +void SelectPickerBase::Show() { + evas_object_show(layout_); +} + +void SelectPickerBase::Hide() { + evas_object_hide(layout_); +} + +bool SelectPickerBase::IsVisible() const { + return evas_object_visible_get(layout_); +} diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h new file mode 100644 index 0000000..95d62a6 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h @@ -0,0 +1,78 @@ +// Copyright 2016 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_BASE_H_ +#define CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_BASE_H_ + +#include +#include + +#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h" +#include "ui/gfx/geometry/rect.h" + +class GenlistCallbackData; + +namespace content { +class WebContentsViewAura; +} + +class SelectPickerBase { + public: + virtual ~SelectPickerBase(); + + SelectPickerBase(const SelectPickerBase&) = delete; + SelectPickerBase& operator=(const SelectPickerBase&) = delete; + + virtual void UpdateFormNavigation(int form_element_count, + int current_node_index) {} + virtual void UpdatePickerData(int selected_index, + std::vector items, + bool is_multiple_selection); + virtual gfx::Rect GetGeometryDIP() const; + + void Show(); + void Hide(); + bool IsVisible() const; + void InitializeItemClass(); + void InitializeGroupClass(); + virtual void Init(std::vector items, + const gfx::Rect& bounds) = 0; + + protected: + explicit SelectPickerBase(Evas_Object* evas_object, + int selected_index, + bool is_multiple_selection); + virtual const char* GetItemStyle() const; + virtual void ClearData(); + virtual void CreateAndPopulatePopupList( + std::vector items) = 0; + virtual void ItemSelected(GenlistCallbackData* data, void* event_info); + void InitializeSelectedPickerData( + std::vector items); + void DidSelectPopupMenuItem(); + void DidMultipleSelectPopupMenuItem(); + + virtual content::WebContentsViewAura* wcva() const { return nullptr; } + + Evas_Object* evas_object_; + Evas_Object* popup_list_; + Evas_Object* layout_; + Evas_Object* window_; + int selected_index_; + bool is_multiple_selection_; + Elm_Genlist_Item_Class* item_class_; + + private: + static void ItemSelectedCallback(void*, Evas_Object*, void*); + static void MenuItemActivatedCallback(void*, Evas_Object*, void*); + static void MenuItemDeactivatedCallback(void*, Evas_Object*, void*); + + void DestroyPopupList(); + + Elm_Genlist_Item_Class* group_class_; + std::vector select_picker_data_; + std::vector selected_indexes_; +}; + +#endif // CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_BASE_H_ diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc new file mode 100644 index 0000000..55ae1ab --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc @@ -0,0 +1,164 @@ +// Copyright 2014-17 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 "content/browser/select_picker/select_picker_mobile_base.h" + +#include "content/browser/select_picker/select_picker_util.h" + +#include "tizen/system_info.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" +#include "ui/gfx/geometry/dip_util.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/rect_conversions.h" + +namespace { + +const char* const kChangedCbName = "changed"; + +void RadioIconChangedCallback(void* data, Evas_Object* obj, void* event_info) { + auto callback_data = static_cast(data); + callback_data->SetSelection(true); +} + +} // namespace + +SelectPickerMobileBase::SelectPickerMobileBase(Evas_Object* evas_object, + int selected_index, + bool is_multiple_selection) + : FormNavigablePicker(evas_object, selected_index, is_multiple_selection), + radio_main_(nullptr) { + evas_object_size_hint_weight_set(layout_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(window_, layout_); + evas_object_propagate_events_set(layout_, false); +} + +SelectPickerMobileBase::~SelectPickerMobileBase() { + Hide(); + DestroyRadioList(); +} + +void SelectPickerMobileBase::Init(std::vector items, + const gfx::Rect& bounds) { + // Request form navigation information as early as possible, + // given that is renderer will ping-back with actual requested data. + RequestFormNavigationInformation(); + + RegisterCallbacks("control.edj", false); + CreateAndPopulatePopupList(std::move(items)); + AddBackground(); + AddDoneButton(); + + // Need to update evas objects here in order to get proper geometry + // at AdjustViewPortHeightToPopupMenu. + evas_norender(evas_object_evas_get(window_)); +} + +void SelectPickerMobileBase::DestroyRadioList() { + if (!radio_main_) + return; + + if (is_multiple_selection_) + evas_object_smart_callback_del(popup_list_, kChangedCbName, + RadioIconChangedCallback); + elm_genlist_clear(radio_main_); + evas_object_del(radio_main_); +} + +void SelectPickerMobileBase::ClearData() { + DestroyRadioList(); + FormNavigablePicker::ClearData(); +} + +Evas_Object* SelectPickerMobileBase::IconGetCallback(void* data, + Evas_Object* obj, + const char* part) { + auto callback_data = static_cast(data); + auto picker = + static_cast(callback_data->GetSelectPicker()); + if (callback_data->IsEnabled() && !strcmp(part, "elm.swallow.end")) { + Evas_Object* radio = elm_radio_add(obj); + elm_object_focus_allow_set(radio, false); + elm_radio_state_value_set(radio, callback_data->GetIndex()); + elm_radio_group_add(radio, picker->radio_main_); + + evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_propagate_events_set(radio, EINA_FALSE); + + elm_radio_value_set(picker->radio_main_, picker->selected_index_); + evas_object_smart_callback_add(radio, kChangedCbName, + RadioIconChangedCallback, (void*)data); + return radio; + } + return nullptr; +} + +void SelectPickerMobileBase::ItemSelected(GenlistCallbackData* data, + void* event_info) { + // Efl highlights item by default. We only want radio button to be checked. + Evas_Object* radio_icon = elm_object_item_part_content_get( + (Elm_Object_Item*)event_info, "elm.swallow.end"); + data->SetSelection(false); + + if (data->IsEnabled()) { + elm_radio_value_set(radio_icon, data->GetIndex()); + selected_index_ = data->GetIndex(); + DidSelectPopupMenuItem(); + } +} + +void SelectPickerMobileBase::CreateAndPopulatePopupList( + std::vector items) { + popup_list_ = elm_genlist_add(layout_); + elm_genlist_mode_set(popup_list_, ELM_LIST_COMPRESS); + elm_object_style_set(popup_list_, "solid/default"); + evas_object_size_hint_weight_set(popup_list_, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(popup_list_, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_object_focus_allow_set(popup_list_, false); + + item_class_->func.content_get = + is_multiple_selection_ ? nullptr : IconGetCallback; + + elm_genlist_multi_select_set(popup_list_, is_multiple_selection_); + + if (!is_multiple_selection_) { + radio_main_ = elm_radio_add(popup_list_); + if (!radio_main_) { + LOG(ERROR) << "elm_radio_add failed."; + return; + } + + elm_radio_state_value_set(radio_main_, 0); + elm_radio_value_set(radio_main_, 0); + + InitializeSelectedPickerData(std::move(items)); + if (selected_index_ >= 0) { + elm_radio_value_set(radio_main_, selected_index_); + } + + evas_object_smart_callback_add(popup_list_, kChangedCbName, + RadioIconChangedCallback, this); + } else { + InitializeSelectedPickerData(std::move(items)); + } + + elm_object_part_content_set(layout_, "elm.swallow.content", popup_list_); +} + +gfx::Rect SelectPickerMobileBase::GetGeometryDIP() const { + if (IsMobileProfile()) { + int x, y, w, h; + edje_object_part_geometry_get(elm_layout_edje_get(layout_), "bg", &x, &y, + &w, &h); + return gfx::ToEnclosingRect(gfx::ConvertRectToDips( + gfx::Rect(x, y, w, h), display::Screen::GetScreen() + ->GetPrimaryDisplay() + .device_scale_factor())); + } else { + return gfx::Rect(); + } +} diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h new file mode 100644 index 0000000..a60b360 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h @@ -0,0 +1,39 @@ +// Copyright 2022 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_MOBILE_BASE_H_ +#define CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_MOBILE_BASE_H_ + +#include "content/browser/select_picker/form_navigable_picker.h" + +class GenlistCallbackData; + +class SelectPickerMobileBase : public FormNavigablePicker { + public: + explicit SelectPickerMobileBase(Evas_Object* evas_object, + int selected_index, + bool is_multiple_selection); + virtual ~SelectPickerMobileBase() override; + + SelectPickerMobileBase(const SelectPickerMobileBase&) = delete; + SelectPickerMobileBase& operator=(const SelectPickerMobileBase&) = delete; + + private: + static Evas_Object* IconGetCallback(void*, Evas_Object*, const char*); + + // SelectPickerBase + gfx::Rect GetGeometryDIP() const override; + void Init(std::vector items, + const gfx::Rect& bounds) override; + void ItemSelected(GenlistCallbackData* data, void* event_info) override; + void ClearData() override; + void CreateAndPopulatePopupList( + std::vector items) override; + + void DestroyRadioList(); + + Evas_Object* radio_main_; +}; + +#endif // CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_MOBILE_BASE_H_ diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc new file mode 100644 index 0000000..1422a45 --- /dev/null +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc @@ -0,0 +1,55 @@ +// Copyright 2022 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 "content/browser/select_picker/select_picker_tv_base.h" + +namespace { +// Size of element and do resize only when - // the picker overlaps the element will prevent Blink from doing re-layout. - // Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=15488. - rwhva()->offscreen_helper()->SetCustomViewportSize(gfx::Size( - rect.width(), is_popup_menu_visible ? rect.height() - picker_height - : rect.height() + picker_height)); + rwhva()->offscreen_helper()->SetCustomViewportSize( + is_popup_menu_visible + ? gfx::Size(view_rect.width(), + view_rect.height() - picker_height + bottom_height) + : gfx::Size()); } void EWebView::SetScaleChangedCallback(Ewk_View_Scale_Changed_Callback callback, @@ -2676,6 +2549,12 @@ bool EWebView::HandleResize(int width, int height) { if (!native_view_) return false; evas_object_resize(native_view_, width, height); + + if (select_picker_) { + AdjustViewPortHeightToPopupMenu(true /* is_popup_menu_visible */); + ScrollFocusedNodeIntoView(); + } + return true; } diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index 9d87a7a..ee88fa3 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -21,9 +21,9 @@ #include "base/containers/id_map.h" #include "base/synchronization/waitable_event.h" #include "browser/input_picker/input_picker.h" -#include "browser/selectpicker/popup_picker.h" #include "content/browser/date_time_chooser_efl.h" #include "content/browser/renderer_host/event_with_latency_info.h" +#include "content/browser/select_picker/select_picker_base.h" #include "content/browser/selection/selection_controller_efl.h" #include "content/browser/web_contents/web_contents_view_aura.h" #include "content/browser/web_contents/web_contents_view_aura_helper_efl.h" @@ -381,19 +381,11 @@ class EWebView { void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type); void HandlePopupMenu(std::vector items, int selectedIndex, - bool multiple); + bool multiple, + const gfx::Rect& bounds); void HidePopupMenu(); - void UpdateFormNavigation(int formElementCount, - int currentNodeIndex, - bool prevState, - bool nextState); - void FormNavigate(bool direction); - bool FormIsNavigating() const { return formIsNavigating_; } - void SetFormIsNavigating(bool formIsNavigating); - Eina_Bool PopupMenuUpdate(Eina_List* items, int selectedIndex); - Eina_Bool DidSelectPopupMenuItem(int selectedIndex); - Eina_Bool DidMultipleSelectPopupMenuItem(std::vector& selectedIndices); - void PopupMenuClose(); + void DidSelectPopupMenuItems(std::vector& indices); + void DidCancelPopupMenu(); void HandleLongPressGesture(const content::ContextMenuParams&); void ShowContextMenu(const content::ContextMenuParams&); void CancelContextMenu(int request_id); @@ -408,6 +400,7 @@ class EWebView { Eina_Hash* headers, const char* body); + SelectPickerBase* GetSelectPicker() const { return select_picker_.get(); } content::SelectionControllerEfl* GetSelectionController() const; content::PopupControllerEfl* GetPopupController() const { return popup_controller_.get(); @@ -706,7 +699,6 @@ class EWebView { #endif JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl(); - void ReleasePopupMenuList(); // Changes viewport without resizing Evas_Object representing webview // and its corresponding RWHV to let Blink renders custom viewport // while showing picker. @@ -747,16 +739,6 @@ class EWebView { std::unique_ptr<_Ewk_Auth_Challenge> auth_challenge_; std::string selected_text_cached_; - Eina_List* popupMenuItems_; - Popup_Picker* popupPicker_; - bool formIsNavigating_; - typedef struct { - int count; - int position; - bool prevState; - bool nextState; - } formNavigation; - formNavigation formNavigation_; std::unique_ptr context_menu_; #if !defined(EWK_BRINGUP) // FIXME: m71 bringup std::unique_ptr file_chooser_; @@ -863,6 +845,7 @@ class EWebView { content::AcceptLanguagesHelper::AcceptLangsChangedCallback accept_langs_changed_callback_; + std::unique_ptr select_picker_; std::unique_ptr host_; std::unique_ptr focus_client_; std::unique_ptr window_parenting_client_; diff --git a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc index 154762e..19fc4e7 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc @@ -83,9 +83,6 @@ bool RenderFrameObserverEfl::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(RenderFrameObserverEfl, message) IPC_MESSAGE_HANDLER(EwkFrameMsg_LoadNotFoundErrorPage, OnLoadNotFoundErrorPage) -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) -#endif IPC_MESSAGE_HANDLER(EwkFrameMsg_MoveToNextOrPreviousSelectElement, OnMoveToNextOrPreviousSelectElement) IPC_MESSAGE_HANDLER(EwkFrameMsg_RequestSelectCollectionInformation, OnRequestSelectCollectionInformation); IPC_MESSAGE_UNHANDLED(handled = false) @@ -93,25 +90,6 @@ bool RenderFrameObserverEfl::OnMessageReceived(const IPC::Message& message) { return handled; } -void RenderFrameObserverEfl::OnSelectPopupMenuItems( - bool canceled, - const std::vector& selected_indices) { -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - RenderFrameImpl* render_frame_impl_ = static_cast(render_frame()); - ExternalPopupMenu* external_popup_menu_ = render_frame_impl_->external_popup_menu_.get(); - if (external_popup_menu_ == NULL) - return; - // It is possible to receive more than one of these calls if the user presses - // a select faster than it takes for the show-select-popup IPC message to make - // it to the browser UI thread. Ignore the extra-messages. - // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. - canceled = canceled || !hasHTMLTagNameSelect(GetFocusedElement(render_frame()->GetWebFrame())); - external_popup_menu_->DidSelectItems(canceled, selected_indices); - if (canceled) - render_frame_impl_->DidHideExternalPopupMenu(); -#endif -} - void RenderFrameObserverEfl::OnLoadNotFoundErrorPage(std::string errorUrl) { #if !defined(EWK_BRINGUP) // FIXME: m108 bringup blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); @@ -128,13 +106,13 @@ void RenderFrameObserverEfl::OnLoadNotFoundErrorPage(std::string errorUrl) { } void RenderFrameObserverEfl::OnMoveToNextOrPreviousSelectElement(bool direction) { -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - content::RenderView* render_view_ = render_frame()->GetRenderView(); - if (direction) - render_view_->GetWebView()->moveFocusToNext(WebView::TraverseFocusThrough::SelectElement); - else - render_view_->GetWebView()->moveFocusToPrevious(WebView::TraverseFocusThrough::SelectElement); -#endif + if (direction) { + render_frame()->GetWebView()->MoveFocusToNext( + WebView::TraverseFocusThrough::SelectElement); + } else { + render_frame()->GetWebView()->MoveFocusToPrevious( + WebView::TraverseFocusThrough::SelectElement); + } } void RenderFrameObserverEfl::OnRequestSelectCollectionInformation() { @@ -181,11 +159,11 @@ void RenderFrameObserverEfl::DidChangeScrollOffset() { if (render_frame()->GetRenderView()->GetMainRenderFrame() != render_frame()) return; blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); - blink::WebSize contentsSize = frame->ContentsSize(); + blink::WebSize documentSize = frame->DocumentSize(); blink::WebRect visibleContentRect = frame->VisibleContentRect(); blink::WebSize maximumScrollOffset( - contentsSize.width - visibleContentRect.width, - contentsSize.height - visibleContentRect.height); + documentSize.width - visibleContentRect.width, + documentSize.height - visibleContentRect.height); if (max_scroll_offset_ != maximumScrollOffset) { max_scroll_offset_ = maximumScrollOffset; diff --git a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h index 045c65d..9f3dfe2 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h +++ b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h @@ -60,9 +60,6 @@ class RenderFrameObserverEfl : public RenderFrameObserver { RenderFrame* frame) override; private: - void OnSelectPopupMenuItems(bool canceled, - const std::vector& selected_indices); - void OnLoadNotFoundErrorPage(std::string errorUrl); void OnMoveToNextOrPreviousSelectElement(bool direction); diff --git a/tizen_src/ewk/efl_integration/resource/BUILD.gn b/tizen_src/ewk/efl_integration/resource/BUILD.gn index 33f8000..493a38c 100644 --- a/tizen_src/ewk/efl_integration/resource/BUILD.gn +++ b/tizen_src/ewk/efl_integration/resource/BUILD.gn @@ -9,9 +9,7 @@ template("edje_res_ewk") { action_foreach(edje_target_name) { script = "//tizen_src/build/cmd_execution.py" sources = invoker.sources - outputs = [ - "$root_out_dir/resources/{{source_name_part}}.edj", - ] + outputs = [ "$root_out_dir/resources/{{source_name_part}}.edj" ] args = [ "$edje_compiler", "-id", @@ -22,9 +20,7 @@ template("edje_res_ewk") { } source_set(target_name) { - deps = [ - ":$edje_target_name", - ] + deps = [ ":$edje_target_name" ] } } @@ -34,5 +30,6 @@ edje_res_ewk("edje_resources_ewk") { "AutofillPopup.edc", "JavaScriptPopup.edc", "control.edc", + "controlTV.edc", ] } diff --git a/tizen_src/ewk/efl_integration/resource/control.edc b/tizen_src/ewk/efl_integration/resource/control.edc index 9f3e959..8989867 100644 --- a/tizen_src/ewk/efl_integration/resource/control.edc +++ b/tizen_src/ewk/efl_integration/resource/control.edc @@ -239,8 +239,8 @@ collections { } description { state: "show" 0.0; inherit: "default" 0.0; - rel1 { relative: 0.0 0.48;} - rel2 { relative: 1.0 1.0; offset: 0 2; } + rel1 { relative: 0.0 0.5; } + rel2 { relative: 1.0 1.0; } } description { state: "imf_panel" 0.0; inherit: "show" 0.0; @@ -461,6 +461,7 @@ collections { scale: 1; description { state: "default" 0.0; align: 0.0 0.0; + fixed: 0 1; rel1 { relative: 0.0 1.0; to: "elm.image.panel"; } rel2 { relative: 1.0 1.0;} } @@ -554,6 +555,10 @@ collections { target: "bg"; target: "elm.image.panel"; target: "elm.swallow.content"; + after: "show,picker,done"; + } + program { name: "show,picker,done"; + action: SIGNAL_EMIT "show,picker,done" ""; } program { name: "show,picker_delay"; signal: "show,picker_delay,signal"; diff --git a/tizen_src/ewk/efl_integration/resource/controlTV.edc b/tizen_src/ewk/efl_integration/resource/controlTV.edc new file mode 100644 index 0000000..0ff54ea --- /dev/null +++ b/tizen_src/ewk/efl_integration/resource/controlTV.edc @@ -0,0 +1,1833 @@ +#define COLORSELECTOR_BG_WIDTH_INC 300 +#define COLORSELECTOR_POPUP_TOP_PADDING_HEIGHT_INC 26 +#define COLORSELECTOR_POPUP_HEIGHT_INC 194 +#define COLORSELECTOR_POPUP_SEPARATOR_INC 1 +#define COLORSELECTOR_POPUP_COLORSELECTOR_HEIGHT_INC 148 + +#define FIXED_SIZE(_WIDTH, _HEIGHT) \ + min: _WIDTH _HEIGHT; max: _WIDTH _HEIGHT; fixed: 1 1; + +#define BASIC_CURVE 0.3 0.0 0.0 1.0 +#define BLACK_COLOR 0 0 0 +#define DO_NOT_SCROLL_IF_SPACE_IS_MORE_THAN_THIS_VALUE 1 +#define FOCUS_HIGHLIGHT_BORDER 5 5 5 5; +#define LIST_FONT_SIZE 38 +#define SPEED 30 +#define STATE_STRING_LEN 10 +#define WHITE_COLOR 255 255 255 +#define ZERO_VER 0.0 + +#define OPACITY_100 255 +#define OPACITY_97 248 +#define OPACITY_90 230 +#define OPACITY_70 179 +#define OPACITY_50 128 +#define OPACITY_40 102 +#define OPACITY_30 77 +#define OPACITY_20 51 +#define OPACITY_18 46 +#define OPACITY_15 39 +#define OPACITY_13 34 +#define OPACITY_10 26 +#define OPACITY_9 23 +#define OPACITY_7 18 +#define OPACITY_5 13 +#define OPACITY_0 0 + +#define TEXT_NORMAL_FONT "SamsungOneUI_300" +#define TEXT_FOCUSED_MAIN_FONT "SamsungOneUI_600" +#define TEXT_SELECTED_FONT "SamsungOneUI_300" +#define TEXT_SELECTED_FOCUSED_FONT "SamsungOneUI_600" +#define TEXT_DIMMED_FONT "SamsungOneUI_300" + +#define RESOLUTION_W 1920 +#define RESOLUTION_H 1080 + +#define SCROLL_PAD_WIDTH (0.052084*RESOLUTION_W) +#define LT_PADDING (0.018225*RESOLUTION_W) +#define LT_PADDING_2 (0.020833*RESOLUTION_W) +#define RT_PADDING (0.018225*RESOLUTION_W) +#define RT_PADDING_2 (0.010416*RESOLUTION_W) +#define MD_PADDING (0.026042*RESOLUTION_W) + + +#define GENLIST_ITEM_HT (0.074075*RESOLUTION_H) +#define GENLIST_TEXT_HT (0.055556*RESOLUTION_H) +#define ICON_WD (0.019792*RESOLUTION_W) +#define ICON_HT (0.035186*RESOLUTION_H) + +color_classes { + color_class { name: "TEXT_NORMAL_MAIN_B"; + color: 0 0 0 OPACITY_100; + color2: 0 0 0 OPACITY_40; + } + color_class { name: "TEXT_FOCUSED_MAIN_B"; + color: WHITE_COLOR OPACITY_100; + color2: WHITE_COLOR OPACITY_40; + } + color_class { name: "TEXT_SELECTED_B"; + color: 62 174 254 OPACITY_100; + color2: 62 174 254 OPACITY_40; + } + color_class { name: "TEXT_SELECTED_FOCUSED_B"; + color: 62 174 254 OPACITY_100; + color2: 62 174 254 OPACITY_40; + } + color_class { name: "TEXT_DIMMED_B"; + color: WHITE_COLOR OPACITY_20; + color2: WHITE_COLOR OPACITY_9; + } + color_class { name: "FOCUS_LAYER_COLOR_B"; + color: 255 255 255 OPACITY_10; + } + color_class { name: "LIST_NORMAL_B"; + color: 37 37 37 OPACITY_0; + } + color_class { name: "LIST_DIMMED_B"; + color: 21 21 21 OPACITY_0; + } + color_class { name: "WHITE_OPACITY_0"; + color: WHITE_COLOR OPACITY_0; + } + color_class { name: "WHITE_OPACITY_100"; + color: WHITE_COLOR OPACITY_100; + } +} +collections { + + +group { name: "elm/scroll/base/styleA"; + alias: "elm/scroller/base/styleA"; + alias: "elm/list/base/styleA"; + alias: "elm/genlist/base/styleA"; + alias: "elm/scroll/base/arrow"; + alias: "elm/list/base/arrow"; + alias: "elm/genlist/base/arrow"; + + images.image: "obe_list_scroll_up.png" COMP; + images.image: "obe_list_scroll_up_f.png" COMP; + images.image: "obe_list_scroll_down.png" COMP; + images.image: "obe_list_scroll_down_f.png" COMP; + + data.item: "focus_highlight" "on"; + + parts { + + part { name: "sb_vbar_show"; type: RECT; + scale: 1; + description { state: "default" 0.0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + part { name: "sb_vbar"; type: RECT; + scale: 1; + description { state: "default" 0.0; + fixed: 1 0; + min: (0.007813*RESOLUTION_W) (0.00185*RESOLUTION_H); + align: 0.0 0.0; + rel1.to_x: "arrow_right"; + rel2.relative: 1.0 0.0; + rel2.to_y: "sb_hbar"; + visible: 0; + } + } + + part { name: "sb_vbar_base"; type: RECT; + scale: 1; + clip_to: "sb_vbar"; + description { state: "default" 0.0; + visible: 0; + rel1.relative: 0.0 1.0; + rel1.to: "sb_vbar_a1"; + rel2.relative: 1.0 0.0; + rel2.to: "sb_vbar_a2"; + } + } + + part { name: "elm.dragable.vbar"; type: RECT; + clip_to: "sb_vbar"; + scale: 1; + dragable.x: 0 0 0; + dragable.y: 1 1 0; + dragable.confine: "sb_vbar_base"; + description { state: "default" 0.0; + fixed: 1 1; + min: (0.007813*RESOLUTION_W) (0.00185*RESOLUTION_H); + rel1.relative: 0.5 0.5; + rel1.to: "sb_vbar_base"; + rel2.relative: 0.5 0.5; + rel2.to: "sb_vbar_base"; + visible: 0; + color:255 0 0 128; + } + } + + part { name: "sb_vbar_a1"; type: RECT; + scale: 1; + clip_to: "sb_vbar"; + description { state: "default" 0.0; + fixed: 1 1; + min: (0.007813*RESOLUTION_W) (0.013889*RESOLUTION_H); + align: 0.5 0.0; + aspect: 1.0 1.0; aspect_preference: HORIZONTAL; + visible: 0; + rel1.to: "sb_vbar"; + rel2.to: "sb_vbar"; + rel2.relative: 1.0 0.0; + color:0 255 255 128; + } + } + + part { name: "sb_vbar_a2"; type: RECT; + scale: 1; + clip_to: "sb_vbar"; + description { state: "default" 0.0; + fixed: 1 1; + min: (0.007813*RESOLUTION_W) (0.013889*RESOLUTION_H); + align: 0.5 1.0; + aspect: 1.0 1.0; aspect_preference: HORIZONTAL; + visible: 0; + rel1.to: "sb_vbar"; + rel1.relative: 0.0 1.0; + rel2.to: "sb_vbar"; + color:0 255 255 128; + } + } + + part { name: "sb_hbar_show"; type: RECT; + scale: 1; + description { state: "default" 0.0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + part { name: "sb_hbar"; type: RECT; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + min: 1 0; + align: 0.0 1.0; + rel1.to_y: "arrow_down"; + rel2.relative: 0.0 1.0; + rel2.to_x: "arrow_right"; + rel2.to_y: "arrow_down"; + rel2.relative: 0.0 0.0; + visible: 0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + min: 0 0; + max: 999 0; + } + } + + part { name: "clipper"; type: RECT; + description { state: "default" 0.0; + rel1.to: "elm.swallow.background"; + rel2.to: "elm.swallow.background"; + color:255 255 255 255; + visible:1; + } + } + + part { name: "elm.swallow.background"; type: SWALLOW; + scale: 1; + clip_to: "clipper"; + description { state: "default" 0.0; + rel1.to: "arrow_up.background"; + rel1.relative: 0.0 1.0; + rel2.relative: 1.0 0.0; + rel2.to: "arrow_down.background"; + } + } + + part { name: "elm.swallow.content"; type: SWALLOW; + clip_to: "clipper"; + scale: 1; + description { state: "default" 0.0; + rel1.to:"elm.swallow.background"; + rel2.to:"elm.swallow.background"; + } + } + + part { name: "elm.swallow.overlay"; type: SWALLOW; + clip_to: "clipper"; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + } + } + + part { name: "runner_vbar"; type: RECT; mouse_events: 0; + scale: 1; + clip_to: "sb_vbar_show"; + description { state: "default" 0.0; + rel1.to: "sb_vbar_base"; + rel2.to: "sb_vbar_base"; + min: (0.001563*RESOLUTION_W) (0.0037*RESOLUTION_H); + max: (0.001563*RESOLUTION_W) -1; + visible: 1; + color:255 255 255 128; + } + } + + part { name: "runner_vbar_clip"; type: RECT; + scale: 1; + clip_to: "sb_vbar_show"; + description { state: "default" 0.0; + min: 1 1; + max: 1 999; + rel1.to: "runner_vbar"; + rel2.to: "runner_vbar"; + visible: 0; + color:0 255 255 128; + } + } + + part { name: "elm.padding.arrow_up_spacer"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: -1 0; + fixed: 0 1; + align: 0.5 0.0; + } + } + part { name: "elm.padding.arrow_left_spacer"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: 0 -1; + fixed: 1 0; + rel1.to_y: "arrow_up"; + rel1.relative: 0.0 1.0; + rel2.to_y: "arrow_down"; + rel2.relative: 0.0 0.0; + align: 0.0 0.5; + } + } + part { name: "elm.padding.arrow_right_spacer"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: 0 -1; + fixed: 0 1; + rel1.to_y: "elm.padding.arrow_left_spacer"; + rel2.to_y: "elm.padding.arrow_left_spacer"; + align: 1.0 0.5; + } + } + + part { name: "arrow_right"; type: RECT; + clip_to: "sb_hbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "elm.padding.arrow_right_spacer"; + rel2.to: "elm.padding.arrow_right_spacer"; + rel2.relative: 0.0 1.0; + align: 1.0 0.5; + } + } + + part { name: "arrow_up.background"; type: RECT; + clip_to: "sb_vbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "elm.padding.arrow_up_spacer"; + rel1.relative: 0.0 1.0; + rel2.to: "sb_vbar_show"; + align: 0.5 0.0; + FIXED_SIZE((0.38021*RESOLUTION_W), (0.05 *RESOLUTION_H)) + visible:0; + } + } + + part { name: "arrow_up"; type: IMAGE; + clip_to: "sb_vbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to:"arrow_up.background"; + rel2.to:"arrow_up.background"; + image.normal: "obe_list_scroll_up.png"; + color:255 255 255 127; + } + description { state: "over" 0.0; + inherit: "default" 0.0; + image.normal: "obe_list_scroll_up_f.png"; + color:255 255 255 255; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "obe_list_scroll_up.png"; + color:255 255 255 76; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + + part { name: "elm.padding.arrow_down_spacer"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: -1 0; + fixed: 0 1; + align: 0.5 1.0; + } + } + + + part { name: "arrow_down.background"; type: RECT; + clip_to: "sb_vbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "elm.padding.arrow_down_spacer"; + rel2.to: "elm.padding.arrow_down_spacer"; + rel2.relative: 1.0 0.0; + align: 0.5 1.0; + visible:0; + FIXED_SIZE((0.38021*RESOLUTION_W), (0.05 *RESOLUTION_H)) + } + } + + part {name: "arrow_down"; type: IMAGE; + clip_to: "sb_vbar_show"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "arrow_down.background"; + rel2.to: "arrow_down.background"; + image.normal: "obe_list_scroll_down.png"; + color:255 255 255 127; + } + description { state: "over" 0.0; + inherit: "default" 0.0; + image.normal: "obe_list_scroll_down_f.png"; + color:255 255 255 255; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + image.normal: "obe_list_scroll_down.png"; + color:255 255 255 76; + } + description { state: "invisible" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + part {name: "runner_glow_vbar"; type: RECT; mouse_events: 0; + scale: 1; + clip_to: "runner_vbar_clip"; + description { state: "default" 0.0; + rel1.to_x: "runner_vbar_clip"; + rel1.to_y: "base_vbar"; + rel2.to_x: "runner_vbar_clip"; + rel2.to_y: "base_vbar"; + visible: 0; + } + } + + part {name: "base_vbar"; type: RECT; mouse_events: 0; + scale: 1; + clip_to: "sb_vbar_show"; + description { state: "default" 0.0; + rel1.to: "elm.dragable.vbar"; + rel2.to: "elm.dragable.vbar"; + fixed: 1 1; + visible: 0; + } + } + + part {name: "bevel_vbar"; type: RECT; mouse_events: 0; + scale: 1; + clip_to: "sb_vbar_show"; + description { state: "default" 0.0; + min: (0.0026*RESOLUTION_W) (0.0046296*RESOLUTION_H); + visible: 0; + } + } + } + + programs { + program { + signal: "load"; source: ""; + action: STATE_SET "hidden" 0.0; + target: "sb_vbar"; + target: "sb_vbar_show"; + } + + program { + signal: "elm,action,show,vbar"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "sb_vbar"; + target: "sb_vbar_show"; + } + + program { + signal: "elm,action,hide,vbar"; source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "sb_vbar"; + target: "sb_vbar_show"; + } + + program { + signal: "mouse,down,1*"; source: "arrow_up"; + action: STATE_SET "clicked" 0.0; + target: "sb_vbar_a1"; + target: "arrow_up"; + after: "up_fade"; + after: "mouse_click_up_arrow"; + } + + program { name: "up_fade"; + source: ""; + action: STATE_SET "default" 0.0; + target: "sb_vbar_a1"; + transition: LINEAR 1; + target: "arrow_up"; + } + + program { + signal: "mouse,down,1*"; source: "arrow_up"; + action: DRAG_VAL_STEP 0.0 -1.0; + target: "elm.dragable.vbar"; + } + + program { + signal: "mouse,up,1"; source: "arrow_up"; + action: STATE_SET "default" 0.0; + target: "sb_vbar_a1"; + target: "arrow_up"; + after: "sound_on_select"; + } + + program { name: "sound_on_select"; + action: RUN_PLUGIN "select"; + } + + program { + signal: "mouse,down,1*"; source: "arrow_down"; + action: STATE_SET "clicked" 0.0; + target: "sb_vbar_a2"; + target: "arrow_down"; + after: "down_fade"; + after: "mouse_click_down_arrow"; + } + + program { name: "down_fade"; + source: ""; + action: STATE_SET "default" 0.0; + target: "sb_vbar_a2"; + transition: LINEAR 1; + target: "arrow_down"; + } + + program { + signal: "mouse,down,1*"; source: "arrow_down"; + action: DRAG_VAL_STEP 0.0 1.0; + target: "elm.dragable.vbar"; + } + + program { + signal: "mouse,up,1"; source: "arrow_down"; + action: STATE_SET "default" 0.0; + target: "sb_vbar_a2"; + target: "arrow_down"; + after: "sound_on_select"; + } + + program { + signal: "mouse,down,1*"; source: "sb_vbar_p1"; + action: DRAG_VAL_PAGE 0.0 -1.0; + target: "elm.dragable.vbar"; + } + + program { + signal: "mouse,down,1*"; source: "sb_vbar_p2"; + action: DRAG_VAL_PAGE 0.0 1.0; + target: "elm.dragable.vbar"; + } + program { name: "sound_on_focus"; + action: RUN_PLUGIN "focus"; + } + program { + signal: "elm,scroll,arrow_up,hide"; source: "elm"; + action: STATE_SET "invisible" 0.0; + target: "arrow_up"; + } + // == use this signal "elm,scroll,arrow_up,show" if you need to show the up_ARROW + program { + signal: "elm,scroll,arrow_up,show"; source: "elm"; + action: STATE_SET "default" 0.0; + target: "arrow_up"; + } + // == use this signal "elm,scroll,arrow_down,hide" if you need to hide the down_ARROW + program { + signal: "elm,scroll,arrow_down,hide"; source: "elm"; + action: STATE_SET "invisible" 0.0; + target: "arrow_down"; + } + // == use this signal "elm,scroll,arrow_down,show" if you need to show the down_ARROW + program { + signal: "elm,scroll,arrow_down,show"; source: "elm"; + action: STATE_SET "default" 0.0;; + target: "arrow_down"; + } + + program { + signal: "elm,action,looping,left"; source: "elm"; + action: STATE_SET "effect_right" 0.0; + transition: LINEAR 0.3; + target: "elm.swallow.content"; + after: "looping,left,done"; + } + + program { name: "looping,left,done"; + action: SIGNAL_EMIT "elm,looping,left,done" "elm"; + } + + program { + signal: "elm,action,looping,left,end"; source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.3; + target: "elm.swallow.content"; + after: "looping,left,end"; + } + + program { name: "looping,left,end"; + action: SIGNAL_EMIT "elm,looping,left,end" "elm"; + } + + program { + signal: "elm,action,looping,right"; source: "elm"; + action: STATE_SET "effect_left" 0.0; + transition: LINEAR 0.3; + target: "elm.swallow.content"; + after: "looping,right,done"; + } + + program { name: "looping,right,done"; + action: SIGNAL_EMIT "elm,looping,right,done" "elm"; + } + + program { + signal: "elm,action,looping,right,end"; source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.3; + target: "elm.swallow.content"; + after: "looping,right,end"; + } + + program { name: "looping,right,end"; + action: SIGNAL_EMIT "elm,looping,right,end" "elm"; + } + + program { + signal: "elm,action,looping,up"; source: "elm"; + action: STATE_SET "effect_down" 0.0; + transition: LINEAR 0.2; + target: "elm.swallow.content"; + after: "looping,up,next"; + } + + program { name: "looping,up,next"; + action: STATE_SET "effect_up" 0.0; + target: "elm.swallow.content"; + after: "looping,up,done"; + } + + program { name: "looping,up,done"; + action: SIGNAL_EMIT "elm,looping,up,done" "elm"; + } + + program { + signal: "elm,action,looping,up,end"; source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "elm.swallow.content"; + after: "looping,up,end"; + } + + program { name: "looping,up,end"; + action: SIGNAL_EMIT "elm,looping,up,end" "elm"; + } + + program { + signal: "elm,action,looping,down"; source: "elm"; + action: STATE_SET "effect_up" 0.0; + transition: LINEAR 0.2; + target: "elm.swallow.content"; + after: "looping,down,next"; + } + + program { name: "looping,down,next"; + action: STATE_SET "effect_down" 0.0; + target: "elm.swallow.content"; + after: "looping,down,done"; + } + + program { name: "looping,down,done"; + action: SIGNAL_EMIT "elm,looping,down,done" "elm"; + } + + program { + signal: "elm,action,looping,down,end"; source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.2; + target: "elm.swallow.content"; + after: "looping,down,end"; + } + + program { name: "looping,down,end"; + action: SIGNAL_EMIT "elm,looping,down,end" "elm"; + } + program { name: "mouse_click_down_arrow"; + action: SIGNAL_EMIT "mouse,click,down,arrow" ""; + } + + program { name: "mouse_click_up_arrow"; + action: SIGNAL_EMIT "mouse,click,up,arrow" ""; + } + + program { name: "up_over_show"; + signal: "mouse,in"; source: arrow_up; + action: STATE_SET "over" 0.0; + target: arrow_up; + after: "sound_on_focus"; + after:"mouse_in_up"; + } + program { name: "down_over_show"; + signal: "mouse,in"; source: arrow_down; + action: STATE_SET "over" 0.0; + target: arrow_down; + after: "sound_on_focus"; + after:"mouse_in_down"; + } + + program { name: "up_over_hide"; + signal: "mouse,out"; source: arrow_up; + action: STATE_SET "default" 0.0; + target: arrow_up; + after:"mouse_out_up"; + } + + program { name: "down_over_hide"; + signal: "mouse,out"; source: arrow_down; + action: STATE_SET "default" 0.0; + target: arrow_down; + after:"mouse_out_down"; + } + + program { name: "mouse_in_down"; + action: SIGNAL_EMIT "mouse,in,down,arrow" ""; + } + + program { name: "mouse_out_down"; + action: SIGNAL_EMIT "mouse,out,down,arrow" ""; + } + program { name: "mouse_in_up"; + action: SIGNAL_EMIT "mouse,in,up,arrow" ""; + } + + program { name: "mouse_out_up"; + action: SIGNAL_EMIT "mouse,out,up,arrow" ""; + } + } +} + + group { name: "elm/genlist/item/APP_STYLE/default"; + images { + image: "highlight_stroke.png" COMP; + } + data.item: "texts" "elm.text"; + script { + public isSelected = 0; + public isDimmed = 0; + public isFocused = 0; + public curVer; + + public g_duration = 0, g_stopslide = 1, g_timer_id, g_anim_id, g_is_rtl; + + public slide_to_end_anim(val, Float:pos) { + new stopflag; + new id; + stopflag = get_int(g_stopslide); + if (stopflag == 1) return; + + new Float:vl = get_float(curVer); + + if(get_int(isSelected)) { + set_tween_state(PART:"elm.text", pos, "selected_slide_begin", vl, "selected_slide_end", vl); + set_state(PART:"elm.text.loopback", "selected_focused", vl); + } else { + set_tween_state(PART:"elm.text", pos, "slide_begin", vl, "slide_end", vl); + set_state(PART:"elm.text.loopback", "focused", vl); + } + + if (pos >= 1.0) { + id = timer(0.0, "slide_to_begin", 1); + } + set_int(g_timer_id, id); + } + + public slide_to_end() { + new stopflag; + new id; + new Float:duration; + stopflag = get_int(g_stopslide); + if (stopflag == 1) + return; + + duration = get_float(g_duration); + id = anim(duration, "slide_to_end_anim", 1); + set_int(g_anim_id, id); + } + + public slide_to_begin() { + new stopflag; + new id; + stopflag = get_int(g_stopslide); + if (stopflag == 1) + return; + + new Float:vl = get_float(curVer); + + if(get_int(isSelected)) { + set_state(PART:"elm.text", "selected_slide_begin", vl); + } else { + set_state(PART:"elm.text", "slide_begin", vl); + } + id = timer(0.0, "slide_to_end", 1); + set_int(g_timer_id, id); + } + + public start_slide() { + new id; + set_int(g_stopslide, 1); + id = get_int(g_anim_id); + cancel_anim(id); + id = get_int(g_timer_id); + cancel_timer(id); + + new x, y, w, h; + set_int(g_stopslide, 0); + SetDuration(); + get_geometry(PART:"space_at_right", x, y, w, h) + if(w > (DO_NOT_SCROLL_IF_SPACE_IS_MORE_THAN_THIS_VALUE)) + return; + + new Float:vl = get_float(curVer); + + if(get_int(isSelected)) { + if( get_int( g_is_rtl ) == 1 ) { + set_state(PART:"elm.text", "selected_slide_end", vl); + } else { + set_state(PART:"elm.text", "selected_slide_begin", vl); + } + set_state(PART:"elm.text.loopback", "selected_focused", vl); + } else { + if( get_int( g_is_rtl ) == 1 ) { + set_state(PART:"elm.text", "slide_end", vl); + } else { + set_state(PART:"elm.text", "slide_begin", vl); + } + set_state(PART:"elm.text.loopback", "focused", vl); + } + + slide_to_end(); + } + + public stop_slide() { + new id; + set_int(g_stopslide, 1); + id = get_int(g_anim_id); + cancel_anim(id); + id = get_int(g_timer_id); + cancel_timer(id); + } + + public SetDuration() { + new x, y, w, h; + get_geometry(PART:"text.size.estimate", x, y, w, h); + new Float:t = w / SPEED; + set_float(g_duration, t); + } + + } + + parts { + + part { name: "base"; type: RECT; + scale: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + min: 0 GENLIST_ITEM_HT; + color_class: "LIST_NORMAL_B"; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + } + description { state: "dimmed" 0.0; + inherit: "default" 0.0; + color_class: "LIST_DIMMED_B"; + } + } + + part { name: "focus_layer"; type: RECT; + scale: 1; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + color_class : "WHITE_OPACITY_0"; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + color_class : "FOCUS_LAYER_COLOR_B"; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + } + description { state: "dimmed" 0.0; + inherit: "default" 0.0; + } + } + + part { name: "clip_rect"; type: RECT; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: 1 GENLIST_TEXT_HT; + max: -1 GENLIST_TEXT_HT; + align: 0.0 0.5; + rel1.to: "pad.text_left"; + rel1.relative: 1.0 0.0; + rel2.to: "pad.text_right"; + rel2.relative: 0.0 1.0; + } + } + + part { name: "pad.text_left"; type: SPACER; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.0 0.0; + min: (0.020833*RESOLUTION_W) GENLIST_ITEM_HT; + max: (0.020833*RESOLUTION_W) GENLIST_ITEM_HT; + } + } + + part { name: "pad.text_right"; type: SPACER; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + align: 1.0 0.0; + min: (0.020833*RESOLUTION_W) GENLIST_ITEM_HT; + max: (0.020833*RESOLUTION_W) GENLIST_ITEM_HT; + } + } + + part { name: "elm.text"; type: TEXT; mouse_events: 0; + ignore_flags: ON_HOLD; + scale: 1; + clip_to: "clip_rect"; + effect: OUTLINE; + description { state: "default" 0.0; + min: 1 GENLIST_TEXT_HT; + max: -1 GENLIST_TEXT_HT; + align: 0.0 0.5; + rel1.to: "pad.text_left"; + rel1.relative: 1.0 0.0; + rel2.to: "pad.text_right"; + rel2.relative: 0.0 1.0; + color_class: "TEXT_NORMAL_MAIN_B"; + text { + font: TEXT_NORMAL_FONT; + size: LIST_FONT_SIZE; + align: 0.5 0.5; + min: 0 1; + } + } + description { state: "default.rtl" 0.0; + inherit: "default" 0.0; + text.ellipsis: 1; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + color_class: "TEXT_FOCUSED_MAIN_B"; + text.font: TEXT_FOCUSED_MAIN_FONT; + } + description { state: "focused.rtl" 0.0; + inherit: "focused" 0.0; + text.ellipsis: 1; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color_class: "TEXT_SELECTED_B"; + text.font: TEXT_SELECTED_FONT; + } + description { state: "selected.rtl" 0.0; + inherit: "selected" 0.0; + text.ellipsis: 1; + } + description { state: "selected_focused" 0.0; + inherit: "default" 0.0; + color_class: "TEXT_SELECTED_FOCUSED_B"; + text.font: TEXT_SELECTED_FOCUSED_FONT; + } + description { state: "selected_focused.rtl" 0.0; + inherit: "selected_focused" 0.0; + text.ellipsis: 1; + } + description { state: "dimmed" 0.0; + inherit: "default" 0.0; + color_class: "TEXT_DIMMED_B"; + text.font: TEXT_DIMMED_FONT; + } + description { state: "dimmed.rtl" 0.0; + inherit: "dimmed" 0.0; + text.ellipsis: 1; + } + description { state: "slide_begin" 0.0; + inherit: "focused" 0.0; + rel1.to_x: "elm.pad0.50px"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 0.0 0.5; + text.align: 0.0 0.5; + text.min: 1 1; + text.ellipsis: -1; + text.text_class: "sublist_text_icon_foc_b"; + } + description { state: "selected_slide_begin" 0.0; + inherit: "selected_focused" 0.0; + rel1.to_x: "elm.pad0.50px"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 0.0 0.5; + text.min: 1 1; + text.ellipsis: -1; + text.text_class: "sublist_text_icon_sel_foc_b"; + } + description { state: "slide_end" 0.0; + inherit: "slide_begin" 0.0; + rel2.to_x: "elm.pad0.50px"; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 1.0 0.5; + text.text_class: "sublist_text_icon_foc_b"; + } + description { state: "selected_slide_end" 0.0; + inherit: "selected_slide_begin" 0.0; + rel2.to_x: "elm.pad0.50px"; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 1.0 0.5; + text.text_class: "sublist_text_icon_sel_foc_b"; + } + } + + part { name: "focus_image_clipper"; type: RECT; + scale: 1; + description { state: "default" 0.0; + fixed: 0 1; + rel1.to: "base"; + rel2.to: "base"; + color_class : "WHITE_OPACITY_0"; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + color_class : "WHITE_OPACITY_100"; + } + } + + part { name: "bg"; type: IMAGE; + scale: 1; + clip_to: "focus_image_clipper"; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + image { + normal: "highlight_stroke.png"; + border: FOCUS_HIGHLIGHT_BORDER; + border_scale: 1; + middle: 0; + } + } + } + + part { name: "elm.pad0.50px"; type: SPACER; mouse_events: 0; repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: SCROLL_PAD_WIDTH GENLIST_ITEM_HT; + max: SCROLL_PAD_WIDTH GENLIST_ITEM_HT; + rel1.to: "pad.text_left"; + rel1.relative: 1.0 0.0; + rel2.to: "pad.text_left"; + rel2.relative: 1.0 1.0; + align: 1.0 0.5; + } + } + + part { name: "elm.pad1.50px"; type: SPACER; mouse_events: 0; repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + min: SCROLL_PAD_WIDTH GENLIST_ITEM_HT; + max: SCROLL_PAD_WIDTH GENLIST_ITEM_HT; + rel1.to_x: "elm.text"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to_y: "base"; + rel2.relative: 0.0 1.0; + align: 0.0 0.5; + } + } + + part { name: "elm.text.loopback"; type: TEXT; mouse_events: 0; + scale: 1; + clip_to: "clip_rect"; + ignore_flags: ON_HOLD; + effect: OUTLINE; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.0 0.5; + rel1.to_x: "elm.pad1.50px"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to_x: "elm.pad1.50px"; + rel2.to_y: "base"; + rel2.relative: 1.0 1.0; + visible: 0; + color_class: "TEXT_FOCUSED_MAIN_B"; + text { + text_source: "elm.text"; + source: "elm.text"; + min: 1 1; + font: TEXT_FOCUSED_MAIN_FONT; + size: LIST_FONT_SIZE; + align: -1 0.5; + ellipsis: -1; + } + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "selected_focused" 0.0; + inherit: "default" 0.0; + visible: 1; + color_class: "TEXT_SELECTED_FOCUSED_B"; + text.font: TEXT_SELECTED_FOCUSED_FONT; + } + } + + part { name: "text.size.estimate"; type: TEXT; mouse_events: 0; + scale: 1; + clip_to: "clip_rect"; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to: "pad.text_left"; + rel1.relative: 1.0 0.0; + align: 0.0 0.0; + visible: 0; + text { + text_source: "elm.text"; + source: "elm.text"; + min: 1 1; + align: 0.0 0.5; + font: TEXT_FOCUSED_MAIN_FONT; + size : LIST_FONT_SIZE; + ellipsis: -1; + } + color_class : "TEXT_FOCUSED_MAIN_B"; + } + } + + part { name: "space_at_right"; type: SPACER; mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1.to_x: "text.size.estimate"; + rel1.to_y: "base"; + rel1.relative: 1.0 0.0; + rel2.to: "pad.text_right"; + rel2.relative: 0.0 1.0; + align: 0.0 0.0; + } + } + } + + programs { + + program { name: "init"; + signal: "load"; + script { + set_int(isSelected, 0); + set_int(isDimmed, 0); + set_int(isFocused, 0); + set_float(curVer, 0); + } + after: "set_states"; + } + + program { name: "anim_focus"; + action: STATE_SET "focused" 0.0; + target: "focus_layer"; + target: "focus_image_clipper"; + transition: CUBIC_BEZIER 0.334 BASIC_CURVE; + } + + program { name: "anim_unfocus"; + action: STATE_SET "default" 0.0; + target: "focus_layer"; + target: "focus_image_clipper"; + transition: CUBIC_BEZIER 0.334 BASIC_CURVE; + } + + program { name: "set_states"; + script { + new Float:vl = get_float(curVer); + if(get_int(isFocused) == 1) { + set_state(PART:"base", "focused", vl); + run_program(PROGRAM:"anim_focus"); + } else if(get_int(isDimmed) == 1) { + set_state(PART:"base", "dimmed", vl); + run_program(PROGRAM:"anim_unfocus"); + } else if(get_int(isSelected) == 1) { + set_state(PART:"base", "selected", vl); + run_program(PROGRAM:"anim_unfocus"); + } else { + set_state(PART:"base", "default", vl); + run_program(PROGRAM:"anim_unfocus"); + } + + if(get_int(isDimmed) == 1) + { + set_state(PART:"elm.text.loopback", "default", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "dimmed.rtl", vl); + else + set_state(PART:"elm.text", "dimmed", vl); + } + else if( (get_int(isSelected) == 1) && (get_int(isFocused) == 1) ) + { + set_state(PART:"elm.text.loopback", "selected_focused", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "selected_focused.rtl", vl); + else + set_state(PART:"elm.text", "selected_focused", vl); + + } + else if(get_int(isFocused) == 1) + { + set_state(PART:"elm.text.loopback", "focused", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "focused.rtl", vl); + else + set_state(PART:"elm.text", "focused", vl); + } + else if(get_int(isSelected) == 1) + { + set_state(PART:"elm.text.loopback", "default", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "selected.rtl", vl); + else + set_state(PART:"elm.text", "selected", vl); + } + else + { + set_state(PART:"elm.text.loopback", "default", vl); + + if(get_int(g_is_rtl) == 1) + set_state(PART:"elm.text", "default.rtl", vl); + else + set_state(PART:"elm.text", "default", vl); + } + + } + } + + program { name: "to_rtl"; + signal: "edje,state,rtl"; source: "edje"; + script { + set_int( g_is_rtl , 1 ); + } + } + + program { name: "to_ltr"; + signal: "edje,state,ltr"; source: "edje"; + script { + set_int( g_is_rtl , 0 ); + } + } + + program { name: "start_slide_signal"; + signal: "text,slide,start"; source: ""; + in: 0.5 0.0; + script { + if(get_int(isFocused) == 1) { + start_slide(); + } + } + } + + program { name: "stop_slide_signal"; + signal: "text,slide,stop"; source: ""; + script { + stop_slide(); + } + } + + program { name: "default_common"; + signal: "elm,state,default"; source: "elm"; + script { + set_int(isFocused, 0); + } + after: "set_states"; + } + + program { name: "focus_common"; + signal: "elm,state,focused"; source: "elm"; + script { + set_int(isFocused, 1); + if(get_int(isDimmed) == 1) { + run_program(PROGRAM:"set_states"); + } else { + run_program(PROGRAM:"text_focus"); + } + } + } + + program { name: "sound_on_focus"; + signal: "elm,action,focused,sound"; source: "elm"; + action: RUN_PLUGIN "focus"; + } + + program { name: "sound_on_select"; + signal: "elm,action,selected,sound"; source: "elm"; + action: RUN_PLUGIN "select"; + } + + program { name: "sound_on_hold"; + signal: "elm,action,longpressed,sound"; source: "elm"; + action: RUN_PLUGIN "hold"; + } + + program { name: "unfocus_common"; + signal: "elm,state,unfocused"; source: "elm"; + script { + set_int(isFocused, 0); + if(get_int(isDimmed) == 1) { + run_program(PROGRAM:"set_states"); + } else { + run_program(PROGRAM:"stop_slide"); + } + } + } + + program { name: "selected_common"; + signal: "elm,state,selected"; source: "elm"; + script { + if(get_int(isDimmed) == 0) { + set_int(isSelected, 1); + } + } + after: "set_states"; + } + + program { name: "unselected_common"; + signal: "elm,state,unselected"; source: "elm"; + script { + set_int(isSelected, 0); + } + after: "set_states"; + } + + program { name: "text_focus"; + after: "start_slide"; + } + + program { name: "start_slide"; + script { + run_program(PROGRAM:"set_states"); + emit("text,slide,start", ""); + } + } + + program { name: "stop_slide"; + script { + emit("text,slide,stop", ""); + } + after: "set_states"; + } + + program { name: "enable"; + signal: "elm,state,enabled"; source: "elm"; + script { + set_int(isDimmed, 0); + } + after: "set_states"; + } + + program { name: "disable"; + signal: "elm,state,disabled"; source: "elm"; + script { + set_int(isDimmed, 1); + } + after: "set_states"; + } + + program { name: "undimmed"; + signal: "elm,state,undimmed"; source: "elm"; + script { + set_int(isDimmed, 0); + } + after: "set_states"; + } + + program { name: "dimmed"; + signal: "elm,state,dimmed"; source: "elm"; + script { + set_int(isDimmed, 1); + } + after: "set_states"; + } + } + } + group { name: "elm/picker"; + images { + image: "I01_picker_panel_bg.png" COMP; + image: "I01_picker_btn_02_normal.png" COMP; + image: "I01_picker_btn_02_press.png" COMP; + image: "I01_picker_btn_normal.png" COMP; + image: "I01_picker_arrow_left.png" COMP; + image: "I01_picker_arrow_right.png" COMP; + } + parts { + part { name: "bg"; + type: SWALLOW; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1 { relative: 0.0 1.0; } + rel2 { relative: 1.0 1.0; } + } + description { state: "show" 0.0; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0; offset: 0 2; } + } + description { state: "imf_panel" 0.0; + inherit: "show" 0.0; + visible: 0; + } + } + part { name: "elm.image.panel"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + min: 0 43; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.0; to: "bg"; } + image.normal: "I01_picker_panel_bg.png"; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + } + description { state: "imf_panel" 0.0; + inherit: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 1.0; to: "bg"; offset: 0 2; } + rel2 { relative: 1.0 1.0; to: "bg"; offset: 0 2; } + } + } + part { name: "padding.prev_bg.left"; + type: RECT; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 10 0; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "elm.image.panel"; } + rel2 { relative: 0.0 1.0; to: "elm.image.panel"; } + } + } + part { name: "elm.image.prev_bg"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 36 32; + max: 36 32; + fixed: 1 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: "padding.prev_bg.left"; to_y: "elm.image.panel"; } + rel2 { relative: 1.0 1.0; to_x: "padding.prev_bg.left"; to_y: "elm.image.panel"; } + image.normal: "I01_picker_btn_02_normal.png"; + image.border: 5 5 5 5; + } + description { state: "press" 0.0; + inherit: "default" 0.0; + visible: 1; + image.normal: "I01_picker_btn_02_press.png"; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "disable" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 150; + } + } + part { name: "elm.image.prev_arrow"; + type: IMAGE; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 16 16; + max: 16 16; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "elm.image.prev_bg"; } + rel2 { relative: 1.0 1.0; to: "elm.image.prev_bg"; } + image.normal: "I01_picker_arrow_left.png"; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "disable" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 150; + } + } + part { name: "padding.prev_bg.right"; + type: RECT; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 16 0; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 1.0 0.0; to: "elm.image.prev_bg"; } + rel2 { relative: 1.0 1.0; to: "elm.image.prev_bg"; } + } + } + part { name: "elm.image.next_bg"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 36 32; + max: 36 32; + fixed: 1 1; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to_x: "padding.prev_bg.right"; to_y: "elm.image.panel"; } + rel2 { relative: 1.0 1.0; to_x: "padding.prev_bg.right"; to_y: "elm.image.panel"; } + image.normal: "I01_picker_btn_02_normal.png"; + image.border: 5 5 5 5; + } + description { state: "press" 0.0; + inherit: "default" 0.0; + visible: 1; + image.normal: "I01_picker_btn_02_press.png"; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "disable" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 150; + } + } + part { name: "elm.image.next_arrow"; + type: IMAGE; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 16 16; + max: 16 16; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "elm.image.next_bg"; } + rel2 { relative: 1.0 1.0; to: "elm.image.next_bg"; } + image.normal: "I01_picker_arrow_right.png"; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "disable" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 150; + } + } + part { name: "padding.done_bg.right"; + type: RECT; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 10 0; + fixed: 1 0; + align: 1.0 0.0; + rel1 { relative: 1.0 0.0; to: "elm.image.panel"; } + rel2 { relative: 1.0 1.0; to: "elm.image.panel"; } + } + } + part { name: "elm.image.done_bg"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + min: 66 32; + max: 66 32; + fixed: 1 1; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to_x: "padding.done_bg.right"; to_y: "elm.image.panel"; } + rel2 { relative: 0.0 1.0; to_x: "padding.done_bg.right"; to_y: "elm.image.panel"; } + image.normal: "I01_picker_btn_02_normal.png"; + image.border: 5 5 5 5; + } + description { state: "press" 0.0; + inherit: "default" 0.0; + image.normal: "I01_picker_btn_02_press.png"; + } + } + part { name: "elm.text.done"; + type: TEXT; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 1; + fixed: 1 1; + rel1.to: "elm.image.done_bg"; + rel2.to: "elm.image.done_bg"; + color: 255 255 255 255; + text { + font: "Tizen:style=Medium"; + size: 16; + min: 1 1; + align: 0.5 0.5; + ellipsis: -1; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + fixed: 0 1; + rel1 { relative: 0.0 1.0; to: "elm.image.panel"; } + rel2 { relative: 1.0 1.0;} + } + description { state: "show" 0.0; + inherit: "default" 0.0; + } + description { state: "imf_panel" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + } + + programs { + program { + name: "prev_button_press"; + signal: "mouse,down,1"; + source: "elm.image.prev_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.prev_bg", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.image.prev_bg", "press", 0.0); + } + } + program { + name: "prev_button_release"; + signal: "mouse,up,1"; + source: "elm.image.prev_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.prev_bg", st, 30, vl); + if (!strcmp(st, "press")) + set_state(PART:"elm.image.prev_bg", "visible", 0.0); + } + } + program { + name: "next_button_press"; + signal: "mouse,down,1"; + source: "elm.image.next_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.next_bg", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.image.next_bg", "press", 0.0); + } + } + program { + name: "next_button_release"; + signal: "mouse,up,1"; + source: "elm.image.next_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.next_bg", st, 30, vl); + if (!strcmp(st, "press")) + set_state(PART:"elm.image.next_bg", "visible", 0.0); + } + } + program { + name: "done_button_press"; + signal: "mouse,down,1"; + source: "elm.image.done_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.done_bg", st, 30, vl); + if (!strcmp(st, "default")) + set_state(PART:"elm.image.done_bg", "press", 0.0); + } + } + program { + name: "done_button_release"; + signal: "mouse,up,1"; + source: "elm.image.done_bg"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.image.done_bg", st, 30, vl); + if (!strcmp(st, "press")) + set_state(PART:"elm.image.done_bg", "default", 0.0); + } + } + program { name: "show,picker"; + signal: "show,picker,signal"; + transition: LINEAR 0.4; + action: STATE_SET "show" 0.0; + target: "bg"; + target: "elm.image.panel"; + target: "elm.swallow.content"; + } + program { name: "show,picker_delay"; + signal: "show,picker_delay,signal"; + action: STATE_SET "show" 0.0; + in: 0.5 0.0; + target: "bg"; + target: "elm.image.panel"; + target: "elm.swallow.content"; + } + program { name: "hide,picker"; + signal: "hide,picker,signal"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "elm.image.panel"; + target: "elm.swallow.content"; + } + program { name: "show,prev_button"; + signal: "show,prev_button,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.image.prev_bg"; + target: "elm.image.prev_arrow"; + } + program { name: "hide,prev_button"; + signal: "hide,prev_button,signal"; + action: STATE_SET "default" 0.0; + target: "elm.image.prev_bg"; + target: "elm.image.prev_arrow"; + } + program { name: "enable,prev_button"; + signal: "enable,prev_button,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.image.prev_bg"; + target: "elm.image.prev_arrow"; + } + program { name: "disable,prev_button"; + signal: "disable,prev_button,signal"; + action: STATE_SET "disable" 0.0; + target: "elm.image.prev_bg"; + target: "elm.image.prev_arrow"; + } + program { name: "show,next_button"; + signal: "show,next_button,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.image.next_bg"; + target: "elm.image.next_arrow"; + } + program { name: "hide,next_button"; + signal: "hide,next_button,signal"; + action: STATE_SET "default" 0.0; + target: "elm.image.next_bg"; + target: "elm.image.next_arrow"; + } + program { name: "enable,next_button"; + signal: "enable,next_button,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.image.next_bg"; + target: "elm.image.next_arrow"; + } + program { name: "disable,next_button"; + signal: "disable,next_button,signal"; + action: STATE_SET "disable" 0.0; + target: "elm.image.next_bg"; + target: "elm.image.next_arrow"; + } + program { name: "show,imf_panel"; + signal: "show,imf_panel,signal"; + action: STATE_SET "imf_panel" 0.0; + target: "bg"; + target: "elm.image.panel"; + target: "elm.swallow.content"; + } + } + } +} diff --git a/tizen_src/ewk/efl_integration/resource/images/highlight_stroke.png b/tizen_src/ewk/efl_integration/resource/images/highlight_stroke.png new file mode 100644 index 0000000000000000000000000000000000000000..aeed88a3ed247d4c88c999e728c9f8b1d622d58a GIT binary patch literal 1134 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%xak-5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8l;|;8yV;tSX!AHTNxNBK!Fm_wxX0Ys~{IQs9ivwtx`rwNr9EVetCJh zUb(Seeo?xG?WUP)qwZeFo6%mkOz;^d;tf|AVqJOz-6iAnjT zCALaHmqNUdTj1*pH#n~t8c@I>)2~P@&^OdG(9g{U`3tPNxFjeQ;S8**i$f|4QuTvU zi}Op1l7aD&rVP^z3_JW5ffNE=W95>cT$-DjSK{ens{|C$OUX>JGBI~^b~Uwdu{1F> zF*F3SoDG~D-OQYgj9e_uESz0ndOh=sOA_;vQ(<~D5qh2R>a}t%N=+=uFAB-e&w<5W zKt_H^esM;Afr7I$IJOit!ZY(y^2>`gLBR`kZE8_wS!#+~QGTuhIDD)!vADt2$kfcz z!ps!t24j%>9i1#poQw?2P0dUl9gU35m7sc4u=pLS*9@m#eV}9XL6M6T*)Sns3IZ|V zNf*e0C;rqtV2UpSChhB~FD?MH#XV0K$B>F!Z>DeLI;McVLW5Qb+&|sM?S622wU;bPPU#!g2CrjiZs{EhZ8_0fTydU J%Q~loCIBZ;fo%W) literal 0 HcmV?d00001 diff --git a/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down.png b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down.png new file mode 100644 index 0000000000000000000000000000000000000000..23cc8ee38e6bb807988c12b2c49f1da64d500007 GIT binary patch literal 3183 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 literal 0 HcmV?d00001 diff --git a/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up_f.png b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up_f.png new file mode 100644 index 0000000000000000000000000000000000000000..252633752a7ac81f5f5520454b61a242da07ef9b GIT binary patch literal 3200 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::move(items), selected_item, - allow_multiple_selection); + allow_multiple_selection, bounds); } void WebContentsEflDelegateEwk::HidePopupMenu() { diff --git a/tizen_src/ewk/efl_integration/web_contents_observer_efl.cc b/tizen_src/ewk/efl_integration/web_contents_observer_efl.cc index c48e996..8917a69 100644 --- a/tizen_src/ewk/efl_integration/web_contents_observer_efl.cc +++ b/tizen_src/ewk/efl_integration/web_contents_observer_efl.cc @@ -335,8 +335,11 @@ void WebContentsObserverEfl::OnRequestSelectCollectionInformationUpdateACK( int current_node_index, bool prev_state, bool next_state) { - web_view_->UpdateFormNavigation(form_element_count, current_node_index, - prev_state, next_state); + if (!web_view_->GetSelectPicker()) + return; + + web_view_->GetSelectPicker()->UpdateFormNavigation(form_element_count, + current_node_index); } void WebContentsObserverEfl::OnDidChangeMaxScrollOffset(int max_scroll_x, -- 2.7.4 From 1e02ce79e20fde26e8b1b5f8414e1ea526f90440 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Thu, 16 Feb 2023 10:30:11 +0530 Subject: [PATCH 03/16] [M108 Migration] Remove EWK_BRINGUP from ewk APIs and HttpUserAgentSettingsEfl This patch migrates the following changes: 1. Remove EWK_BRINGUP from HttpUserAgentSettingsEfl 2. Remove EWK_BRINGUP for ewk_view_plain_text_get() 3. Remove EWK_BRINGUP from ewk_hit_test_private.cc It also cleans up code in eweb_view.h Reference: https://review.tizen.org/gerrit/283824 https://review.tizen.org/gerrit/282993 https://review.tizen.org/gerrit/281104 https://review.tizen.org/gerrit/280592 Change-Id: If85b186ec8dc30064fd008e74c897064b03fff17 Signed-off-by: Ayush Kumar --- third_party/blink/renderer/core/exported/BUILD.gn | 10 ++++++++++ .../third_party/blink/renderer/core/core_efl.gni | 5 +++++ .../ewk/efl_integration/common/render_messages_ewk.h | 3 +-- tizen_src/ewk/efl_integration/eweb_view.cc | 16 ++++++---------- tizen_src/ewk/efl_integration/eweb_view.h | 6 ------ .../ewk/efl_integration/http_user_agent_settings_efl.cc | 6 +----- .../ewk/efl_integration/private/ewk_hit_test_private.cc | 9 ++++----- .../renderer/render_frame_observer_efl.cc | 17 +++++++++++++++++ .../renderer/render_frame_observer_efl.h | 1 + 9 files changed, 45 insertions(+), 28 deletions(-) diff --git a/third_party/blink/renderer/core/exported/BUILD.gn b/third_party/blink/renderer/core/exported/BUILD.gn index 7c48a03..2fb2584 100644 --- a/third_party/blink/renderer/core/exported/BUILD.gn +++ b/third_party/blink/renderer/core/exported/BUILD.gn @@ -4,6 +4,11 @@ import("//third_party/blink/renderer/core/core.gni") import("//third_party/blink/renderer/core/exported/build.gni") +if (use_efl) { + import( + "//tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni") +} + static_library("test_support") { testonly = true @@ -21,6 +26,11 @@ static_library("test_support") { blink_core_sources("exported") { sources = blink_core_sources_exported + # TODO: Move this to tizen_src/ewk/efl_integration/BUILD.gn + if (use_efl) { + sources += external_webkit_core_exported_sources + } + deps = [ "//build:chromeos_buildflags", "//third_party/blink/renderer/core:core_generated", diff --git a/tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni b/tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni index bacbb9c..ab38f8b 100644 --- a/tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni +++ b/tizen_src/chromium_impl/third_party/blink/renderer/core/core_efl.gni @@ -19,3 +19,8 @@ external_webkit_core_layout_sources = [ # For //third_party/blink/renderer/core:core_generated target external_webkit_core_generated_deps = [ "//tizen_src/chromium_impl/tizen:system-info" ] + +external_webkit_core_exported_sources = [ + "//third_party/blink/public/test/test_web_frame_content_dumper.h", + "//third_party/blink/renderer/core/exported/test_web_frame_content_dumper.cc", +] diff --git a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h index 0d397e1..f4b972d 100644 --- a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h +++ b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h @@ -156,8 +156,7 @@ IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll, int, /* horizontal position */ int /* vertical position */) -IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet, - int /* callback id */) +IPC_MESSAGE_ROUTED1(EwkFrameMsg_GetPlainText, int /* callback id */) IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl) diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index 8569807..cfa4506 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -1805,17 +1805,13 @@ int EWebView::SetEwkViewPlainTextGetCallback( bool EWebView::PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback, void* user_data) { - RenderViewHost* render_view_host = web_contents_->GetRenderViewHost(); - if (!render_view_host) + auto* render_frame_host = web_contents_->GetPrimaryMainFrame(); + if (!render_frame_host) return false; -#if !defined(EWK_BRINGUP) // FIXME: m94 bringup - int plain_text_get_callback_id = - SetEwkViewPlainTextGetCallback(callback, user_data); - return render_view_host->Send(new EwkViewMsg_PlainTextGet( - render_view_host->GetRoutingID(), plain_text_get_callback_id)); -#else - return false; -#endif + + auto callback_id = SetEwkViewPlainTextGetCallback(callback, user_data); + return render_frame_host->Send(new EwkFrameMsg_GetPlainText( + render_frame_host->GetRoutingID(), callback_id)); } void EWebView::InvokePlainTextGetCallback(const std::string& content_text, diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index ee88fa3..27fb2af 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -5,12 +5,6 @@ #ifndef EWEB_VIEW_H #define EWEB_VIEW_H -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup -// FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to -// include instead. -#include -#endif - #include #include #include diff --git a/tizen_src/ewk/efl_integration/http_user_agent_settings_efl.cc b/tizen_src/ewk/efl_integration/http_user_agent_settings_efl.cc index 0f33529..ae9e1c1 100644 --- a/tizen_src/ewk/efl_integration/http_user_agent_settings_efl.cc +++ b/tizen_src/ewk/efl_integration/http_user_agent_settings_efl.cc @@ -18,9 +18,5 @@ std::string HttpUserAgentSettingsEfl::GetAcceptLanguage() const { } std::string HttpUserAgentSettingsEfl::GetUserAgent() const { -#if !defined(EWK_BRINGUP) // FIXME: m73 bringup - return content::GetContentClientExport()->GetUserAgent(); -#else - return std::string(); -#endif + return content::GetContentClientExport()->browser()->GetUserAgent(); } diff --git a/tizen_src/ewk/efl_integration/private/ewk_hit_test_private.cc b/tizen_src/ewk/efl_integration/private/ewk_hit_test_private.cc index ead2b27..2e55044c 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_hit_test_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_hit_test_private.cc @@ -44,11 +44,10 @@ _Ewk_Hit_Test::Hit_Test_Node_Data::~Hit_Test_Node_Data() { //(warning) deep copy of skia buffer. _Ewk_Hit_Test::Hit_Test_Image_Buffer::Hit_Test_Image_Buffer(const Hit_Test_Params::Image_Data& data): fileNameExtension(data.fileNameExtension) { -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - // FIXME: [M63_3239] - // error: ‘const class SkBitmap’ has no member named ‘deepCopyTo’ - data.imageBitmap.deepCopyTo(&(imageBitmap)); -#endif + if (imageBitmap.tryAllocPixels(data.imageBitmap.info())) { + data.imageBitmap.readPixels(imageBitmap.info(), imageBitmap.getPixels(), + imageBitmap.rowBytes(), 0, 0); + } } diff --git a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc index 19fc4e7..30e9096 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc @@ -16,6 +16,7 @@ #include "third_party/blink/public/platform/url_conversion.h" #include "third_party/blink/public/platform/web_url_error.h" #include "third_party/blink/public/platform/web_url_request.h" +#include "third_party/blink/public/test/test_web_frame_content_dumper.h" #include "third_party/blink/public/web/web_document.h" #include "third_party/blink/public/web/web_element.h" #include "third_party/blink/public/web/web_element_collection.h" @@ -85,6 +86,7 @@ bool RenderFrameObserverEfl::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(EwkFrameMsg_LoadNotFoundErrorPage, OnLoadNotFoundErrorPage) IPC_MESSAGE_HANDLER(EwkFrameMsg_MoveToNextOrPreviousSelectElement, OnMoveToNextOrPreviousSelectElement) IPC_MESSAGE_HANDLER(EwkFrameMsg_RequestSelectCollectionInformation, OnRequestSelectCollectionInformation); + IPC_MESSAGE_HANDLER(EwkFrameMsg_GetPlainText, OnGetPlainText); IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -224,4 +226,19 @@ void RenderFrameObserverEfl::WillReleaseScriptContext( render_frame()->GetWebFrame(), context, world_id); } +void RenderFrameObserverEfl::OnGetPlainText(int callback_id) { + std::string content; + + // WebFrameContentDumper should only be used for testing purposes. + // See http://crbug.com/585164. + if (auto* web_view = render_frame()->GetWebView()) { + content = blink::TestWebFrameContentDumper::DumpWebViewAsText( + web_view, std::numeric_limits::max()) + .Utf8(); + } + + Send(new EwkHostMsg_PlainTextGetContents(render_frame()->GetRoutingID(), + content, callback_id)); +} + } // namespace content diff --git a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h index 9f3dfe2..0d9098b 100644 --- a/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h +++ b/tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h @@ -64,6 +64,7 @@ class RenderFrameObserverEfl : public RenderFrameObserver { void OnMoveToNextOrPreviousSelectElement(bool direction); void OnRequestSelectCollectionInformation(); + void OnGetPlainText(int callback_id); gfx::Size max_scroll_offset_; gfx::Size last_scroll_offset_; -- 2.7.4 From 0aa761b53006cc12cbfb1e5303cae49ba2656037 Mon Sep 17 00:00:00 2001 From: Bakka Uday Kiran Date: Thu, 16 Feb 2023 13:40:27 +0530 Subject: [PATCH 04/16] [M108 Migration] Enable ATK_STATE_SHOWING for TV platform Below change enables setting ATK_STATE_SHOWING state for accessibility nodes on TV platform. Reference: https://review.tizen.org/gerrit/c/283258 Change-Id: I6fb7ec1d4a28d5b3f65bdcda937691f5af24f8d9 Signed-off-by: Bakka Uday Kiran --- ui/accessibility/platform/ax_platform_node_auralinux.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/accessibility/platform/ax_platform_node_auralinux.cc b/ui/accessibility/platform/ax_platform_node_auralinux.cc index b02ca80..fedd0c1 100644 --- a/ui/accessibility/platform/ax_platform_node_auralinux.cc +++ b/ui/accessibility/platform/ax_platform_node_auralinux.cc @@ -3244,7 +3244,7 @@ void AXPlatformNodeAuraLinux::GetAtkState(AtkStateSet* atk_state_set) { atk_state_set_add_state(atk_state_set, ATK_STATE_HORIZONTAL); if (!IsInvisibleOrIgnored()) { atk_state_set_add_state(atk_state_set, ATK_STATE_VISIBLE); -#if !defined(TIZEN_ATK_SUPPORT) +#if BUILDFLAG(IS_TIZEN_TV) if (!delegate_->IsOffscreen() && !is_minimized) atk_state_set_add_state(atk_state_set, ATK_STATE_SHOWING); #endif -- 2.7.4 From 9a51c61aef4c9c9dc398cf3e7b0eb56a4375ba92 Mon Sep 17 00:00:00 2001 From: xiafeng Date: Sat, 18 Feb 2023 14:07:57 +0800 Subject: [PATCH 05/16] [M108 Migration][VD][Accessibility] Support ewk_settings_spatial_navigation_enabled_set Support ewk_settings_spatial_navigation_enabled_set. Related M94 Aura patch: https://review.tizen.org/gerrit/279760/ Change-Id: Ic8b97b41b89d2a3e1766c65636f0ce743dc85d2d Signed-off-by: xiafeng --- tizen_src/ewk/efl_integration/public/ewk_settings.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tizen_src/ewk/efl_integration/public/ewk_settings.cc b/tizen_src/ewk/efl_integration/public/ewk_settings.cc index 18b4e36..2891cd8 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_settings.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_settings.cc @@ -910,9 +910,16 @@ Eina_Bool ewk_settings_viewport_meta_tag_get(const Ewk_Settings *settings) return EINA_FALSE; } -void ewk_settings_spatial_navigation_enabled_set(Ewk_Settings* settings, Eina_Bool Enabled) +void ewk_settings_spatial_navigation_enabled_set(Ewk_Settings* settings, Eina_Bool enable) { +#if defined(OS_TIZEN_TV_PRODUCT) + EINA_SAFETY_ON_NULL_RETURN(settings); + LOG(INFO)<<"ewk_settings_spatial_navigation_enabled_set, enabled: " <<(bool)enable; + settings->getPreferences().spatial_navigation_enabled = !!enable; + ewkUpdateWebkitPreferences(settings->getEvasObject()); +#else LOG_EWK_API_MOCKUP(); +#endif } void ewk_settings_ime_panel_enabled_set(Ewk_Settings* settings, Eina_Bool Enabled) -- 2.7.4 From ba7c214f0f5928edeac88545d5b8e74200604cb1 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 17 Feb 2023 09:19:05 +0530 Subject: [PATCH 06/16] [M108 Migration] Add ewk_intercept_request_view_get() This patch adds a new internal API that provides ewk view object requesting the resource. Reference: https://review.tizen.org/gerrit/282794 Change-Id: I7c7cc588c5013d6136453d7921625b914d6ae99f Signed-off-by: Ayush Kumar --- .../browser/intercept_request_params.h | 2 ++ .../proxying_url_loader_factory_efl.cc | 19 +++++++++++++++++-- .../network_service/proxying_url_loader_factory_efl.h | 4 ++++ .../ewk/efl_integration/content_browser_client_efl.cc | 3 ++- .../private/ewk_intercept_request_private.cc | 1 + .../private/ewk_intercept_request_private.h | 3 +++ .../efl_integration/public/ewk_intercept_request.cc | 6 ++++++ .../public/ewk_intercept_request_internal.h | 18 ++++++++++++++++++ 8 files changed, 53 insertions(+), 3 deletions(-) diff --git a/tizen_src/ewk/efl_integration/browser/intercept_request_params.h b/tizen_src/ewk/efl_integration/browser/intercept_request_params.h index 0f0b753..9db19cd 100644 --- a/tizen_src/ewk/efl_integration/browser/intercept_request_params.h +++ b/tizen_src/ewk/efl_integration/browser/intercept_request_params.h @@ -7,6 +7,7 @@ #include +#include "eweb_view.h" #include "net/base/upload_data_stream.h" #include "net/http/http_request_headers.h" #include "url/gurl.h" @@ -16,6 +17,7 @@ struct InterceptRequestParams { InterceptRequestParams(const InterceptRequestParams& params) = default; ~InterceptRequestParams() = default; + EWebView* web_view = nullptr; GURL url; std::string method = "GET"; net::HttpRequestHeaders headers; diff --git a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc index df5dea7..cfc9226 100644 --- a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc @@ -7,6 +7,7 @@ #include "base/task/thread_pool.h" #include "browser/intercept_request_params.h" #include "browser/network_service/proxying_url_loader_efl.h" +#include "common/web_contents_utils.h" #include "content/public/browser/browser_thread.h" #include "net/base/elements_upload_data_stream.h" #include "net/base/upload_bytes_element_reader.h" @@ -62,24 +63,37 @@ class FileElementReader : public net::UploadFileElementReader { scoped_refptr resource_request_body_; }; +EWebView* GetWebViewFromFrameTreeNodeId(int frame_tree_node_id) { + auto* web_content = + content::WebContents::FromFrameTreeNodeId(frame_tree_node_id); + if (!web_content) + return nullptr; + return web_contents_utils::WebViewFromWebContents(web_content); +} + } // namespace // static void ProxyingURLLoaderFactoryEfl::CreateProxy( + int frame_tree_node_id, content::BrowserContextEfl::ResourceContextEfl* resource_context, mojo::PendingReceiver loader_receiver, mojo::PendingRemote target_factory_remote) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - new ProxyingURLLoaderFactoryEfl(resource_context, std::move(loader_receiver), + new ProxyingURLLoaderFactoryEfl(frame_tree_node_id, resource_context, + std::move(loader_receiver), std::move(target_factory_remote)); } ProxyingURLLoaderFactoryEfl::ProxyingURLLoaderFactoryEfl( + int frame_tree_node_id, content::BrowserContextEfl::ResourceContextEfl* resource_context, mojo::PendingReceiver loader_receiver, mojo::PendingRemote target_factory_remote) - : resource_context_(resource_context), weak_ptr_factory_(this) { + : frame_tree_node_id_(frame_tree_node_id), + resource_context_(resource_context), + weak_ptr_factory_(this) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); if (target_factory_remote) { target_factory_.Bind(std::move(target_factory_remote)); @@ -129,6 +143,7 @@ void ProxyingURLLoaderFactoryEfl::CreateLoaderAndStart( mojo::PendingRemote client, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) { InterceptRequestParams params; + params.web_view = GetWebViewFromFrameTreeNodeId(frame_tree_node_id_); params.url = request.url; params.method = request.method; params.headers = request.headers; diff --git a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.h b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.h index 2626a3d..bd1a788 100644 --- a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.h +++ b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.h @@ -19,6 +19,7 @@ class ResourceContext; class ProxyingURLLoaderFactoryEfl : public network::mojom::URLLoaderFactory { public: static void CreateProxy( + int frame_tree_node_id, content::BrowserContextEfl::ResourceContextEfl* resource_context, mojo::PendingReceiver loader_receiver, mojo::PendingRemote @@ -40,6 +41,7 @@ class ProxyingURLLoaderFactoryEfl : public network::mojom::URLLoaderFactory { loader_receiver) override; ProxyingURLLoaderFactoryEfl( + int frame_tree_node_id, content::BrowserContextEfl::ResourceContextEfl* resource_context, mojo::PendingReceiver loader_receiver, mojo::PendingRemote @@ -55,6 +57,8 @@ class ProxyingURLLoaderFactoryEfl : public network::mojom::URLLoaderFactory { network::ResourceRequestBody* body, base::SingleThreadTaskRunner* file_task_runner); + int frame_tree_node_id_; + content::BrowserContextEfl::ResourceContextEfl* resource_context_; mojo::ReceiverSet proxy_receivers_; diff --git a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc index f7777a2..cc199f7 100644 --- a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc +++ b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc @@ -584,7 +584,8 @@ bool ContentBrowserClientEfl::WillCreateURLLoaderFactory( GetIOThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce(&ProxyingURLLoaderFactoryEfl::CreateProxy, - resource_context_efl, std::move(proxied_receiver), + frame->GetFrameTreeNodeId(), resource_context_efl, + std::move(proxied_receiver), std::move(target_factory_remote))); return true; } diff --git a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc index 2de0d02..8f71d28 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc @@ -36,6 +36,7 @@ _Ewk_Intercept_Request::_Ewk_Intercept_Request( response_status_code_(-1), ignored_(false), chunked_write_(false) { + ewk_view_ = params.web_view ? params.web_view->evas_object() : nullptr; request_headers_ = eina_hash_string_small_new(_headers_entry_free_cb); net::HttpRequestHeaders::Iterator current_header(params.headers); while (current_header.GetNext()) { diff --git a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h index a829724..a3a7fc8 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h +++ b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h @@ -11,6 +11,7 @@ #include #include +#include #include "base/synchronization/atomic_flag.h" @@ -39,6 +40,7 @@ struct _Ewk_Intercept_Request { // functions so user can use EWK API to get info about intercepted request // to make a decision + Evas_Object* ewk_view() const { return ewk_view_; } const char* request_scheme_get() const { return request_scheme_.c_str(); } const char* request_url_get() const { return request_url_.c_str(); } const char* request_http_method_get() const { @@ -85,6 +87,7 @@ struct _Ewk_Intercept_Request { Delegate* delegate_; + Evas_Object* ewk_view_; std::string request_scheme_; std::string request_url_; std::string request_http_method_; diff --git a/tizen_src/ewk/efl_integration/public/ewk_intercept_request.cc b/tizen_src/ewk/efl_integration/public/ewk_intercept_request.cc index b29fbb8..2011d41 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_intercept_request.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_intercept_request.cc @@ -130,3 +130,9 @@ int64_t ewk_intercept_request_body_length_get( EINA_SAFETY_ON_NULL_RETURN_VAL(intercept_request, -1); return intercept_request->request_body_length_get(); } + +Evas_Object* ewk_intercept_request_view_get( + Ewk_Intercept_Request* intercept_request) { + EINA_SAFETY_ON_NULL_RETURN_VAL(intercept_request, NULL); + return intercept_request->ewk_view(); +} \ No newline at end of file diff --git a/tizen_src/ewk/efl_integration/public/ewk_intercept_request_internal.h b/tizen_src/ewk/efl_integration/public/ewk_intercept_request_internal.h index ec0ba4b..f8c6a02 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_intercept_request_internal.h +++ b/tizen_src/ewk/efl_integration/public/ewk_intercept_request_internal.h @@ -27,6 +27,7 @@ #define EWK_EFL_INTEGRATION_PUBLIC_EWK_INTERCEPT_REQUEST_INTERNAL_H_ #include +#include #include #include "ewk_intercept_request.h" @@ -87,6 +88,23 @@ EXPORT_API const char* ewk_intercept_request_body_get( EXPORT_API int64_t ewk_intercept_request_body_length_get( Ewk_Intercept_Request* intercept_request); +/** + * @brief Returns the ewk view object that is requesting the resource. + * + * @remarks It is only allowed to use this function *inside* the + * Ewk_Context_Intercept_Request_Callback. + * + * @since_tizen 7.0 + * + * @param[in] intercept_request intercept request instance received from + * Ewk_Context_Intercept_Request_Callback ewk_context callback + * + * @return The view object on success,\n + * otherwise @c NULL on failure + */ +EXPORT_API Evas_Object* ewk_intercept_request_view_get( + Ewk_Intercept_Request* intercept_request); + #ifdef __cplusplus } #endif -- 2.7.4 From 2515c38ceb5d038b83e1fd4cbfc7502bf5afae3a Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 17 Feb 2023 08:32:59 +0530 Subject: [PATCH 07/16] [M108 Migration][Accessibility] Support atk in select picker This patch is for supporting atk in select picker. Reference: https://review.tizen.org/gerrit/280726 Change-Id: I4b8f83a18b6963a5ff8bc6c938d0b3bf2a3f562e Signed-off-by: Ayush Kumar --- .../browser/select_picker/select_picker_base.cc | 29 +++++- .../browser/select_picker/select_picker_base.h | 7 ++ .../select_picker/select_picker_mobile_base.cc | 106 +++++++++++++++++++++ .../select_picker/select_picker_mobile_base.h | 24 +++++ .../browser/select_picker/select_picker_tv_base.cc | 3 + .../browser/select_picker/select_picker_util.cc | 26 ++++- .../browser/select_picker/select_picker_util.h | 13 ++- .../browser/select_picker/select_picker_mobile.cc | 6 ++ .../browser/select_picker/select_picker_mobile.h | 4 + .../browser/select_picker/select_picker_tv.cc | 6 ++ .../browser/select_picker/select_picker_tv.h | 4 + 11 files changed, 224 insertions(+), 4 deletions(-) diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc index a4668c7..18d11e3 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc @@ -194,18 +194,41 @@ void SelectPickerBase::InitializeSelectedPickerData( bool need_scroll_to_top = true; for (size_t index = 0; index < items.size(); index++) { bool checked = items[index]->checked; - auto data = new GenlistCallbackData( +#if defined(TIZEN_ATK_SUPPORT) + auto* data = new GenlistCallbackData(index, this, std::move(items[index]), + popup_list_, item_class_, group_class_, + is_multiple_selection_, + ItemSelectedCallback, GetAtkStatus()); + + // Save first item for atk + if (!index) { + first_item_ = data->GetElmItem(); + selected_item_ = data->GetElmItem(); + } +#else + auto* data = new GenlistCallbackData( index, this, std::move(items[index]), popup_list_, item_class_, group_class_, is_multiple_selection_, ItemSelectedCallback); +#endif if (is_multiple_selection_ && checked) { selected_indexes_.push_back(index); if (need_scroll_to_top) { data->ScrollToTop(); need_scroll_to_top = false; +#if defined(TIZEN_ATK_SUPPORT) + // Save selected item for atk with multiple selection + selected_item_ = data->GetElmItem(); +#endif } } select_picker_data_.push_back(data); +#if defined(TIZEN_ATK_SUPPORT) + // Save selected item for atk + if (base::checked_cast(index) == selected_index_ && + !is_multiple_selection_) + selected_item_ = data->GetElmItem(); +#endif } if (is_multiple_selection_) { @@ -220,6 +243,10 @@ void SelectPickerBase::InitializeSelectedPickerData( void SelectPickerBase::Show() { evas_object_show(layout_); +#if defined(TIZEN_ATK_SUPPORT) + if (GetAtkStatus()) + elm_atspi_component_highlight_grab(selected_item_); +#endif } void SelectPickerBase::Hide() { diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h index 95d62a6..0900cbe 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h @@ -55,6 +55,13 @@ class SelectPickerBase { virtual content::WebContentsViewAura* wcva() const { return nullptr; } +#if defined(TIZEN_ATK_SUPPORT) + virtual bool GetAtkStatus() = 0; + + Elm_Object_Item* first_item_ = nullptr; + Elm_Object_Item* selected_item_ = nullptr; +#endif + Evas_Object* evas_object_; Evas_Object* popup_list_; Evas_Object* layout_; diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc index 55ae1ab..1d1d1a0 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc @@ -17,6 +17,12 @@ namespace { const char* const kChangedCbName = "changed"; +#if defined(TIZEN_ATK_SUPPORT) +const char* const kImagePrevBgObj = "elm.image.prev_bg"; +const char* const kImageNextBgObj = "elm.image.next_bg"; +const char* const kImageDoneBgObj = "elm.image.done_bg"; +#endif + void RadioIconChangedCallback(void* data, Evas_Object* obj, void* event_info) { auto callback_data = static_cast(data); callback_data->SetSelection(true); @@ -35,10 +41,98 @@ SelectPickerMobileBase::SelectPickerMobileBase(Evas_Object* evas_object, } SelectPickerMobileBase::~SelectPickerMobileBase() { +#if defined(TIZEN_ATK_SUPPORT) + RemoveAtkObject(); +#endif Hide(); DestroyRadioList(); } +#if defined(TIZEN_ATK_SUPPORT) +Eina_Bool SelectPickerMobileBase::AccessNavigateToPrevCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info) { + auto* picker = static_cast(data); + picker->FormNavigate(false); + return EINA_TRUE; +} + +Eina_Bool SelectPickerMobileBase::AccessNavigateToNextCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info) { + auto* picker = static_cast(data); + picker->FormNavigate(true); + return EINA_TRUE; +} + +Eina_Bool SelectPickerMobileBase::AccessDoneCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info) { + auto* picker = static_cast(data); + picker->HidePopupMenu(); + return EINA_TRUE; +} + +void SelectPickerMobileBase::AddAtkObject() { + auto* edje_obj = elm_layout_edje_get(layout_); + + prev_button_ = + (Evas_Object*)edje_object_part_object_get(edje_obj, kImagePrevBgObj); + ao_prev_button_ = elm_access_object_register(prev_button_, layout_); + elm_atspi_accessible_name_set( + ao_prev_button_, dgettext("WebKit", "IDS_WEBVIEW_BUTTON_PREV_ABB")); + elm_atspi_accessible_reading_info_type_set( + ao_prev_button_, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + + next_button_ = + (Evas_Object*)edje_object_part_object_get(edje_obj, kImageNextBgObj); + ao_next_button_ = elm_access_object_register(next_button_, layout_); + elm_atspi_accessible_name_set( + ao_next_button_, dgettext("WebKit", "IDS_WEBVIEW_BUTTON_NEXT_ABB3")); + elm_atspi_accessible_reading_info_type_set( + ao_next_button_, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + + done_button_ = + (Evas_Object*)edje_object_part_object_get(edje_obj, kImageDoneBgObj); + ao_done_button_ = elm_access_object_register(done_button_, layout_); + elm_atspi_accessible_name_set(ao_done_button_, + dgettext("WebKit", "IDS_WEBVIEW_BUTTON_DONE")); + elm_atspi_accessible_reading_info_type_set( + ao_done_button_, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + + elm_access_action_cb_set(ao_prev_button_, ELM_ACCESS_ACTION_ACTIVATE, + AccessNavigateToPrevCallback, this); + elm_access_action_cb_set(ao_next_button_, ELM_ACCESS_ACTION_ACTIVATE, + AccessNavigateToNextCallback, this); + elm_access_action_cb_set(ao_done_button_, ELM_ACCESS_ACTION_ACTIVATE, + AccessDoneCallback, this); + + elm_atspi_accessible_relationship_append( + ao_done_button_, ELM_ATSPI_RELATION_FLOWS_TO, first_item_); + elm_atspi_accessible_relationship_append( + first_item_, ELM_ATSPI_RELATION_FLOWS_FROM, ao_done_button_); +} + +void SelectPickerMobileBase::RemoveAtkObject() { + if (ao_done_button_) { + elm_atspi_accessible_relationship_remove( + ao_done_button_, ELM_ATSPI_RELATION_FLOWS_TO, first_item_); + elm_atspi_accessible_relationship_remove( + first_item_, ELM_ATSPI_RELATION_FLOWS_FROM, ao_done_button_); + } + + if (prev_button_) + elm_access_object_unregister(prev_button_); + if (next_button_) + elm_access_object_unregister(next_button_); + if (done_button_) + elm_access_object_unregister(done_button_); +} +#endif + void SelectPickerMobileBase::Init(std::vector items, const gfx::Rect& bounds) { // Request form navigation information as early as possible, @@ -107,6 +201,10 @@ void SelectPickerMobileBase::ItemSelected(GenlistCallbackData* data, selected_index_ = data->GetIndex(); DidSelectPopupMenuItem(); } +#if defined(TIZEN_ATK_SUPPORT) + if (GetAtkStatus()) + HidePopupMenu(); +#endif } void SelectPickerMobileBase::CreateAndPopulatePopupList( @@ -120,8 +218,13 @@ void SelectPickerMobileBase::CreateAndPopulatePopupList( elm_object_focus_allow_set(popup_list_, false); +#if defined(TIZEN_ATK_SUPPORT) + if (GetAtkStatus()) + item_class_->func.content_get = nullptr; +#else item_class_->func.content_get = is_multiple_selection_ ? nullptr : IconGetCallback; +#endif elm_genlist_multi_select_set(popup_list_, is_multiple_selection_); @@ -147,6 +250,9 @@ void SelectPickerMobileBase::CreateAndPopulatePopupList( } elm_object_part_content_set(layout_, "elm.swallow.content", popup_list_); +#if defined(TIZEN_ATK_SUPPORT) + AddAtkObject(); +#endif } gfx::Rect SelectPickerMobileBase::GetGeometryDIP() const { diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h index a60b360..5f67184 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h @@ -33,6 +33,30 @@ class SelectPickerMobileBase : public FormNavigablePicker { void DestroyRadioList(); +#if defined(TIZEN_ATK_SUPPORT) + void AddAtkObject(); + void RemoveAtkObject(); + + static Eina_Bool AccessNavigateToPrevCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info); + static Eina_Bool AccessNavigateToNextCallback( + void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info); + static Eina_Bool AccessDoneCallback(void* data, + Evas_Object* obj, + Elm_Access_Action_Info* action_info); + + Evas_Object* prev_button_ = nullptr; + Evas_Object* next_button_ = nullptr; + Evas_Object* done_button_ = nullptr; + Evas_Object* ao_prev_button_ = nullptr; + Evas_Object* ao_next_button_ = nullptr; + Evas_Object* ao_done_button_ = nullptr; +#endif + Evas_Object* radio_main_; }; diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc index 1422a45..219b5aa 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc @@ -50,6 +50,9 @@ void SelectPickerTvBase::CreateAndPopulatePopupList( item_class_->func.content_get = nullptr; elm_genlist_multi_select_set(popup_list_, is_multiple_selection_); InitializeSelectedPickerData(std::move(items)); +#if defined(TIZEN_ATK_SUPPORT) + elm_genlist_item_selected_set(selected_item_, EINA_TRUE); +#endif elm_object_part_content_set(layout_, "elm.swallow.content", popup_list_); elm_object_scale_set(popup_list_, kBoxRatio); } diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc index 5cc09fa..993d88a 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc @@ -14,10 +14,20 @@ GenlistCallbackData::GenlistCallbackData( const Elm_Genlist_Item_Class* item_class, const Elm_Genlist_Item_Class* group_class, bool is_multiple_selection, - Evas_Smart_Cb item_selected_cb) + Evas_Smart_Cb item_selected_cb +#if defined(TIZEN_ATK_SUPPORT) + , + bool atk_enabled +#endif + ) : index_(index), select_picker_(select_picker), - menu_item_(std::move(menu_item)) { + menu_item_(std::move(menu_item)) +#if defined(TIZEN_ATK_SUPPORT) + , + atk_enabled_(atk_enabled) +#endif +{ bool is_option_type = (menu_item_->type == blink::mojom::MenuItem::Type::kOption); elm_item_ = elm_genlist_item_append( @@ -33,7 +43,13 @@ GenlistCallbackData::GenlistCallbackData( } GenlistCallbackData::~GenlistCallbackData() { +#if defined(TIZEN_ATK_SUPPORT) + // TODO(bj1987.kim): This code prevents the elm_genlist from crashing + // when ATK is turned on. After fixing genlist crash, need to remove. + if (!atk_enabled_ && elm_item_) +#else if (elm_item_) +#endif elm_object_item_del(elm_item_); } @@ -53,6 +69,12 @@ const std::string& GenlistCallbackData::GetLabel() const { return menu_item_->label.value(); } +#if defined(TIZEN_ATK_SUPPORT) +Elm_Object_Item* GenlistCallbackData::GetElmItem() const { + return elm_item_; +} +#endif + SelectPickerBase* GenlistCallbackData::GetSelectPicker() const { return select_picker_; } diff --git a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h index 77ad829..4592c76 100644 --- a/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h +++ b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h @@ -20,7 +20,12 @@ class GenlistCallbackData { const Elm_Genlist_Item_Class* item_class, const Elm_Genlist_Item_Class* group_class, bool is_multiple_selection, - Evas_Smart_Cb item_selected_cb); + Evas_Smart_Cb item_selected_cb +#if defined(TIZEN_ATK_SUPPORT) + , + bool atk_enabled +#endif + ); ~GenlistCallbackData(); GenlistCallbackData(const GenlistCallbackData&) = delete; @@ -30,6 +35,9 @@ class GenlistCallbackData { void ScrollToTop(); int GetIndex() const; const std::string& GetLabel() const; +#if defined(TIZEN_ATK_SUPPORT) + Elm_Object_Item* GetElmItem() const; +#endif SelectPickerBase* GetSelectPicker() const; bool IsEnabled() const; @@ -38,6 +46,9 @@ class GenlistCallbackData { SelectPickerBase* select_picker_; Elm_Object_Item* elm_item_; blink::mojom::MenuItemPtr menu_item_; +#if defined(TIZEN_ATK_SUPPORT) + bool atk_enabled_; +#endif }; #endif // CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_UTIL_H_ diff --git a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc index 4b507f0..a8ef5c3 100644 --- a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc +++ b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc @@ -43,3 +43,9 @@ void SelectPickerMobile::RequestFormNavigationInformation() { rfh->Send( new EwkFrameMsg_RequestSelectCollectionInformation(rfh->GetRoutingID())); } + +#if defined(TIZEN_ATK_SUPPORT) +bool SelectPickerMobile::GetAtkStatus() { + return web_view_->GetAtkStatus(); +} +#endif diff --git a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h index 96a3c38..29a38f8 100644 --- a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h +++ b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h @@ -28,6 +28,10 @@ class SelectPickerMobile : public SelectPickerMobileBase { // SelectPickerBase content::WebContentsViewAura* wcva() const override; +#if defined(TIZEN_ATK_SUPPORT) + bool GetAtkStatus() override; +#endif + EWebView* web_view_; }; diff --git a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc index 70fd877..7227569 100644 --- a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc +++ b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc @@ -47,3 +47,9 @@ void SelectPickerTv::RequestFormNavigationInformation() { void SelectPickerTv::HidePopupMenu() { web_view_->HidePopupMenu(); } + +#if defined(TIZEN_ATK_SUPPORT) +bool SelectPickerTv::GetAtkStatus() { + return web_view_->GetAtkStatus(); +} +#endif diff --git a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h index a9f1ad1..0ab05f7 100644 --- a/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h +++ b/tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h @@ -28,6 +28,10 @@ class SelectPickerTv : public SelectPickerTvBase { // SelectPickerBase content::WebContentsViewAura* wcva() const override; +#if defined(TIZEN_ATK_SUPPORT) + bool GetAtkStatus() override; +#endif + EWebView* web_view_; }; -- 2.7.4 From 30cc26a63b2c115b475cd4bce3ac70c6d7f93d2d Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 17 Feb 2023 12:20:55 +0530 Subject: [PATCH 08/16] [M108 Migration] Use snprintf in place of sprintf For better security, VD recommends using snprintf in place of sprintf. Reference: https://review.tizen.org/gerrit/c/283371/ Change-Id: If615daf8f65d95f203ed856d8df4a1c87c9a8a7b Signed-off-by: Ayush Kumar --- tizen_src/ewk/ubrowser/logger.cc | 2 +- tizen_src/ewk/ubrowser/window.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tizen_src/ewk/ubrowser/logger.cc b/tizen_src/ewk/ubrowser/logger.cc index 373619e..867f0f3 100644 --- a/tizen_src/ewk/ubrowser/logger.cc +++ b/tizen_src/ewk/ubrowser/logger.cc @@ -80,7 +80,7 @@ _make_format(MESSAGE_TYPE type, int add_newline, const char* fmt) { if (msg_fmt == NULL) { return NULL; } - sprintf(msg_fmt, fmt_hdr, fmt); + snprintf(msg_fmt, fmt_len, fmt_hdr, fmt); if (add_newline) { msg_fmt[fmt_len - 2] = '\n'; diff --git a/tizen_src/ewk/ubrowser/window.cc b/tizen_src/ewk/ubrowser/window.cc index 56ad89b..28cd7c9 100644 --- a/tizen_src/ewk/ubrowser/window.cc +++ b/tizen_src/ewk/ubrowser/window.cc @@ -872,7 +872,7 @@ void Window::OnScreenshotCaptured(Evas_Object* image, void* user_data) { log_trace("%s", __PRETTY_FUNCTION__); static int c = 1; char buf[250]; - sprintf(buf, "screenshot%d.png", c++); + snprintf(buf, sizeof(buf), "screenshot%d.png", c++); if (evas_object_image_save(image, buf, 0, 0)) log_info("Screenshot image saved in %s", buf); else -- 2.7.4 From f93862cde8df5ec43d5c8bda0516abd485b35c14 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 17 Feb 2023 12:11:04 +0530 Subject: [PATCH 09/16] [M108 Migration] Enable NetworkServiceInProcess for Tizen Below change enable network service to run as in-process for Tizen Reference: https://review.tizen.org/gerrit/278829/ Change-Id: Iabafafcf1d05a13dde85e4777d02d6b151531976 Signed-off-by: Ayush Kumar --- content/public/common/content_features.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 12aa4a4..3e0efe3 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc @@ -709,7 +709,7 @@ BASE_FEATURE(kNavigationThreadingOptimizations, // If the network service is enabled, runs it in process. BASE_FEATURE(kNetworkServiceInProcess, "NetworkServiceInProcess2", -#if BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_TIZEN) base::FEATURE_ENABLED_BY_DEFAULT #else base::FEATURE_DISABLED_BY_DEFAULT -- 2.7.4 From d8790cdc806d905ac338da965a7faeed16e40f4a Mon Sep 17 00:00:00 2001 From: Bakka Uday Kiran Date: Thu, 16 Feb 2023 13:25:09 +0530 Subject: [PATCH 10/16] [M108 Migration]Use container's height to calculate margin top/bottom Some WebKit-based apps expect vertical margins to be calculated using container's height rather than its width (as stated in specification). To provide correct layout of those apps, we allow for non-compliant calculations in compatibility mode (to be implemented). Reference: https://review.tizen.org/gerrit/c/282202 Change-Id: I5bffc230b821939c0e89bbb33c7758040ca7bfe9 Signed-off-by: Bakka Uday Kiran --- third_party/blink/renderer/core/layout/layout_box.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index f99abf7..25e6776 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc @@ -5885,8 +5885,18 @@ void LayoutBox::ComputePositionedLogicalWidthUsing( LayoutUnit logical_right_value = MinimumValueForLength(logical_right, container_logical_width); +#if BUILDFLAG(IS_TIZEN) + // Some apps expect margin top/bottom to be calculated based on container's + // height - not width. For compatibility reasons we allow for such behavior + // in compatibility mode. + const LayoutUnit container_relative_logical_width = + RuntimeEnabledFeatures::TizenCompatibilityModeEnabled() + ? ContainingBlockLogicalHeightForPositioned(container_block, false) + : ContainingBlockLogicalWidthForPositioned(container_block, false); +#else const LayoutUnit container_relative_logical_width = ContainingBlockLogicalWidthForPositioned(container_block, false); +#endif // If we are using aspect-ratio, the width is effectively not auto. bool logical_width_is_auto = @@ -6307,8 +6317,18 @@ void LayoutBox::ComputePositionedLogicalHeightUsing( LayoutUnit logical_height_value; LayoutUnit content_logical_height = logical_height - borders_plus_padding; +#if BUILDFLAG(IS_TIZEN) + // Some apps expect margin top/bottom to be calculated based on container's + // height - not width. For compatibility reasons we allow for such behavior + // in compatibility mode. + const LayoutUnit container_relative_logical_width = + RuntimeEnabledFeatures::TizenCompatibilityModeEnabled() + ? ContainingBlockLogicalHeightForPositioned(container_block, false) + : ContainingBlockLogicalWidthForPositioned(container_block, false); +#else const LayoutUnit container_relative_logical_width = ContainingBlockLogicalWidthForPositioned(container_block, false); +#endif LayoutUnit logical_top_value; -- 2.7.4 From a4907935aa80a16c92112ad75c00802c128fd4f0 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Fri, 17 Feb 2023 15:19:22 +0800 Subject: [PATCH 11/16] [M108 Migration] Implement ewk_view_favicon_get() API This API get the favorite-icon in current webview. Reference: - https://review.tizen.org/gerrit/#/c/280190/ Change-Id: Ib293a7636214b39a4cdc111e8a16bd09d66677bd Signed-off-by: Jie Zhang --- tizen_src/ewk/efl_integration/public/ewk_view.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index 6a6cb6d..aec5ec1 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -1259,6 +1259,14 @@ Eina_Bool ewk_view_app_preload_set(Evas_Object* ewkView, Eina_Bool is_preload) } #endif +Evas_Object* ewk_view_favicon_get(const Evas_Object* ewkView) +{ + EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, nullptr); + EINA_SAFETY_ON_NULL_RETURN_VAL(impl->context(), nullptr); + const char* url = ewk_view_url_get(ewkView); + return impl->context()->AddFaviconObject(url, impl->GetEvas()); +} + Eina_Bool ewk_view_html_string_override_current_entry_load(Evas_Object* view, const char* html, const char* base_uri, const char* unreachable_url) { LOG_EWK_API_MOCKUP(); -- 2.7.4 From 20900f17990923e1299137d1b7e88b0a02ec8c0c Mon Sep 17 00:00:00 2001 From: zhao dan Date: Fri, 17 Feb 2023 13:51:36 +0800 Subject: [PATCH 12/16] [M108 Migration] Export more symbol in chromium-ewk.filter to fix HBBTV launch fail Some V8_EXPORT interface have been used from HBBTV side, because without dynamic shared symbol, HBBTV render process can not launch. patch form: https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/273624/ Change-Id: I30bbf32662c55fe6b205c627adcc51930b2ae980 Signed-off-by: zhao dan --- tizen_src/ewk/chromium-ewk.filter | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tizen_src/ewk/chromium-ewk.filter b/tizen_src/ewk/chromium-ewk.filter index e712df0..f0cb068 100644 --- a/tizen_src/ewk/chromium-ewk.filter +++ b/tizen_src/ewk/chromium-ewk.filter @@ -4,18 +4,26 @@ efl_webprocess_main; extern "C++" { v8::Array::*; + v8::ConsumeCodeCacheTask::*; v8::Context::*; + v8::EmbedderRootsHandler::*; v8::EscapableHandleScope::*; v8::Extension::*; v8::External::*; + v8::FixedArray::*; v8::Function::*; v8::FunctionTemplate::*; v8::HandleScope::*; v8::Int32::*; v8::Integer::*; + v8::internal::IsolateFromNeverReadOnlySpaceObject*; + v8::internal::ShouldThrowOnError*; + v8::internal::DecodeExternalPointerImpl*; + v8::internal::CanHaveInternalField*; v8::Isolate::*; v8::Message::*; v8::MicrotasksScope::*; + v8::ModuleRequest::*; v8::Number::*; v8::Object::*; v8::ObjectTemplate::*; -- 2.7.4 From c339b95ca59c9ad43f1652cecb23a65627f0696c Mon Sep 17 00:00:00 2001 From: Bakka Uday Kiran Date: Thu, 16 Feb 2023 14:42:24 +0530 Subject: [PATCH 13/16] [M108 Migration] Support a11y tree generation for web browser on TV. Currently a11y frame dump using the command [1] doesn't return the a11y tree of the loaded web page. The reason we don't attach the root evas object with atk plug of platform. This change enables the same. [1] /usr/bin/at_spi2_tool -d org.tizen.browser Reference: https://review.tizen.org/gerrit/c/280915 Change-Id: Ib08e8479dfd056ee60e30c47be278e25f56139d2 Signed-off-by: Bakka Uday Kiran --- tizen_src/ewk/efl_integration/eweb_accessibility.cc | 8 ++++---- .../ewk/efl_integration/eweb_accessibility_util.cc | 21 ++++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/tizen_src/ewk/efl_integration/eweb_accessibility.cc b/tizen_src/ewk/efl_integration/eweb_accessibility.cc index f2653f2..0882ef4 100644 --- a/tizen_src/ewk/efl_integration/eweb_accessibility.cc +++ b/tizen_src/ewk/efl_integration/eweb_accessibility.cc @@ -32,7 +32,7 @@ AtkObject* EWebAccessibility::GetRootObject() { } void EWebAccessibility::OnFocusOut() { - if (!IsMobileProfile()) + if (!(IsMobileProfile() || IsTvProfile())) return; if (!accessibility_object_) @@ -42,7 +42,7 @@ void EWebAccessibility::OnFocusOut() { } void EWebAccessibility::AddPlug() { - if (!IsMobileProfile()) + if (!(IsMobileProfile() || IsTvProfile())) return; if (!accessibility_object_) @@ -65,7 +65,7 @@ void EWebAccessibility::AddPlug() { } void EWebAccessibility::RemovePlug() { - if (!IsMobileProfile()) + if (!(IsMobileProfile() || IsTvProfile())) return; auto plug_id = @@ -78,7 +78,7 @@ void EWebAccessibility::RemovePlug() { } void EWebAccessibility::NotifyAccessibilityStatus(bool is_enabled) { - if (IsMobileProfile()) + if (IsMobileProfile() || IsTvProfile()) (is_enabled) ? AddPlug() : RemovePlug(); if (observer_) { diff --git a/tizen_src/ewk/efl_integration/eweb_accessibility_util.cc b/tizen_src/ewk/efl_integration/eweb_accessibility_util.cc index 2ac024f..25cc6b7 100644 --- a/tizen_src/ewk/efl_integration/eweb_accessibility_util.cc +++ b/tizen_src/ewk/efl_integration/eweb_accessibility_util.cc @@ -78,19 +78,18 @@ static void eweb_accessibility_root_class_init( EWebAccessibilityRootClass* klass) {} static AtkObject* eweb_util_get_root() { - if (IsMobileProfile()) { - for (const auto& wc : content::WebContentsImpl::GetAllWebContents()) { - if (EWebView* ewebview = WebViewFromWebContents(wc)) - return ewebview->eweb_accessibility().GetRootObject(); - } + if (!IsMobileProfile()) + return ATK_OBJECT(g_object_new(EWEB_ACCESSIBILITY_ROOT_TYPE, nullptr)); + + for (const auto& wc : content::WebContentsImpl::GetAllWebContents()) { + if (EWebView* ewebview = WebViewFromWebContents(wc)) + return ewebview->eweb_accessibility().GetRootObject(); + } #if defined(ENABLE_WRT_JS) - if (eweb_accessibility_) - return eweb_accessibility_->GetRootObject(); + if (eweb_accessibility_) + return eweb_accessibility_->GetRootObject(); #endif - return nullptr; - } - - return ATK_OBJECT(g_object_new(EWEB_ACCESSIBILITY_ROOT_TYPE, nullptr)); + return nullptr; } static G_CONST_RETURN gchar* eweb_util_get_toolkit_name(void) { -- 2.7.4 From b34eeebe60ed1c69702621faf21cb4a61f0d6d7c Mon Sep 17 00:00:00 2001 From: v-saha Date: Mon, 13 Feb 2023 23:14:37 +0530 Subject: [PATCH 14/16] [M108 Migration][Text Selection] Selection handles & Caret Selection On longpress handles are to be displayed, migrate the handler and caret related patches. Expose WebNode::is_text_node in ContextMenuParameters, add is_caret_mode_forced_ to selection controller. References: https://review.tizen.org/gerrit/281232 Change-Id: I8450c9c91745f7000a9b1395ff6999aca878ba05 Signed-off-by: v-saha --- .../context_menu_data/context_menu_mojom_traits.cc | 3 + .../context_menu_params_builder.cc | 3 + .../untrustworthy_context_menu_params.cc | 3 + .../common/context_menu_data/context_menu_data.h | 7 + .../context_menu_data/context_menu_mojom_traits.h | 6 + .../untrustworthy_context_menu_params.h | 5 + .../public/mojom/context_menu/context_menu.mojom | 4 + .../renderer/core/page/context_menu_controller.cc | 4 + tizen_src/chromium_impl/content/BUILD.gn | 2 + .../rwhv_aura_offscreen_helper_efl.cc | 44 ++++ .../renderer_host/rwhv_aura_offscreen_helper_efl.h | 4 + .../content/browser/selection/selection_box_efl.cc | 34 +-- .../content/browser/selection/selection_box_efl.h | 9 +- .../browser/selection/selection_controller_efl.cc | 229 +++++++++++++-------- .../browser/selection/selection_controller_efl.h | 61 ++++-- .../browser/selection/selection_handle_efl.cc | 168 ++++++++------- .../browser/selection/selection_handle_efl.h | 16 +- .../browser/selection/selection_magnifier_efl.cc | 79 ++++--- .../browser/selection/selection_magnifier_efl.h | 6 +- .../chromium_impl/edje_resources/MainLayout.edc | 26 +++ .../browser/autofill_popup_view_efl.cc | 23 ++- .../browser/autofill_popup_view_efl.h | 4 + .../efl_integration/context_menu_controller_efl.cc | 51 +++-- tizen_src/ewk/efl_integration/eweb_view.cc | 44 ++-- tizen_src/ewk/efl_integration/eweb_view.h | 3 + 25 files changed, 552 insertions(+), 286 deletions(-) diff --git a/third_party/blink/common/context_menu_data/context_menu_mojom_traits.cc b/third_party/blink/common/context_menu_data/context_menu_mojom_traits.cc index 67e46bd..a26b986 100644 --- a/third_party/blink/common/context_menu_data/context_menu_mojom_traits.cc +++ b/third_party/blink/common/context_menu_data/context_menu_mojom_traits.cc @@ -59,6 +59,9 @@ bool StructTraitsmedia_flags = data.media_flags(); out->spellcheck_enabled = data.spellcheck_enabled(); out->is_editable = data.is_editable(); +#if BUILDFLAG(IS_EFL) + out->is_text_node = data.is_text_node(); +#endif out->writing_direction_default = data.writing_direction_default(); out->writing_direction_left_to_right = data.writing_direction_left_to_right(); out->writing_direction_right_to_left = data.writing_direction_right_to_left(); diff --git a/third_party/blink/common/context_menu_data/context_menu_params_builder.cc b/third_party/blink/common/context_menu_data/context_menu_params_builder.cc index 9c364c0..e257944 100644 --- a/third_party/blink/common/context_menu_data/context_menu_params_builder.cc +++ b/third_party/blink/common/context_menu_data/context_menu_params_builder.cc @@ -55,6 +55,9 @@ UntrustworthyContextMenuParams ContextMenuParamsBuilder::Build( params.misspelled_word = data.misspelled_word; params.spellcheck_enabled = data.is_spell_checking_enabled; params.is_editable = data.is_editable; +#if BUILDFLAG(IS_EFL) + params.is_text_node = data.is_text_node; +#endif params.writing_direction_default = data.writing_direction_default; params.writing_direction_left_to_right = data.writing_direction_left_to_right; params.writing_direction_right_to_left = data.writing_direction_right_to_left; diff --git a/third_party/blink/common/context_menu_data/untrustworthy_context_menu_params.cc b/third_party/blink/common/context_menu_data/untrustworthy_context_menu_params.cc index e670762..5ede70a 100644 --- a/third_party/blink/common/context_menu_data/untrustworthy_context_menu_params.cc +++ b/third_party/blink/common/context_menu_data/untrustworthy_context_menu_params.cc @@ -62,6 +62,9 @@ void UntrustworthyContextMenuParams::Assign( dictionary_suggestions = other.dictionary_suggestions; spellcheck_enabled = other.spellcheck_enabled; is_editable = other.is_editable; +#if BUILDFLAG(IS_EFL) + is_text_node = other.is_text_node; +#endif writing_direction_default = other.writing_direction_default; writing_direction_left_to_right = other.writing_direction_left_to_right; writing_direction_right_to_left = other.writing_direction_right_to_left; diff --git a/third_party/blink/public/common/context_menu_data/context_menu_data.h b/third_party/blink/public/common/context_menu_data/context_menu_data.h index dd207b4..611b3a8 100644 --- a/third_party/blink/public/common/context_menu_data/context_menu_data.h +++ b/third_party/blink/public/common/context_menu_data/context_menu_data.h @@ -117,6 +117,10 @@ struct ContextMenuData { // Whether context is editable. bool is_editable; +#if BUILDFLAG(IS_EFL) + bool is_text_node; +#endif + // If this node is an input field, the type of that field. blink::mojom::ContextMenuDataInputFieldType input_field_type; @@ -171,6 +175,9 @@ struct ContextMenuData { media_flags(kMediaNone), is_spell_checking_enabled(false), is_editable(false), +#if BUILDFLAG(IS_EFL) + is_text_node(false), +#endif writing_direction_default(kCheckableMenuItemDisabled), writing_direction_left_to_right(kCheckableMenuItemEnabled), writing_direction_right_to_left(kCheckableMenuItemEnabled), diff --git a/third_party/blink/public/common/context_menu_data/context_menu_mojom_traits.h b/third_party/blink/public/common/context_menu_data/context_menu_mojom_traits.h index 9e555d1..40c94c4 100644 --- a/third_party/blink/public/common/context_menu_data/context_menu_mojom_traits.h +++ b/third_party/blink/public/common/context_menu_data/context_menu_mojom_traits.h @@ -115,6 +115,12 @@ struct BLINK_COMMON_EXPORT return r.is_editable; } +#if BUILDFLAG(IS_EFL) + static bool is_text_node(const blink::UntrustworthyContextMenuParams& r) { + return r.is_text_node; + } +#endif + static int writing_direction_default( const blink::UntrustworthyContextMenuParams& r) { return r.writing_direction_default; diff --git a/third_party/blink/public/common/context_menu_data/untrustworthy_context_menu_params.h b/third_party/blink/public/common/context_menu_data/untrustworthy_context_menu_params.h index 6f706a3..99a5b3a 100644 --- a/third_party/blink/public/common/context_menu_data/untrustworthy_context_menu_params.h +++ b/third_party/blink/public/common/context_menu_data/untrustworthy_context_menu_params.h @@ -103,6 +103,11 @@ struct BLINK_COMMON_EXPORT UntrustworthyContextMenuParams { // Whether context is editable. bool is_editable; +#if BUILDFLAG(IS_EFL) + // Whether node context menu was invoked on is a text node. + bool is_text_node; +#endif + // Writing direction menu items. int writing_direction_default; int writing_direction_left_to_right; diff --git a/third_party/blink/public/mojom/context_menu/context_menu.mojom b/third_party/blink/public/mojom/context_menu/context_menu.mojom index 1c4d187..0aaa56f 100644 --- a/third_party/blink/public/mojom/context_menu/context_menu.mojom +++ b/third_party/blink/public/mojom/context_menu/context_menu.mojom @@ -167,6 +167,10 @@ struct UntrustworthyContextMenuParams { // Whether context is editable. bool is_editable; + // Whether element is text + [EnableIf=is_efl] + bool is_text_node; + // Writing direction menu items. int32 writing_direction_default; int32 writing_direction_left_to_right; diff --git a/third_party/blink/renderer/core/page/context_menu_controller.cc b/third_party/blink/renderer/core/page/context_menu_controller.cc index 5501389..2d90e7e 100644 --- a/third_party/blink/renderer/core/page/context_menu_controller.cc +++ b/third_party/blink/renderer/core/page/context_menu_controller.cc @@ -686,6 +686,10 @@ bool ContextMenuController::ShowContextMenu(LocalFrame* frame, } } +#if BUILDFLAG(IS_EFL) + data.is_text_node = result.InnerNode()->IsTextNode(); +#endif + if (result.IsContentEditable()) { data.is_editable = true; SpellChecker& spell_checker = selected_frame->GetSpellChecker(); diff --git a/tizen_src/chromium_impl/content/BUILD.gn b/tizen_src/chromium_impl/content/BUILD.gn index 62198de..70ce612 100644 --- a/tizen_src/chromium_impl/content/BUILD.gn +++ b/tizen_src/chromium_impl/content/BUILD.gn @@ -5,6 +5,8 @@ static_library("android_content_detection") { set_sources_assignment_filter([]) sources = [ + "//content/renderer/android/disambiguation_popup_helper.cc", + "//content/renderer/android/disambiguation_popup_helper.h", "//content/renderer/android/renderer_date_time_picker.cc", "//content/renderer/android/renderer_date_time_picker.h", ] 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 aea5901..1e436c2 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 @@ -549,6 +549,10 @@ void RWHVAuraOffscreenHelperEfl::OnFocusIn(void* data, static_cast(data); thiz->FocusRWHVA(); + if (IsMobileProfile() && thiz->GetSelectionController()) { + thiz->GetSelectionController()->ShowHandleAndContextMenuIfRequired(); + } + if (!thiz->on_focus_in_callback_.is_null()) thiz->on_focus_in_callback_.Run(); } @@ -568,6 +572,10 @@ void RWHVAuraOffscreenHelperEfl::OnFocusOut(void* data, if (focused_window) focused_window->LostFocus(); + if (IsMobileProfile() && thiz->GetSelectionController()) { + thiz->GetSelectionController()->HideHandleAndContextMenu(); + } + if (!thiz->on_focus_out_callback_.is_null()) thiz->on_focus_out_callback_.Run(); } @@ -1053,6 +1061,42 @@ void RWHVAuraOffscreenHelperEfl::TextInputStateChanged( } } +void RWHVAuraOffscreenHelperEfl::MoveCaret(const gfx::Point& point) { + if (auto* delegate = rwhv_aura_->host()->delegate()) { + delegate->MoveCaret(gfx::Point(point.x() / device_scale_factor_, + point.y() / device_scale_factor_)); + } +} + +void RWHVAuraOffscreenHelperEfl::SelectClosestWord( + const gfx::Point& touch_point) { + int view_x, view_y; + EvasToBlinkCords(touch_point.x(), touch_point.y(), &view_x, &view_y); + +#if !defined(EWK_BRINGUP) // FIXME: m67 bringup + // FIXME: The SelectClosestWord function was removed by + // commit 9720a4494c8bcd24d1f496feec5cfac7582103d2 in s-chromium + // It will be fixed by webview team. + // FIXME: http://suprem.sec.samsung.net/jira/browse/TWF-2122 + Send(new ViewMsg_SelectClosestWord(host_->GetRoutingID(), view_x, view_y)); +#endif // EWK_BRINGUP +} + +bool RWHVAuraOffscreenHelperEfl::HasSelectableText() { + // If the last character of textarea is '\n', We can assume an extra '\n'. + // Actually when you insert line break by ENTER key, '\n\n' is stored in + // textarea. And If you press delete key, only a '\n' character will be stored + // although there is no visible and selectable character in textarea. That's + // why we should check whether selection_text contains only one line break. + // Bug: http://suprem.sec.samsung.net/jira/browse/TSAM-2230 + // + // Please see below commit for more information. + // https://codereview.chromium.org/1785603002 + std::u16string selection_text = rwhv_aura_->GetSelectedText(); + return !selection_text.empty() && + base::UTF16ToUTF8(selection_text).compare("\n") != 0; +} + void RWHVAuraOffscreenHelperEfl::FocusedNodeChanged( bool editable #if BUILDFLAG(IS_TIZEN_TV) diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h index e93b196..3d47eb6 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h @@ -145,6 +145,10 @@ class CONTENT_EXPORT RWHVAuraOffscreenHelperEfl { bool IsFocusedNodeContentEditable() const { return is_content_editable_; } + void MoveCaret(const gfx::Point& point); + void SelectClosestWord(const gfx::Point& touch_point); + bool HasSelectableText(); + private: static void OnParentViewResize(void* data, Evas*, Evas_Object*, void*); static void EvasObjectImagePixelsGetCallback(void*, Evas_Object*); diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_box_efl.cc b/tizen_src/chromium_impl/content/browser/selection/selection_box_efl.cc index f3af92d..c5a5eed 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_box_efl.cc +++ b/tizen_src/chromium_impl/content/browser/selection/selection_box_efl.cc @@ -5,17 +5,20 @@ #include "selection_box_efl.h" #include "base/trace_event/trace_event.h" +#include "content/browser/renderer_host/render_widget_host_view_aura.h" namespace content { -SelectionBoxEfl::SelectionBoxEfl(Evas_Object* parent_view) - : status_(false), - is_anchor_first_(false), - context_params_(new ContextMenuParams()), - parent_view_(parent_view) { - context_params_->has_image_contents = false; +SelectionBoxEfl::SelectionBoxEfl(RenderWidgetHostViewAura* rwhva) + : status_(false), + is_anchor_first_(false), + context_params_(new ContextMenuParams()), + rwhva_(rwhva) { + context_params_->has_image_contents = false; } +SelectionBoxEfl::~SelectionBoxEfl() = default; + void SelectionBoxEfl::UpdateSelectStringData(const std::u16string& text) { context_params_->selection_text = text; } @@ -37,14 +40,12 @@ bool SelectionBoxEfl::UpdateRectData(const gfx::Rect& left_rect, const gfx::Rect left_rect_ = left_rect; right_rect_ = right_rect; - // Display point of context Menu - Evas_Coord x, y; - evas_object_geometry_get(parent_view_, &x, &y, 0, 0); //context params suppose to be global - related to evas not the web view - ret |= (context_params_->x != (left_rect_.x() + x)); - ret |= (context_params_->y != (left_rect_.y() + y)); - context_params_->x = left_rect_.x() + x; - context_params_->y = left_rect_.y() + y; + gfx::Rect view_bounds = rwhva_->offscreen_helper()->GetViewBoundsInPix(); + ret |= (context_params_->x != (left_rect_.x() + (view_bounds.x()))); + ret |= (context_params_->y != (left_rect_.y() + view_bounds.y())); + context_params_->x = left_rect_.x() + view_bounds.x(); + context_params_->y = left_rect_.y() + view_bounds.y(); return ret; } @@ -54,12 +55,13 @@ bool SelectionBoxEfl::IsInEditField() const { } void SelectionBoxEfl::SetStatus(bool enable) { - bool invokeCbAtEnd = status_ != enable; + bool invoke_cb_at_end = status_ != enable; status_ = enable; // invoke CB only if mode actually changed - if (invokeCbAtEnd && parent_view_) - evas_object_smart_callback_call(parent_view_, "textselection,mode", &status_); + if (invoke_cb_at_end && rwhva_->offscreen_helper()->ewk_view()) + evas_object_smart_callback_call(rwhva_->offscreen_helper()->ewk_view(), + "textselection,mode", &status_); } } diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_box_efl.h b/tizen_src/chromium_impl/content/browser/selection/selection_box_efl.h index f238587..aa4c8de 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_box_efl.h +++ b/tizen_src/chromium_impl/content/browser/selection/selection_box_efl.h @@ -15,12 +15,17 @@ class EWebView; namespace content { +class RenderWidgetHostViewAura; // Hold the data related to drwaing the selection handlers // and context menu. Also stores all the data required for selection // controlling class SelectionBoxEfl { public: - SelectionBoxEfl(Evas_Object* parent_view); + explicit SelectionBoxEfl(RenderWidgetHostViewAura* rwhva); + ~SelectionBoxEfl(); + + SelectionBoxEfl(const SelectionBoxEfl&) = delete; + SelectionBoxEfl& operator=(const SelectionBoxEfl&) = delete; void SetStatus(bool enable); bool GetStatus() const { return status_; } @@ -52,7 +57,7 @@ class SelectionBoxEfl { // Contains the menu item data for which context needs to be populated std::unique_ptr context_params_; - Evas_Object* parent_view_; + RenderWidgetHostViewAura* rwhva_; }; } 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 b8368ef..fd9168e 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 @@ -4,11 +4,12 @@ #include "selection_controller_efl.h" -#include +#include #include "base/trace_event/trace_event.h" #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/renderer_host/render_widget_host_impl.h" +#include "content/browser/renderer_host/render_widget_host_view_aura.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/browser/web_contents/web_contents_impl_efl.h" #include "content/public/browser/context_menu_params.h" @@ -40,33 +41,39 @@ gfx::Vector2dF ComputeLineOffsetFromBottom(const gfx::SelectionBound& bound) { return line_offset; } -SelectionControllerEfl::SelectionControllerEfl(Evas_Object* parent_view, WebContents& web_contents) - : parent_view_(parent_view), - controls_temporarily_hidden_(false), - selection_change_reason_(Reason::Irrelevant), - long_mouse_press_(false), - selection_data_(new SelectionBoxEfl(parent_view)), - start_handle_(new SelectionHandleEfl(*this, SelectionHandleEfl::HANDLE_TYPE_LEFT, parent_view)), - end_handle_(new SelectionHandleEfl(*this, SelectionHandleEfl::HANDLE_TYPE_RIGHT, parent_view)), - input_handle_(new SelectionHandleEfl(*this, SelectionHandleEfl::HANDLE_TYPE_INPUT, parent_view)), - magnifier_(new SelectionMagnifierEfl(this, web_contents)), - is_selection_visible_(false), - handle_being_dragged_(false), - selection_on_empty_form_control_(false), - web_contents_(web_contents), - selection_mode_(None) { - evas_object_event_callback_add(parent_view_, EVAS_CALLBACK_MOVE, &EvasParentViewMoveCallback, this); +content::WebContents* SelectionControllerEfl::web_contents() const { + return rwhva_->offscreen_helper()->GetWebContents(); +} + +SelectionControllerEfl::SelectionControllerEfl(RenderWidgetHostViewAura* rwhva) + : rwhva_(rwhva), + selection_data_(new SelectionBoxEfl(rwhva)), + start_handle_( + new SelectionHandleEfl(*this, SelectionHandleEfl::HANDLE_TYPE_LEFT)), + end_handle_( + new SelectionHandleEfl(*this, SelectionHandleEfl::HANDLE_TYPE_RIGHT)), + input_handle_( + new SelectionHandleEfl(*this, SelectionHandleEfl::HANDLE_TYPE_INPUT)), + magnifier_(new SelectionMagnifierEfl(this)), + selection_mode_(None) { + evas_object_event_callback_add(rwhva_->offscreen_helper()->content_image(), + EVAS_CALLBACK_MOVE, + &EvasParentViewMoveCallback, this); #if BUILDFLAG(IS_TIZEN) vconf_notify_key_changed(VCONFKEY_LANGSET, PlatformLanguageChanged, this); #endif } SelectionControllerEfl::~SelectionControllerEfl() { + if (ecore_events_filter_) + ecore_event_filter_del(ecore_events_filter_); if (GetSelectionStatus()) ClearSelectionViaEWebView(); HideHandleAndContextMenu(); - evas_object_event_callback_del(parent_view_, EVAS_CALLBACK_MOVE, &EvasParentViewMoveCallback); + evas_object_event_callback_del(rwhva_->offscreen_helper()->content_image(), + EVAS_CALLBACK_MOVE, + &EvasParentViewMoveCallback); } void SelectionControllerEfl::SetSelectionStatus(bool enable) { @@ -114,15 +121,10 @@ void SelectionControllerEfl::SetControlsTemporarilyHidden(bool value) { "controls are hidden:", value); if (controls_temporarily_hidden_ == value) return; -#if !defined(USE_AURA) - RenderWidgetHostViewEfl* rwhv = static_cast( - web_contents_.GetRenderWidgetHostView()); - CHECK(rwhv); // Make sure to show selection controls only when no finger // is left touching the screen. - if (!value && rwhv->PointerStatePointerCount()) + if (!value && rwhva_->event_handler()->pointer_state().GetPointerCount()) return; -#endif controls_temporarily_hidden_ = value; if (value) { Clear(); @@ -157,18 +159,30 @@ void SelectionControllerEfl::OnSelectionChanged( truncated_end = gfx::ToEnclosingRect( gfx::ConvertRectToPixels(truncated_end, device_scale_factor)); + if (handle_being_dragged_ && + dragging_handle_->Type() != SelectionHandleEfl::HANDLE_TYPE_INPUT) { + dragging_handle_->MoveObject(selection_data_->GetIsAnchorFirst() + ? truncated_end.bottom_right() + : truncated_start.bottom_left()); + } + bool finger_down = handle_being_dragged_ || long_mouse_press_; bool show = (selection_change_reason_ != Reason::Irrelevant) && !finger_down; UpdateSelectionDataAndShow( truncated_start, truncated_end, show); selection_change_reason_ = Reason::Irrelevant; + + // In case of the selected text contains only line break and no other + // characters, we should use caret selection mode. + if (GetSelectionEditable() && !handle_being_dragged_ && + rwhva_->GetSelectedText() == (u"\n")) { + rwhva_->offscreen_helper()->MoveCaret( + selection_data_->GetLeftRect().origin()); + is_caret_mode_forced_ = true; + } } void SelectionControllerEfl::OnTextInputStateChanged() { -#if !defined(USE_AURA) - RenderWidgetHostViewEfl* rwhv = static_cast( - web_contents_.GetRenderWidgetHostView()); - CHECK(rwhv); // In order to confirm if a long press gesture is ongoing, // we just needed to check "long_mouse_press_". // However, when long press happens on a link or image, @@ -176,7 +190,8 @@ void SelectionControllerEfl::OnTextInputStateChanged() { // although finger is still down. // To compensate this, add an extra check asking from the engine // if a finger is still touching down. - bool is_touch_down = rwhv->PointerStatePointerCount() > 0; + bool is_touch_down = + rwhva_->event_handler()->pointer_state().GetPointerCount() > 0; // If on an editable field and in caret selection mode, only // show the large handle if: @@ -185,12 +200,12 @@ void SelectionControllerEfl::OnTextInputStateChanged() { // handling "tap" gesture. bool finger_down = handle_being_dragged_ || long_mouse_press_ || is_touch_down; - if (GetSelectionEditable() && !finger_down && !controls_temporarily_hidden_ && + if (GetSelectionEditable() && GetCaretSelectionStatus() && !finger_down && + !controls_temporarily_hidden_ && selection_change_reason_ == Reason::Irrelevant) { HideHandleAndContextMenu(); ClearSelection(); } -#endif } void SelectionControllerEfl::UpdateSelectionData(const std::u16string& text) { @@ -198,17 +213,14 @@ void SelectionControllerEfl::UpdateSelectionData(const std::u16string& text) { } bool SelectionControllerEfl::ClearSelectionViaEWebView() { - if (!GetSelectionStatus() || !web_contents_.GetRenderViewHost() || - web_contents_.IsBeingDestroyed()) { + if (!GetSelectionStatus() || !web_contents()->GetRenderViewHost() || + web_contents()->IsBeingDestroyed()) { return false; } - // RenderWidgetHostImpl* rwhi = static_cast( - // web_contents_.GetRenderViewHost()->GetWidget()); - // rwhi->ExecuteEditCommand("Unselect", ""); - RenderWidgetHostDelegate* host_delegate = - RenderWidgetHostImpl::From(web_contents_.GetRenderViewHost()->GetWidget()) + RenderWidgetHostImpl::From( + web_contents()->GetRenderViewHost()->GetWidget()) ->delegate(); if (host_delegate) { host_delegate->ExecuteEditCommand("Unselect", absl::nullopt); @@ -221,6 +233,14 @@ void SelectionControllerEfl::SetSelectionMode(enum SelectionMode mode) { selection_mode_ = mode; } +void SelectionControllerEfl::ToggleCaretAfterSelection() { + if (!GetCaretSelectionStatus() && GetSelectionEditable()) { + rwhva_->offscreen_helper()->MoveCaret( + selection_data_->GetRightRect().origin()); + ClearSelection(); + } +} + void SelectionControllerEfl::DetermineSelectionMode( const gfx::Rect& left_rect, const gfx::Rect& right_rect) { @@ -286,8 +306,8 @@ void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired( return; } - bool is_any_handle_visible = start_selection_.visible() || - end_selection_.visible(); + bool is_selection_range_visible = + start_selection_.visible() || end_selection_.visible(); // Is in edit field and no text is selected. show only single handle if (selection_data_->IsInEditField() && left == right) { @@ -296,7 +316,7 @@ void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired( CHECK(start_selection_ == end_selection_); - if (GetCaretSelectionStatus() && is_any_handle_visible) { + if (GetCaretSelectionStatus() && is_selection_range_visible) { gfx::Rect left = selection_data_->GetLeftRect(); input_handle_->SetBasePosition(gfx::Point(left.x(), left.y())); input_handle_->Move(left.bottom_right()); @@ -305,10 +325,11 @@ void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired( start_handle_->Hide(); end_handle_->Hide(); - bool show_context_menu = is_any_handle_visible && - effective_reason != Reason::ScrollOrZoomGestureEnded && - effective_reason != Reason::Tap && - effective_reason != Reason::Irrelevant; + bool show_context_menu = + IsAnyHandleVisible() && + effective_reason != Reason::ScrollOrZoomGestureEnded && + effective_reason != Reason::Tap && + effective_reason != Reason::Irrelevant; if (!handle_being_dragged_ && show_context_menu) ShowContextMenu(); @@ -346,8 +367,9 @@ void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired( // Do not show the context menu during selection extend and // offscreen selection. if (!handle_being_dragged_ && effective_reason != Reason::Irrelevant && - is_any_handle_visible) + IsAnyHandleVisible()) { ShowContextMenu(); + } } void SelectionControllerEfl::ShowContextMenu() { @@ -401,14 +423,43 @@ void SelectionControllerEfl::Clear() { input_handle_->Hide(); } -void SelectionControllerEfl::HandleDragBeginNotification(SelectionHandleEfl* handle) { +Eina_Bool SelectionControllerEfl::EcoreEventFilterCallback(void* user_data, + void* /*loop_data*/, + int type, + void* event_info) { + if (type == ECORE_EVENT_MOUSE_MOVE) { + auto controller = static_cast(user_data); + if (!controller || !controller->dragged_handle_) + return ECORE_CALLBACK_PASS_ON; + + auto event = static_cast(event_info); + controller->dragged_handle_->UpdatePosition(gfx::Point(event->x, event->y)); + return ECORE_CALLBACK_CANCEL; + } + + return ECORE_CALLBACK_PASS_ON; +} + +void SelectionControllerEfl::HandleDragBeginNotification( + SelectionHandleEfl* handle) { + selection_change_reason_ = Reason::HandleDragged; + dragged_handle_ = handle; + ecore_events_filter_ = + ecore_event_filter_add(nullptr, EcoreEventFilterCallback, nullptr, this); + + if (!ecore_events_filter_) { + LOG(ERROR) << __PRETTY_FUNCTION__ + << " : Unable to create ecore events filter"; + } + // Hide context menu on mouse down CancelContextMenu(0); handle_being_dragged_ = true; Evas_Coord x, y; - evas_object_geometry_get(parent_view_, &x, &y, 0, 0); + evas_object_geometry_get(rwhva_->offscreen_helper()->content_image(), &x, &y, + 0, 0); gfx::Point magnifier_point( handle->GetBasePosition().x() + x, handle->GetBasePosition().y() + y); @@ -448,33 +499,29 @@ void SelectionControllerEfl::HandleDragBeginNotification(SelectionHandleEfl* han base += base_offset; extent += extent_offset; - WebContentsImpl* wci = static_cast(&web_contents_); + WebContentsImpl* wci = static_cast(web_contents()); wci->SelectRange(gfx::ToFlooredPoint(base), gfx::ToFlooredPoint(extent)); } void SelectionControllerEfl::HandleDragUpdateNotification(SelectionHandleEfl* handle) { + if (!rwhva_) + return; // FIXME : Check the text Direction later - Evas_Coord x, y; - evas_object_geometry_get(parent_view_, &x, &y, 0, 0); + gfx::Rect view_bounds = rwhva_->offscreen_helper()->GetViewBoundsInPix(); selection_change_reason_ = Reason::HandleDragged; gfx::Point magnifier_point; - magnifier_point.set_x(handle->GetBasePosition().x() + x); - magnifier_point.set_y(handle->GetBasePosition().y() + y); + magnifier_point.set_x(handle->GetBasePosition().x() + view_bounds.x()); + magnifier_point.set_y(handle->GetBasePosition().y() + view_bounds.y()); magnifier_->UpdateLocation(magnifier_point); magnifier_->Move(magnifier_point); switch (handle->Type()) { -#if !defined(USE_AURA) case SelectionHandleEfl::HANDLE_TYPE_INPUT: { - RenderWidgetHostViewEfl* rwhv = - static_cast(web_contents_.GetRenderWidgetHostView()); - if (rwhv) - rwhv->MoveCaret(handle->GetBasePosition()); + rwhva_->offscreen_helper()->MoveCaret(handle->GetBasePosition()); return; } -#endif case SelectionHandleEfl::HANDLE_TYPE_LEFT: case SelectionHandleEfl::HANDLE_TYPE_RIGHT: { float device_scale_factor = @@ -488,7 +535,7 @@ void SelectionControllerEfl::HandleDragUpdateNotification(SelectionHandleEfl* ha : ComputeLineOffsetFromBottom(end_selection_); extent += line_offset; - WebContentsImpl* wci = static_cast(&web_contents_); + WebContentsImpl* wci = static_cast(web_contents()); wci->MoveRangeSelectionExtent(gfx::ToFlooredPoint(extent)); return; } @@ -496,6 +543,12 @@ void SelectionControllerEfl::HandleDragUpdateNotification(SelectionHandleEfl* ha } void SelectionControllerEfl::HandleDragEndNotification() { + dragged_handle_ = nullptr; + + if (ecore_events_filter_) + ecore_event_filter_del(ecore_events_filter_); + ecore_events_filter_ = nullptr; + selection_change_reason_ = Reason::Irrelevant; magnifier_->Hide(); start_handle_->SetBasePosition(selection_data_->GetLeftRect().bottom_left()); @@ -535,7 +588,9 @@ void SelectionControllerEfl::HandleGesture(blink::WebGestureEvent& event) { } } -void SelectionControllerEfl::HandlePostponedGesture(int x, int y, ui::EventType type) { +void SelectionControllerEfl::HandlePostponedGesture(int x, + int y, + ui::EventType type) { DVLOG(0) << "HandlePostponedGesture :: " << type; #if !defined(USE_AURA) RenderWidgetHostViewEfl* rwhv = @@ -583,14 +638,13 @@ bool SelectionControllerEfl::HandleLongPressEvent( #endif SetSelectionStatus(true); SetSelectionEditable(true); + if (selection_mode_ == None) + SetSelectionMode(Caret); HandleLongPressEventPrivate(touch_point); return true; - } else if (params.link_url.is_empty() && params.src_url.is_empty() -#if !defined(EWK_BRINGUP) // FIXME: m67 bringup - && params.is_text_node) { -#else - ) { -#endif + } else if (params.link_url.is_empty() && params.src_url.is_empty() && + params.is_text_node || + !params.selection_text.empty()) { // If user is long pressing on a content with // -webkit-user-select: none, we should bail and not enter // selection neither show magnigier class or context menu. @@ -618,31 +672,18 @@ bool SelectionControllerEfl::HandleLongPressEvent( return true; } -void SelectionControllerEfl::HandleLongPressEventPrivate(const gfx::Point& touch_point) { +void SelectionControllerEfl::HandleLongPressEventPrivate( + const gfx::Point& touch_point) { Clear(); - Evas_Coord x, y; - evas_object_geometry_get(parent_view_, &x, &y, 0, 0); - magnifier_->HandleLongPress(gfx::Point(touch_point.x() + x, - touch_point.y() + y)); + gfx::Rect view_bounds = rwhva_->offscreen_helper()->GetViewBoundsInPix(); + magnifier_->HandleLongPress(gfx::Point(touch_point.x() + view_bounds.x(), + touch_point.y() + view_bounds.y())); } void SelectionControllerEfl::HandleLongPressMoveEvent(const gfx::Point& touch_point) { -#if !defined(USE_AURA) - RenderWidgetHostViewEfl* rwhv = - static_cast(web_contents_.GetRenderWidgetHostView()); - Clear(); - selection_change_reason_ = Reason::LongPressMoved; - if (selection_data_->IsInEditField()) { - Evas_Coord x, y; - evas_object_geometry_get(parent_view_, &x, &y, 0, 0); - if (rwhv) - rwhv->MoveCaret(gfx::Point(touch_point.x() - x, touch_point.y() - y)); - } else{ - if (rwhv) - rwhv->SelectClosestWord(touch_point); - } -#endif + if (rwhva_) + rwhva_->offscreen_helper()->SelectClosestWord(touch_point); } void SelectionControllerEfl::HandleLongPressEndEvent() { @@ -652,14 +693,12 @@ void SelectionControllerEfl::HandleLongPressEndEvent() { } void SelectionControllerEfl::PostHandleTapGesture(bool is_content_editable) { - HideHandleAndContextMenu(); if (is_content_editable) { DVLOG(1) << "PostHandleTapGesture :: Editable"; SetSelectionStatus(true); SetSelectionEditable(true); selection_change_reason_ = Reason::Tap; } else { - ClearSelectionViaEWebView(); SetSelectionEditable(false); } } @@ -695,6 +734,7 @@ bool SelectionControllerEfl::IsSelectionValid(const gfx::Rect& left_rect, void SelectionControllerEfl::ClearSelection() { TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__); Clear(); + CancelContextMenu(0); SetSelectionStatus(false); SetSelectionEditable(false); SetSelectionMode(None); @@ -719,7 +759,8 @@ void SelectionControllerEfl::ChangeContextMenuPosition(gfx::Point& position, int int handleHeight, webViewX, webViewY, webViewWidth, webViewHeight; gfx::Rect imeRect; edje_object_part_geometry_get(input_handle_->evas_object(), "handle", 0, 0, 0, &handleHeight); - evas_object_geometry_get(GetParentView(), &webViewX, &webViewY, &webViewWidth, &webViewHeight); + evas_object_geometry_get(rwhva_->offscreen_helper()->content_image(), + &webViewX, &webViewY, &webViewWidth, &webViewHeight); gfx::Rect viewportRect = gfx::Rect(webViewX, webViewY, webViewWidth, webViewHeight); #if !defined(USE_AURA) RenderWidgetHostViewEfl* rwhv = @@ -846,6 +887,14 @@ void SelectionControllerEfl::ChangeContextMenuPosition(gfx::Point& position, int return; } +gfx::Rect SelectionControllerEfl::GetVisibleViewportRect() const { + if (custom_visible_view_rect_.IsEmpty()) + return rwhva_->offscreen_helper()->GetViewBoundsInPix(); + + return gfx::IntersectRects(rwhva_->offscreen_helper()->GetViewBoundsInPix(), + custom_visible_view_rect_); +} + bool SelectionControllerEfl::TextSelectionDown(int x, int y) { /* * According to webkit-efl textSelectionDown is used on long press gesture, we already diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.h b/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.h index bfebbbd..7f34758 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.h +++ b/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.h @@ -25,6 +25,7 @@ #include namespace content { +class RenderWidgetHostViewAura; class WebContents; class WebContentsImpl; @@ -46,9 +47,12 @@ class CONTENT_EXPORT SelectionControllerEfl { }; public: - explicit SelectionControllerEfl(Evas_Object* parent_view, WebContents& web_contents); + explicit SelectionControllerEfl(RenderWidgetHostViewAura* rwhva); ~SelectionControllerEfl(); + SelectionControllerEfl(const SelectionControllerEfl&) = delete; + SelectionControllerEfl& operator=(const SelectionControllerEfl&) = delete; + // Functions that handle long press, long press move and release bool HandleLongPressEvent(const gfx::Point& touch_point, const content::ContextMenuParams& params); @@ -86,7 +90,6 @@ class CONTENT_EXPORT SelectionControllerEfl { // Clears the selection and hides context menu and handles void ClearSelection(); bool ClearSelectionViaEWebView(); - Evas_Object* GetParentView() const { return parent_view_; } void HideHandles(); void HideHandleAndContextMenu(); bool IsAnyHandleVisible() const; @@ -120,6 +123,7 @@ class CONTENT_EXPORT SelectionControllerEfl { LongPressEnded, Tap, RequestedByContextMenu, + CaretModeForced, Irrelevant, }; void SetWaitsForRendererSelectionChanges( @@ -129,6 +133,20 @@ class CONTENT_EXPORT SelectionControllerEfl { void HandlePostponedGesture(int x, int y, ui::EventType type); void HandleGesture(blink::WebGestureEvent& event); + gfx::Rect GetVisibleViewportRect() const; + + bool IsCaretModeForced() const { return is_caret_mode_forced_; } + void SetCustomVisibleViewRect(const gfx::Rect& custom_visible_view_rect) { + custom_visible_view_rect_ = custom_visible_view_rect; + } + + void ToggleCaretAfterSelection(); + void ShowHandleAndContextMenuIfRequired( + Reason explicit_reason = Reason::Irrelevant); + + RenderWidgetHostViewAura* rwhva() const { return rwhva_; } + content::WebContents* web_contents() const; + private: enum SelectionMode { None = 0, @@ -145,16 +163,18 @@ class CONTENT_EXPORT SelectionControllerEfl { void HandleLongPressEventPrivate(const gfx::Point& touch_point); - void ShowHandleAndContextMenuIfRequired(Reason explicit_reason = Reason::Irrelevant); - void Clear(); bool IsSelectionValid(const gfx::Rect& left_rect, const gfx::Rect& right_rect); void ShowContextMenu(); void CancelContextMenu(int request_id); - static void EvasParentViewMoveCallback(void *data, Evas *e, Evas_Object *obj, void *event_info) - { reinterpret_cast(data)->OnParentParentViewMove(); } + static void EvasParentViewMoveCallback(void* data, + Evas* e, + Evas_Object* obj, + void* event_info) { + reinterpret_cast(data)->OnParentParentViewMove(); + } #if BUILDFLAG(IS_TIZEN) static void PlatformLanguageChanged(keynode_t* keynode, void* data); @@ -162,20 +182,26 @@ class CONTENT_EXPORT SelectionControllerEfl { void OnParentParentViewMove(); - Evas_Object* parent_view_; + static Eina_Bool EcoreEventFilterCallback(void* user_data, + void* loop_data, + int type, + void* event_info); + // Is required to send back selction points and range extenstion co-ordinates + RenderWidgetHostViewAura* rwhva_; // Saves state so that selection controls are temporarily hidden due // to scrolling or zooming. - bool controls_temporarily_hidden_; + bool controls_temporarily_hidden_ = false; // Cache the reason of why browser has requested a text selection // change to the renderer. At the next composited selection update // the cache is handled and reset. - Reason selection_change_reason_; + Reason selection_change_reason_ = Reason::Irrelevant; - // Saves state so that handlers and context menu is not shown when seletion change event occurs. - bool long_mouse_press_; + // Saves state so that handlers and context menu is not shown when seletion + // change event occurs. + bool long_mouse_press_ = false; // Saves the data that are required to draw handle and context menu std::unique_ptr selection_data_; @@ -198,13 +224,18 @@ class CONTENT_EXPORT SelectionControllerEfl { // Helper pointer to the stationary handle (during dragging). SelectionHandleEfl* stationary_handle_; - bool is_selection_visible_; + gfx::Rect custom_visible_view_rect_; + + bool is_selection_visible_ = false; + + bool handle_being_dragged_ = false; - bool handle_being_dragged_; + bool is_caret_mode_forced_ = false; + bool selection_on_empty_form_control_ = false; - bool selection_on_empty_form_control_; + Ecore_Event_Filter* ecore_events_filter_ = nullptr; - WebContents& web_contents_; + SelectionHandleEfl* dragged_handle_ = nullptr; enum SelectionMode selection_mode_; gfx::SelectionBound start_selection_; diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.cc b/tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.cc index efb40d3..d095ff3 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.cc +++ b/tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.cc @@ -11,7 +11,9 @@ #include "base/files/file_path.h" #include "base/path_service.h" #include "base/trace_event/trace_event.h" +#include "content/browser/renderer_host/render_widget_host_view_aura.h" #include "content/browser/selection/selection_controller_efl.h" +#include "content/browser/web_contents/web_contents_impl.h" #include "content/common/paths_efl.h" namespace content { @@ -35,13 +37,14 @@ static const char* GetEdjeObjectGroupPath(SelectionHandleEfl::HandleType type) { } } -SelectionHandleEfl::SelectionHandleEfl(SelectionControllerEfl& controller, HandleType type, Evas_Object* parent) - : controller_(controller), - pressed_(false), - is_top_(false), - handle_type_(type) { - - Evas* evas = evas_object_evas_get(parent); +SelectionHandleEfl::SelectionHandleEfl(SelectionControllerEfl& controller, + HandleType type) + : controller_(controller), + pressed_(false), + is_top_(false), + handle_type_(type) { + Evas* evas = evas_object_evas_get( + controller_.rwhva()->offscreen_helper()->content_image()); handle_ = edje_object_add(evas); base::FilePath edj_dir; @@ -57,7 +60,12 @@ SelectionHandleEfl::SelectionHandleEfl(SelectionControllerEfl& controller, Handl edje_object_signal_emit(handle_, "edje,focus,in", "edje"); edje_object_signal_emit(handle_, "elm,state,bottom", "elm"); - evas_object_smart_member_add(handle_, parent); + Evas_Object* main_layout_ = + static_cast( + controller_.rwhva()->offscreen_helper()->GetWebContents()) + ->GetEflNativeView(); + Evas_Object* smart_parent = evas_object_smart_parent_get(main_layout_); + evas_object_smart_member_add(handle_, smart_parent); evas_object_propagate_events_set(handle_, false); evas_object_event_callback_add(handle_, EVAS_CALLBACK_MOUSE_DOWN, OnMouseDown, this); @@ -67,11 +75,13 @@ SelectionHandleEfl::SelectionHandleEfl(SelectionControllerEfl& controller, Handl SelectionHandleEfl::~SelectionHandleEfl() { evas_object_event_callback_del(handle_, EVAS_CALLBACK_MOUSE_DOWN, OnMouseDown); evas_object_event_callback_del(handle_, EVAS_CALLBACK_MOUSE_UP, OnMouseUp); + evas_object_smart_member_del(handle_); evas_object_del(handle_); } void SelectionHandleEfl::Show() { evas_object_show(handle_); + evas_object_raise(handle_); } void SelectionHandleEfl::Hide() { @@ -79,13 +89,18 @@ void SelectionHandleEfl::Hide() { } bool SelectionHandleEfl::IsVisible() const { - return evas_object_visible_get(handle_); + int handle_x, handle_y; + evas_object_geometry_get(handle_, &handle_x, &handle_y, nullptr, nullptr); + + auto view_rect = controller_.GetVisibleViewportRect(); + + return evas_object_visible_get(handle_) && + view_rect.Contains(handle_x, handle_y); } void SelectionHandleEfl::Move(const gfx::Point& point) { - if (!pressed_) { + if (!pressed_) ChangeObjectDirection(CalculateDirection(point)); - } if (handle_type_ == HANDLE_TYPE_INPUT) MoveInputHandle(point); @@ -108,32 +123,21 @@ void SelectionHandleEfl::OnMouseDown(void* data, Evas*, Evas_Object*, void* even Evas_Event_Mouse_Down* event = static_cast(event_info); SelectionHandleEfl* handle = static_cast(data); handle->pressed_ = true; - evas_object_event_callback_add(handle->handle_, EVAS_CALLBACK_MOUSE_MOVE, - OnMouseMove, handle); //Save the diff_point between touch point and base point of the handle handle->diff_point_.SetPoint(event->canvas.x - handle->base_point_.x(), event->canvas.y - handle->base_point_.y()); - Evas_Coord x, y; - evas_object_geometry_get(handle->evas_object(), &x, &y, 0, 0); - handle->handle_position_at_touch_down_ = gfx::Point(x, y); - handle->touch_down_position_ = gfx::Point(event->canvas.x, event->canvas.y); - handle->controller_.HandleDragBeginNotification(handle); } -void SelectionHandleEfl::OnMouseMove(void* data, Evas*, Evas_Object*, void* event_info) { - Evas_Event_Mouse_Move* event = static_cast(event_info); - SelectionHandleEfl* handle = static_cast(data); - handle->current_touch_point_.SetPoint(event->cur.canvas.x, event->cur.canvas.y); - ecore_job_add(UpdateMouseMove, handle); +void SelectionHandleEfl::UpdatePosition(const gfx::Point& position) { + current_touch_point_ = position; + ecore_job_add(UpdateMouseMove, this); } void SelectionHandleEfl::OnMouseUp(void* data, Evas*, Evas_Object*, void* /* event_info */) { SelectionHandleEfl* handle = static_cast(data); handle->pressed_ = false; - evas_object_event_callback_del(handle->handle_, EVAS_CALLBACK_MOUSE_MOVE, OnMouseMove); - handle->controller_.HandleDragEndNotification(); } @@ -150,31 +154,23 @@ void SelectionHandleEfl::UpdateMouseMove(void* data) { int delta_y = handle->current_touch_point_.y() - handle->diff_point_.y(); handle->base_point_.SetPoint(delta_x, delta_y); - gfx::Vector2d diff = handle->current_touch_point_ - handle->touch_down_position_; - if (handle->handle_type_ != HANDLE_TYPE_INPUT) { - // We call MoveObject with evas coordinates relative to - // the webview canvas. So we need to ignore the parent - // view offset calculation. - handle->MoveObject(handle->handle_position_at_touch_down_ + diff, - true /*ignore_parent_view_offset*/); - } - handle->controller_.HandleDragUpdateNotification(handle); } SelectionHandleEfl::HandleDirection SelectionHandleEfl::CalculateDirection( const gfx::Point& point) const { - bool reverse_horizontally = false, reverse_vertically = false; - Evas_Coord x, y, deviceWidth, deviceHeight; + bool reverse_horizontally = false, reverse_vertically = false; int handleHeight; - edje_object_part_geometry_get(handle_, "handle", 0, 0, 0, &handleHeight); - evas_object_geometry_get(controller_.GetParentView(), - &x, &y, &deviceWidth, &deviceHeight); - gfx::Point conv_point(point.x() + x, point.y() + y); - gfx::Rect reverse_direction_rect = gfx::Rect(x + kReverseMargin, - y, deviceWidth - 2 * kReverseMargin, deviceHeight - handleHeight); + auto visible_viewport_rect = controller_.GetVisibleViewportRect(); + gfx::Point conv_point(point.x() + visible_viewport_rect.x(), + point.y() + visible_viewport_rect.y()); + + gfx::Rect reverse_direction_rect = gfx::Rect( + visible_viewport_rect.x() + kReverseMargin, visible_viewport_rect.y(), + visible_viewport_rect.width() - 2 * kReverseMargin, + visible_viewport_rect.height() - handleHeight); if (!reverse_direction_rect.Contains(conv_point)) { if (conv_point.x() <= reverse_direction_rect.x() || @@ -188,29 +184,27 @@ SelectionHandleEfl::HandleDirection SelectionHandleEfl::CalculateDirection( } if (handle_type_ != HANDLE_TYPE_INPUT) { - if (reverse_vertically) { - if (reverse_horizontally) { - return DirectionTopReverse; - } else { - return DirectionBottomReverse; - } - } else { - if (reverse_horizontally) { - return DirectionTopNormal; - } else { - return DirectionBottomNormal; - } - } + if (reverse_vertically) { + if (reverse_horizontally) + return DirectionTopReverse; + else + return DirectionBottomReverse; + } else { + if (reverse_horizontally) + return DirectionTopNormal; + else + return DirectionBottomNormal; + } } else { // Input handle can only be rotated horizontally - if (reverse_horizontally) { + if (reverse_horizontally) return DirectionTopNormal; - } else { + else return DirectionBottomNormal; - } } NOTREACHED(); + return DirectionBottomNormal; } void SelectionHandleEfl::ChangeObjectDirection(HandleDirection direction) { @@ -244,20 +238,23 @@ void SelectionHandleEfl::ChangeObjectDirection(HandleDirection direction) { else edje_object_signal_emit(handle_, "elm,state,top,reversed", "elm"); break; - } + } switch (handle_type_) { case HANDLE_TYPE_LEFT: - evas_object_smart_callback_call(controller_.GetParentView(), - "selection,handle,left,direction", &direction); + evas_object_smart_callback_call( + controller_.rwhva()->offscreen_helper()->ewk_view(), + "selection,handle,left,direction", &direction); break; case HANDLE_TYPE_RIGHT: - evas_object_smart_callback_call(controller_.GetParentView(), - "selection,handle,right,direction", &direction); + evas_object_smart_callback_call( + controller_.rwhva()->offscreen_helper()->ewk_view(), + "selection,handle,right,direction", &direction); break; case HANDLE_TYPE_INPUT: - evas_object_smart_callback_call(controller_.GetParentView(), - "selection,handle,large,direction", &direction); + evas_object_smart_callback_call( + controller_.rwhva()->offscreen_helper()->ewk_view(), + "selection,handle,large,direction", &direction); break; } } @@ -279,17 +276,38 @@ gfx::Rect SelectionHandleEfl::GetSelectionRect() const { } void SelectionHandleEfl::MoveObject(const gfx::Point& point, bool ignore_parent_view_offset) { - Evas_Coord x = 0, y = 0; - if (!ignore_parent_view_offset) - evas_object_geometry_get(controller_.GetParentView(), &x, &y, - 0, 0); - - if (handle_type_ == HANDLE_TYPE_INPUT && IsTop()) { - evas_object_move(handle_, point.x() + x, - point.y() + y - controller_.GetLeftRect().height()); - } else { - evas_object_move(handle_, point.x() + x, point.y() + y); + gfx::Rect view_bounds = + controller_.rwhva()->offscreen_helper()->GetViewBoundsInPix(); + int handle_x = point.x() + view_bounds.x(); + int handle_y = point.y() + view_bounds.y(); + + if (IsTop()) { + if (handle_type_ == HANDLE_TYPE_RIGHT) + handle_y -= controller_.GetRightRect().height(); + else + handle_y -= controller_.GetLeftRect().height(); + } + + // Prevent selection handles from moving out of visible webview. + if (handle_type_ != HANDLE_TYPE_INPUT) { + const gfx::Rect& viewport_rect = controller_.GetVisibleViewportRect(); + int viewport_rect_x = viewport_rect.x(); + int viewport_rect_y = viewport_rect.y(); + int viewport_rect_w = viewport_rect.width(); + int viewport_rect_h = viewport_rect.height(); + + if (handle_y < viewport_rect_y) + handle_y = viewport_rect_y; + else if (handle_y > viewport_rect_h + viewport_rect_y) + handle_y = viewport_rect_h + viewport_rect_y; + + if (handle_x < viewport_rect_x) + handle_x = viewport_rect_x; + else if (handle_x > viewport_rect_w + viewport_rect_x) + handle_x = viewport_rect_w + viewport_rect_x; } + + evas_object_move(handle_, handle_x, handle_y); } } // namespace content diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.h b/tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.h index e7efbb2..a886fbf 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.h +++ b/tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.h @@ -41,7 +41,7 @@ class SelectionHandleEfl { DirectionNone, }; - SelectionHandleEfl(SelectionControllerEfl& controller, HandleType type, Evas_Object* parent); + SelectionHandleEfl(SelectionControllerEfl& controller, HandleType type); ~SelectionHandleEfl(); void Show(); void Hide(); @@ -54,9 +54,12 @@ class SelectionHandleEfl { HandleType Type() const { return handle_type_; } + void UpdatePosition(const gfx::Point& position); + void MoveObject(const gfx::Point& point, + bool ignore_parent_view_offset = false); + private: static void OnMouseDown(void* data, Evas*, Evas_Object*, void* event_info); - static void OnMouseMove(void* data, Evas*, Evas_Object*, void* event_info); static void OnMouseUp(void* data, Evas*, Evas_Object*, void* event_info); static void UpdateMouseMove(void* data); @@ -66,7 +69,6 @@ class SelectionHandleEfl { HandleDirection CalculateDirection(const gfx::Point&) const; void ChangeObjectDirection(HandleDirection direction); gfx::Rect GetSelectionRect() const; - void MoveObject(const gfx::Point& point, bool ignore_parent_view_offset = false); // This point is one which will be used during extending selection // it is in web view coordinates @@ -79,14 +81,6 @@ class SelectionHandleEfl { // This save the gap between the touch point and base point when OnMouseDown is called gfx::Point diff_point_; - // Saves the original handle position at the time it started - // being dragged. - gfx::Point handle_position_at_touch_down_; - - // Saves the original touch down position when a handle is grabbed. - // It is later used to calculate the movement offset. - gfx::Point touch_down_position_; - // Parent to send back mouse events SelectionControllerEfl& controller_; diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.cc b/tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.cc index a3db66be..7574dda 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.cc +++ b/tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.cc @@ -8,10 +8,10 @@ #include "base/files/file_path.h" #include "base/path_service.h" +#include "content/browser/renderer_host/render_widget_host_view_aura.h" #include "content/browser/selection/selection_controller_efl.h" #include "content/common/paths_efl.h" #include "content/public/browser/browser_thread.h" -#include "content/public/browser/web_contents.h" namespace content { @@ -20,21 +20,15 @@ const int kHeightOffset = 60; const float kZoomScale = 0.66; SelectionMagnifierEfl::SelectionMagnifierEfl( - content::SelectionControllerEfl* controller, - content::WebContents& web_contents) - : controller_(controller), - web_contents_(web_contents), - content_image_(0), - shown_(false) { - Evas_Object* top_widget = static_cast(controller-> - GetParentView()); - + content::SelectionControllerEfl* controller) + : controller_(controller), content_image_(0), shown_(false) { base::FilePath edj_dir; base::FilePath magnifier_edj; base::PathService::Get(PathsEfl::EDJE_RESOURCE_DIR, &edj_dir); magnifier_edj = edj_dir.Append(FILE_PATH_LITERAL("Magnifier.edj")); - container_ = elm_layout_add(top_widget); + container_ = + elm_layout_add(controller_->rwhva()->offscreen_helper()->content_image()); elm_layout_file_set(container_, magnifier_edj.AsUTF8Unsafe().c_str(), "magnifier"); edje_object_part_geometry_get(elm_layout_edje_get(container_), "bg", 0, 0, &width_, &height_); } @@ -50,14 +44,12 @@ SelectionMagnifierEfl::~SelectionMagnifierEfl() { } void SelectionMagnifierEfl::HandleLongPress(const gfx::Point& touch_point) { - evas_object_event_callback_add(controller_->GetParentView(), - EVAS_CALLBACK_MOUSE_MOVE, - OnAnimatorMove, - this); - evas_object_event_callback_add(controller_->GetParentView(), - EVAS_CALLBACK_MOUSE_UP, - OnAnimatorUp, - this); + evas_object_event_callback_add( + controller_->rwhva()->offscreen_helper()->content_image(), + EVAS_CALLBACK_MOUSE_MOVE, OnAnimatorMove, this); + evas_object_event_callback_add( + controller_->rwhva()->offscreen_helper()->content_image(), + EVAS_CALLBACK_MOUSE_UP, OnAnimatorUp, this); // Call OnAnimatorMove here, so that the magnifier widget // gets properly placed. Other calls to it are expected to // happen as a react to finger/mouse movements. @@ -66,12 +58,12 @@ void SelectionMagnifierEfl::HandleLongPress(const gfx::Point& touch_point) { } void SelectionMagnifierEfl::DisconnectCallbacks() { - evas_object_event_callback_del(controller_->GetParentView(), - EVAS_CALLBACK_MOUSE_MOVE, - OnAnimatorMove); - evas_object_event_callback_del(controller_->GetParentView(), - EVAS_CALLBACK_MOUSE_UP, - OnAnimatorUp); + evas_object_event_callback_del( + controller_->rwhva()->offscreen_helper()->content_image(), + EVAS_CALLBACK_MOUSE_MOVE, OnAnimatorMove); + evas_object_event_callback_del( + controller_->rwhva()->offscreen_helper()->content_image(), + EVAS_CALLBACK_MOUSE_UP, OnAnimatorUp); } void SelectionMagnifierEfl::OnAnimatorMove(void* data, Evas*, Evas_Object*, void*) { @@ -84,9 +76,10 @@ void SelectionMagnifierEfl::OnAnimatorMove(void* data, Evas*, Evas_Object*, void void SelectionMagnifierEfl::OnAnimatorMove() { Evas_Coord_Point point; - evas_pointer_canvas_xy_get(evas_object_evas_get(controller_->GetParentView()), - &point.x, - &point.y); + evas_pointer_canvas_xy_get( + evas_object_evas_get( + controller_->rwhva()->offscreen_helper()->content_image()), + &point.x, &point.y); gfx::Point display_point(point.x, point.y); controller_->HandleLongPressMoveEvent(display_point); UpdateLocation(display_point); @@ -133,11 +126,9 @@ void SelectionMagnifierEfl::MagnifierGetSnapshotCb(Evas_Object* image, void SelectionMagnifierEfl::UpdateLocation(const gfx::Point& location) { int device_x, device_y, device_width, device_height; - evas_object_geometry_get(controller_->GetParentView(), - &device_x, - &device_y, - &device_width, - &device_height); + evas_object_geometry_get( + controller_->rwhva()->offscreen_helper()->content_image(), &device_x, + &device_y, &device_width, &device_height); int zoomedWidth = width_ * kZoomScale; int zoomedHeight = height_ * kZoomScale; @@ -177,11 +168,9 @@ void SelectionMagnifierEfl::UpdateLocation(const gfx::Point& location) { void SelectionMagnifierEfl::Move(const gfx::Point& location) { int device_x, device_y, device_width, device_height; - evas_object_geometry_get(controller_->GetParentView(), - &device_x, - &device_y, - &device_width, - &device_height); + evas_object_geometry_get( + controller_->rwhva()->offscreen_helper()->content_image(), &device_x, + &device_y, &device_width, &device_height); int magnifier_x = location.x(); int magnifier_y = location.y() - height_ - kHeightOffset; @@ -208,8 +197,11 @@ void SelectionMagnifierEfl::Show() { if (rwhv) rwhv->set_magnifier(true); #endif - if (controller_->GetParentView()) - evas_object_smart_callback_call(controller_->GetParentView(), "magnifier,show", NULL); + if (controller_->rwhva()->offscreen_helper()->ewk_view()) { + evas_object_smart_callback_call( + controller_->rwhva()->offscreen_helper()->ewk_view(), "magnifier,show", + nullptr); + } } void SelectionMagnifierEfl::Hide() { @@ -222,8 +214,11 @@ void SelectionMagnifierEfl::Hide() { if (rwhv) rwhv->set_magnifier(false); #endif - if (controller_->GetParentView()) - evas_object_smart_callback_call(controller_->GetParentView(), "magnifier,hide", NULL); + if (controller_->rwhva()->offscreen_helper()->ewk_view()) { + evas_object_smart_callback_call( + controller_->rwhva()->offscreen_helper()->ewk_view(), "magnifier,hide", + nullptr); + } } } diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.h b/tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.h index f84bff4..b80129d 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.h +++ b/tizen_src/chromium_impl/content/browser/selection/selection_magnifier_efl.h @@ -15,12 +15,10 @@ namespace content { class SelectionControllerEfl; -class WebContents; class SelectionMagnifierEfl { public: - SelectionMagnifierEfl(content::SelectionControllerEfl* controller, - WebContents& web_contents); + SelectionMagnifierEfl(content::SelectionControllerEfl* controller); ~SelectionMagnifierEfl(); void HandleLongPress(const gfx::Point& touch_point); @@ -42,8 +40,6 @@ class SelectionMagnifierEfl { // Parent to send back mouse events SelectionControllerEfl* controller_; - WebContents& web_contents_; - // Magnifier Evas_Object* container_; diff --git a/tizen_src/chromium_impl/edje_resources/MainLayout.edc b/tizen_src/chromium_impl/edje_resources/MainLayout.edc index 3c4c1ac..d560283 100644 --- a/tizen_src/chromium_impl/edje_resources/MainLayout.edc +++ b/tizen_src/chromium_impl/edje_resources/MainLayout.edc @@ -15,6 +15,32 @@ collections { base_scale: 2.0; rel2 { relative: 1.0 1.0; } } } + part { + name: "autofill_popup"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to:"content";} + rel2 { relative: 1.0 1.0; to:"content";} + } + } + part { + name: "context_menu_popup"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to:"content";} + rel2 { relative: 1.0 1.0; to:"content";} + } + } } } } 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 2d36be4..3a221bf 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 @@ -10,6 +10,7 @@ #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/ui/popup_item_ids.h" #include "content/browser/renderer_host/render_widget_host_view_aura.h" +#include "content/browser/web_contents/web_contents_impl.h" #include "content/common/paths_efl.h" #include "eweb_view.h" #include "tizen/system_info.h" @@ -41,13 +42,21 @@ AutofillPopupViewEfl::AutofillPopupViewEfl(EWebView* view) autofill_list_(nullptr), password_popup_(nullptr), selected_line_(-1) { - Evas_Object* widgetWin_ = elm_object_top_widget_get( - elm_object_parent_widget_get(view->evas_object())); - if (!widgetWin_) - widgetWin_ = view->evas_object(); - autofill_popup_ = elm_layout_add(widgetWin_); + auto native_view = + static_cast(&(webview_->web_contents())) + ->GetEflNativeView(); + if (!autofill_popup_) return; + auto smart_parent = evas_object_smart_parent_get(native_view); + if (!smart_parent) { + LOG(ERROR) << "Unable to get smart parent from native view"; + evas_object_del(autofill_popup_); + autofill_popup_ = nullptr; + return; + } + evas_object_smart_member_add(autofill_popup_, smart_parent); + elm_object_part_content_set(smart_parent, "autofill_popup", autofill_popup_); base::FilePath edj_dir; base::FilePath autofill_edj; base::PathService::Get(PathsEfl::EDJE_RESOURCE_DIR, &edj_dir); @@ -60,8 +69,10 @@ AutofillPopupViewEfl::AutofillPopupViewEfl(EWebView* view) AutofillPopupViewEfl::~AutofillPopupViewEfl() { - if (autofill_popup_) + if (autofill_popup_) { + evas_object_smart_member_del(autofill_popup_); evas_object_del(autofill_popup_); + } if (password_popup_) evas_object_del(password_popup_); } diff --git a/tizen_src/ewk/efl_integration/browser/autofill_popup_view_efl.h b/tizen_src/ewk/efl_integration/browser/autofill_popup_view_efl.h index c7b4fd1..52255e9 100644 --- a/tizen_src/ewk/efl_integration/browser/autofill_popup_view_efl.h +++ b/tizen_src/ewk/efl_integration/browser/autofill_popup_view_efl.h @@ -26,6 +26,10 @@ namespace gfx { class RectF; } +namespace content { +class WebContentsImpl; +} + namespace autofill { class AutofillPopupViewEfl { diff --git a/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc b/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc index ce3b6c8..4570b01 100644 --- a/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc +++ b/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc @@ -12,6 +12,7 @@ #include "base/strings/utf_string_conversions.h" #include "browser_context_efl.h" #include "common/web_contents_utils.h" +#include "content/browser/renderer_host/render_widget_host_view_aura.h" #include "content/browser/selection/selection_controller_efl.h" #include "content/common/paths_efl.h" #include "content/public/browser/browser_thread.h" @@ -207,16 +208,18 @@ void ContextMenuControllerEfl::GetProposedContextMenu() { params_.link_url.spec(), params_.link_url.spec()); } -#if !defined(EWK_BRINGUP) - RenderWidgetHostViewEfl* rwhv = static_cast(web_contents_.GetRenderWidgetHostView()); + RenderWidgetHostViewAura* rwhva = static_cast( + web_contents_.GetRenderWidgetHostView()); if ((params_.media_type != ContextMenuDataMediaType::kImage && !params_.selection_text.empty()) || - (params_.is_editable && (rwhv && !rwhv->IsLastAvailableTextEmpty()))) { + (params_.is_editable && + (rwhva && rwhva->offscreen_helper()->HasSelectableText()))) { AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_SELECT_WORD, std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_SELECT_ABB"))); AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_SELECT_ALL, std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_SELECT_ALL_ABB"))); } +#if !defined(EWK_BRINGUP) if (params_.is_draggable) { AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_DRAG, std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_DRAG_AND_DROP"))); @@ -260,6 +263,15 @@ bool ContextMenuControllerEfl::CreateContextMenu() { if (!popup_) return false; + auto smart_parent = evas_object_smart_parent_get(native_view_); + if (!smart_parent) { + LOG(ERROR) << "Unable to get smart parent from native view"; + evas_object_del(popup_); + popup_ = nullptr; + return false; + } + evas_object_smart_member_add(popup_, smart_parent); + elm_object_part_content_set(smart_parent, "context_menu_popup", popup_); evas_object_data_set(popup_, "ContextMenuContollerEfl", this); @@ -382,8 +394,14 @@ bool ContextMenuControllerEfl::CreateContextMenu() { void ContextMenuControllerEfl::ContextMenuHWBackKey(void* data, Evas_Object* obj, void* event_info) { - ContextMenuControllerEfl* menu_controller = static_cast(data); + auto menu_controller = static_cast(data); if (menu_controller) { + auto selection_controller = + menu_controller->webview_->GetSelectionController(); + + if (selection_controller) + selection_controller->ToggleCaretAfterSelection(); + menu_controller->HideContextMenu(); evas_object_data_del(obj, "ContextEfl"); } @@ -494,16 +512,19 @@ bool ContextMenuControllerEfl::ShowContextMenu() { } web_contents_.Focus(); } else { + evas_object_smart_callback_add(popup_, "block,clicked", + BlockClickedCallback, this); + } + #if BUILDFLAG(IS_TIZEN) eext_object_event_callback_add(popup_, EEXT_CALLBACK_BACK, ContextMenuHWBackKey, this); // Workaround. After context menu shows up, there is "unfocused" event fired. // evas_object_smart_callback_add(popup_, "unfocused", ContextMenuHWBackKey, this); evas_object_focus_set(popup_, EINA_TRUE); #endif - evas_object_smart_callback_add(popup_, "block,clicked", BlockClickedCallback, this); - } - evas_object_show(popup_); - return true; + evas_object_show(popup_); + evas_object_raise(popup_); + return true; } void ContextMenuControllerEfl::HideSelectionHandle() { @@ -969,23 +990,28 @@ void ContextMenuControllerEfl::MenuItemSelected(ContextMenuItemEfl* menu_item) void ContextMenuControllerEfl::HideContextMenu() { if (popup_) { + evas_object_event_callback_del(popup_, EVAS_CALLBACK_RESIZE, + ContextMenuPopupResize); evas_object_del(popup_); - popup_ = NULL; + popup_ = nullptr; } _context_menu_resized = false; - if (menu_items_) { + if (IsMobileProfile()) { +#if !defined(EWK_BRINGUP) + context_menu_status_ = HIDDEN; +#endif + } else if (menu_items_) { void* data; EINA_LIST_FREE(menu_items_, data) { _Ewk_Context_Menu_Item *item = static_cast<_Ewk_Context_Menu_Item*> (data); delete item; } - menu_items_ = NULL; + menu_items_ = nullptr; } } - void ContextMenuControllerEfl::SetPopupSize(int width, int height) { if (save_fail_dialog_) save_fail_dialog_->SetPopupSize(width, height); @@ -1005,6 +1031,7 @@ void ContextMenuControllerEfl::DeletePopup() { if (popup_) { evas_object_data_set(popup_, "ContextMenuContollerEfl", 0); + evas_object_smart_member_del(popup_); evas_object_del(popup_); popup_ = 0; } diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index cfa4506..b6bc1a0 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -111,6 +111,10 @@ const char kReplaceWith[] = "_"; static const char* kRendererCrashedHTMLMessage = "

Renderer process has crashed!

"; +// "visible,content,changed" is an email-app specific signal which informs +// that the web view is only partially visible. +static const char* kVisibleContentChangedSignalName = "visible,content,changed"; + inline void SetDefaultStringIfNull(const char*& variable, const char* default_string) { if (!variable) { @@ -268,6 +272,15 @@ void EWebView::OnViewFocusOut(void* data, Evas*, Evas_Object*, void*) { view->SetFocus(EINA_FALSE); } +void EWebView::VisibleContentChangedCallback(void* user_data, + Evas_Object* /*object*/, + void* event_info) { + auto view = static_cast(user_data); + auto rect = static_cast(event_info); + view->GetSelectionController()->SetCustomVisibleViewRect( + gfx::Rect(rect->x, rect->y, rect->w, rect->h)); +} + EWebView::EWebView(Ewk_Context* context, Evas_Object* object) : context_(context), evas_object_(object), @@ -283,10 +296,14 @@ EWebView::EWebView(Ewk_Context* context, Evas_Object* object) y_delta_(0.0), is_initialized_(false) { if (evas_object_) { - evas_object_event_callback_add(evas_object_, EVAS_CALLBACK_FOCUS_IN, - OnViewFocusIn, this); - evas_object_event_callback_add(evas_object_, EVAS_CALLBACK_FOCUS_OUT, - OnViewFocusOut, this); + evas_object_smart_callback_add(evas_object_, + kVisibleContentChangedSignalName, + VisibleContentChangedCallback, this); + + evas_object_event_callback_add(evas_object_, EVAS_CALLBACK_FOCUS_IN, + OnViewFocusIn, this); + evas_object_event_callback_add(evas_object_, EVAS_CALLBACK_FOCUS_OUT, + OnViewFocusOut, this); } } @@ -407,6 +424,9 @@ EWebView::~EWebView() { OnViewFocusIn); evas_object_event_callback_del(evas_object_, EVAS_CALLBACK_FOCUS_OUT, OnViewFocusOut); + evas_object_smart_callback_del(evas_object_, + kVisibleContentChangedSignalName, + VisibleContentChangedCallback); } } @@ -1348,10 +1368,8 @@ void EWebView::GetScrollSize(int* width, int* height) { } void EWebView::MoveCaret(const gfx::Point& point) { -#if !defined(USE_AURA) - if (rwhv()) - rwhv()->MoveCaret(point); -#endif + if (rwhva()) + rwhva()->offscreen_helper()->MoveCaret(point); } SelectionControllerEfl* EWebView::GetSelectionController() const { @@ -1507,17 +1525,19 @@ _Ewk_Hit_Test* EWebView::RequestHitTestDataAtBlinkCoords( void EWebView::EvasToBlinkCords(int x, int y, int* view_x, int* view_y) { DCHECK(display::Screen::GetScreen()); - Evas_Coord tmpX, tmpY; - evas_object_geometry_get(evas_object_, &tmpX, &tmpY, NULL, NULL); + if (!rwhva()) + return; + + gfx::Rect view_bounds = rwhva()->offscreen_helper()->GetViewBoundsInPix(); if (view_x) { - *view_x = x - tmpX; + *view_x = x - view_bounds.x(); *view_x /= display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor(); } if (view_y) { - *view_y = y - tmpY; + *view_y = y - view_bounds.y(); *view_y /= display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor(); } diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index 27fb2af..e85a825 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -715,6 +715,9 @@ class EWebView { static void OnViewFocusIn(void* data, Evas*, Evas_Object*, void*); static void OnViewFocusOut(void* data, Evas*, Evas_Object*, void*); + static void VisibleContentChangedCallback(void* user_data, + Evas_Object* object, + void* event_info); scoped_refptr evas_event_handler_; scoped_refptr context_; -- 2.7.4 From 6ad038d42501cba9a19064b3a7652b8a420b3270 Mon Sep 17 00:00:00 2001 From: "ayush.k123" Date: Fri, 17 Feb 2023 11:22:49 +0530 Subject: [PATCH 15/16] [M108 Migration] Remove EWK_BRINGUP from ewk_view_scroll_by code This patch sets scroll offset via mojo connection instead of legacy ipc. Reference: https://review.tizen.org/gerrit/282703/ Change-Id: Ib2607477ab3b4bcc4f2b8524349803ada5661f76 Signed-off-by: Ayush Kumar --- content/test/test_page_broadcast.cc | 2 ++ content/test/test_page_broadcast.h | 1 + third_party/blink/public/mojom/page/page.mojom | 3 +++ .../blink/renderer/core/exported/web_view_impl.cc | 5 +++++ third_party/blink/renderer/core/exported/web_view_impl.h | 1 + tizen_src/ewk/efl_integration/eweb_view.cc | 16 +++++++--------- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/content/test/test_page_broadcast.cc b/content/test/test_page_broadcast.cc index 41c3473..57fad67 100644 --- a/content/test/test_page_broadcast.cc +++ b/content/test/test_page_broadcast.cc @@ -47,6 +47,8 @@ void TestPageBroadcast::SetHistoryOffsetAndLength(int32_t history_offset, #if BUILDFLAG(IS_EFL) void TestPageBroadcast::ScrollFocusedNodeIntoView() {} + +void TestPageBroadcast::SetScrollOffset(float x, float y) {} #endif void TestPageBroadcast::SetPageBaseBackgroundColor( diff --git a/content/test/test_page_broadcast.h b/content/test/test_page_broadcast.h index 15977c3..c501cfc 100644 --- a/content/test/test_page_broadcast.h +++ b/content/test/test_page_broadcast.h @@ -35,6 +35,7 @@ class TestPageBroadcast : public blink::mojom::PageBroadcast { int32_t history_length) override; #if BUILDFLAG(IS_EFL) void ScrollFocusedNodeIntoView() override; + void SetScrollOffset(float x, float y) override; #endif void SetPageBaseBackgroundColor(absl::optional color) override; void CreateRemoteMainFrame( diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom index 07f3ff8..d48ab58 100644 --- a/third_party/blink/public/mojom/page/page.mojom +++ b/third_party/blink/public/mojom/page/page.mojom @@ -107,6 +107,9 @@ interface PageBroadcast { [EnableIf=is_efl] ScrollFocusedNodeIntoView(); + [EnableIf=is_efl] + SetScrollOffset(float x, float y); + // Sent to whole page, but should only be used by the main frame. SetPageBaseBackgroundColor(skia.mojom.SkColor? color); 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 dc80bce..8d44cb5 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -4257,6 +4257,11 @@ bool WebViewImpl::MoveFocusToPrevious(TraverseFocusThrough filter) { return handled; } + +void WebViewImpl::SetScrollOffset(float x, float y) { + if (auto* focused_frame = FocusedFrame()) + focused_frame->SetScrollOffset(gfx::PointF(x, y)); +} #endif #if defined(TIZEN_VIDEO_HOLE) diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h index 11556ab..29c90f5 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.h +++ b/third_party/blink/renderer/core/exported/web_view_impl.h @@ -235,6 +235,7 @@ class CORE_EXPORT WebViewImpl final : public WebView, bool HasAcceleratedCanvasWithinViewport() const override; void SetLongPollingGlobalTimeout(uint64_t timeout) override; void ScrollFocusedNodeIntoView() override; + void SetScrollOffset(float x, float y) override; #endif // Functions to add and remove observers for this object. diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index b6bc1a0..4d4baa0 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -1307,15 +1307,13 @@ void EWebView::ChangeScroll(int& x, int& y) { } void EWebView::SetScroll(int x, int y) { - RenderViewHost* render_view_host = web_contents_->GetRenderViewHost(); - if (!render_view_host) - return; - - ChangeScroll(x, y); -#if !defined(EWK_BRINGUP) // FIXME: m94 bringup - render_view_host->Send( - new EwkViewMsg_SetScroll(render_view_host->GetRoutingID(), x, y)); -#endif + if (auto* render_view_host = web_contents_->GetRenderViewHost()) { + if (auto& broadcast = static_cast(render_view_host) + ->GetAssociatedPageBroadcast()) { + ChangeScroll(x, y); + broadcast->SetScrollOffset(x, y); + } + } } void EWebView::UseSettingsFont() { -- 2.7.4 From ef24f9b328e0507cfee4cf1a78414639e643fc1f Mon Sep 17 00:00:00 2001 From: jingjieli Date: Mon, 20 Feb 2023 14:16:27 +0800 Subject: [PATCH 16/16] [M108 Migration][VD] Change default certificate path for ubrowser. VD Security part request certificate user change certificate path. Migrate patch from M94 AURA: https://review.tizen.org/gerrit/#/c/279390/ Change-Id: I8c525905be0b59ad13b9174f968c22a6bbed771d Signed-off-by: jingjieli --- tizen_src/ewk/ubrowser/browser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tizen_src/ewk/ubrowser/browser.cc b/tizen_src/ewk/ubrowser/browser.cc index 8a8cb87..025e28e 100644 --- a/tizen_src/ewk/ubrowser/browser.cc +++ b/tizen_src/ewk/ubrowser/browser.cc @@ -21,7 +21,7 @@ static int kDefaultMobileWindowWidth = 360; static int kDefaultMobileWindowHeight = 640; #if BUILDFLAG(IS_TIZEN_TV) static std::string kDefaultCookiePath = "/home/owner/.cookie"; -static std::string kDefaultCertificatePath = "/usr/share/cert/webbrowser.pem"; +static std::string kDefaultCertificatePath = "/opt/data/cert/vdca.pem"; static double kDefaultZoomFactor = 1.5; static int kDefaultDesktopWindowWidth = 1920; static int kDefaultDesktopWindowHeight = 1048; -- 2.7.4