[M108 Migration][NativeControl] Select Picker 75/288175/9
authorayush.k123 <ayush.k123@samsung.com>
Fri, 10 Feb 2023 03:12:20 +0000 (08:42 +0530)
committerBot Blink <blinkbot@samsung.com>
Thu, 16 Feb 2023 21:09:24 +0000 (21:09 +0000)
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 <ayush.k123@samsung.com>
41 files changed:
third_party/blink/public/web/web_view.h
third_party/blink/renderer/core/exported/web_view_impl.cc
third_party/blink/renderer/core/exported/web_view_impl.h
third_party/blink/renderer/core/html/forms/external_popup_menu.cc
tizen_src/chromium_impl/content/browser/browser_efl.gni
tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.cc [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/select_picker/form_navigable_picker.h [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.cc [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/select_picker/select_picker_base.h [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.cc [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/select_picker/select_picker_mobile_base.h [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.cc [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.h [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.cc [new file with mode: 0644]
tizen_src/chromium_impl/content/browser/select_picker/select_picker_util.h [new file with mode: 0644]
tizen_src/chromium_impl/third_party/blink/renderer/core/layout/layout_theme_chromium_tizen.cc
tizen_src/ewk/efl_integration/BUILD.gn
tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.cc [new file with mode: 0644]
tizen_src/ewk/efl_integration/browser/select_picker/select_picker_mobile.h [new file with mode: 0644]
tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.cc [new file with mode: 0644]
tizen_src/ewk/efl_integration/browser/select_picker/select_picker_tv.h [new file with mode: 0644]
tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.cc [deleted file]
tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.h [deleted file]
tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item_private.h [deleted file]
tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.cc [deleted file]
tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.h [deleted file]
tizen_src/ewk/efl_integration/browser/web_view_browser_message_filter.cc
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.cc
tizen_src/ewk/efl_integration/renderer/render_frame_observer_efl.h
tizen_src/ewk/efl_integration/resource/BUILD.gn
tizen_src/ewk/efl_integration/resource/control.edc
tizen_src/ewk/efl_integration/resource/controlTV.edc [new file with mode: 0644]
tizen_src/ewk/efl_integration/resource/images/highlight_stroke.png [new file with mode: 0644]
tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down.png [new file with mode: 0644]
tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down_f.png [new file with mode: 0644]
tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up.png [new file with mode: 0644]
tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up_f.png [new file with mode: 0644]
tizen_src/ewk/efl_integration/web_contents_efl_delegate_ewk.cc
tizen_src/ewk/efl_integration/web_contents_observer_efl.cc

index 91135d7..f8ad0aa 100644 (file)
@@ -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<blink::WebView::TraverseFocusThrough>(
+      static_cast<char>(a) | static_cast<char>(b));
+}
+static inline blink::WebView::TraverseFocusThrough operator&(
+    blink::WebView::TraverseFocusThrough a,
+    blink::WebView::TraverseFocusThrough b) {
+  return static_cast<blink::WebView::TraverseFocusThrough>(
+      static_cast<char>(a) & static_cast<char>(b));
+}
+#endif
+
 #endif  // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_VIEW_H_
index ab133fb..dc80bce 100644 (file)
 
 #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<bool>((char)filter &
+                           (char)WebView::TraverseFocusThrough::SelectElement);
+}
+
+bool WebViewImpl::FiltersInEditableElement(
+    WebView::TraverseFocusThrough filter) {
+  return static_cast<bool>(
+      (char)filter & (char)WebView::TraverseFocusThrough::EditableElement);
+}
+
+bool WebViewImpl::IsFormNavigationTextInput(Element& element) const {
+  if (element.HasTagName(html_names::kInputTag) &&
+      DynamicTo<HTMLInputElement>(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<LocalFrame>(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<HTMLFrameOwnerElement>(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<HTMLFrameOwnerElement>(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)
index 5c3d4a2..11556ab 100644 (file)
@@ -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<SkColor> 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.
index e28ce00..d953952 100644 (file)
@@ -252,7 +252,13 @@ void ExternalPopupMenu::DidAcceptIndices(const Vector<int32_t>& 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() {
index 3c93549..5532b96 100644 (file)
@@ -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 (file)
index 0000000..2d3d543
--- /dev/null
@@ -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 <efl_extension.h>
+#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<blink::mojom::MenuItemPtr> 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<FormNavigablePicker*>(data);
+  picker->FormNavigate(true);
+}
+
+void FormNavigablePicker::NavigateToPrevCallback(void* data,
+                                                 Evas_Object* obj,
+                                                 const char* emission,
+                                                 const char* source) {
+  auto picker = static_cast<FormNavigablePicker*>(data);
+  picker->FormNavigate(false);
+}
+
+void FormNavigablePicker::KeyUpCallback(void* data,
+                                        Evas* e,
+                                        Evas_Object* obj,
+                                        void* event_info) {
+  auto key_struct = static_cast<Evas_Event_Key_Up*>(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<FormNavigablePicker*>(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<FormNavigablePicker*>(user_data);
+  if (type == ECORE_EVENT_KEY_DOWN && picker->IsVisible()) {
+    std::string key_name = static_cast<Ecore_Event_Key*>(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 (file)
index 0000000..983db71
--- /dev/null
@@ -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<blink::mojom::MenuItemPtr> 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 (file)
index 0000000..a4668c7
--- /dev/null
@@ -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 <class T>
+void InsertSorted(std::vector<T>& vec, const T value) {
+  vec.insert(std::upper_bound(vec.begin(), vec.end(), value), value);
+}
+
+template <class T>
+size_t SearchValue(const std::vector<T>& 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 <class T>
+void RemoveValue(std::vector<T>& 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<GenlistCallbackData*>(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<blink::mojom::MenuItemPtr> 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<GenlistCallbackData*>(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<int>(select_picker_data_.size()))
+    return;
+  // In order to reuse RenderFrameHostImpl::DidSelectPopupMenuItems() method
+  // in Android, put selectedIndex into std::vector<int>.
+  std::vector<int> 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<SelectPickerBase*>(data);
+  auto selected = static_cast<Elm_Object_Item*>(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<SelectPickerBase*>(data);
+  auto deselectedItem = static_cast<Elm_Object_Item*>(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<blink::mojom::MenuItemPtr> 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 (file)
index 0000000..95d62a6
--- /dev/null
@@ -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 <Elementary.h>
+#include <vector>
+
+#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<blink::mojom::MenuItemPtr> 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<blink::mojom::MenuItemPtr> 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<blink::mojom::MenuItemPtr> items) = 0;
+  virtual void ItemSelected(GenlistCallbackData* data, void* event_info);
+  void InitializeSelectedPickerData(
+      std::vector<blink::mojom::MenuItemPtr> 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<GenlistCallbackData*> select_picker_data_;
+  std::vector<int> 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 (file)
index 0000000..55ae1ab
--- /dev/null
@@ -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<GenlistCallbackData*>(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<blink::mojom::MenuItemPtr> 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<GenlistCallbackData*>(data);
+  auto picker =
+      static_cast<SelectPickerMobileBase*>(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<blink::mojom::MenuItemPtr> 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 (file)
index 0000000..a60b360
--- /dev/null
@@ -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<blink::mojom::MenuItemPtr> items,
+            const gfx::Rect& bounds) override;
+  void ItemSelected(GenlistCallbackData* data, void* event_info) override;
+  void ClearData() override;
+  void CreateAndPopulatePopupList(
+      std::vector<blink::mojom::MenuItemPtr> 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 (file)
index 0000000..1422a45
--- /dev/null
@@ -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 <select> picker
+const int kBoxWidth = 400;
+const int kBoxHeight = 500;
+const float kBoxRatio = 0.4;
+}  // namespace
+
+SelectPickerTvBase::SelectPickerTvBase(Evas_Object* evas_object,
+                                       int selected_index,
+                                       bool is_multiple_selection)
+    : FormNavigablePicker(evas_object, selected_index, is_multiple_selection) {
+  evas_object_size_hint_weight_set(layout_, kBoxWidth, kBoxHeight);
+  evas_object_resize(layout_, kBoxWidth, kBoxHeight);
+}
+
+SelectPickerTvBase::~SelectPickerTvBase() {
+  Hide();
+}
+
+const char* SelectPickerTvBase::GetItemStyle() const {
+  return "APP_STYLE";
+}
+
+void SelectPickerTvBase::Init(std::vector<blink::mojom::MenuItemPtr> 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("controlTV.edj", true);
+  evas_object_move(layout_, bounds.x(), bounds.y());
+  CreateAndPopulatePopupList(std::move(items));
+  elm_bg_color_set(AddBackground(), 231, 234, 242);
+  AddDoneButton();
+}
+
+void SelectPickerTvBase::CreateAndPopulatePopupList(
+    std::vector<blink::mojom::MenuItemPtr> items) {
+  popup_list_ = elm_genlist_add(layout_);
+  elm_object_style_set(popup_list_, "styleA");
+  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 = nullptr;
+  elm_genlist_multi_select_set(popup_list_, is_multiple_selection_);
+  InitializeSelectedPickerData(std::move(items));
+  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_tv_base.h b/tizen_src/chromium_impl/content/browser/select_picker/select_picker_tv_base.h
new file mode 100644 (file)
index 0000000..85426ed
--- /dev/null
@@ -0,0 +1,31 @@
+// 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_TV_BASE_H_
+#define CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_TV_BASE_H_
+
+#include "content/browser/select_picker/form_navigable_picker.h"
+
+class SelectPickerTvBase : public FormNavigablePicker {
+ public:
+  explicit SelectPickerTvBase(Evas_Object* evas_object,
+                              int selected_index,
+                              bool is_multiple_selection);
+  virtual ~SelectPickerTvBase() override;
+
+  SelectPickerTvBase(const SelectPickerTvBase&) = delete;
+  SelectPickerTvBase& operator=(const SelectPickerTvBase&) = delete;
+
+ protected:
+  const char* GetItemStyle() const override;
+
+ private:
+  // SelectPickerBase
+  void Init(std::vector<blink::mojom::MenuItemPtr> items,
+            const gfx::Rect& bounds) override;
+  void CreateAndPopulatePopupList(
+      std::vector<blink::mojom::MenuItemPtr> items) override;
+};
+
+#endif  // CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_TV_BASE_H_
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
new file mode 100644 (file)
index 0000000..5cc09fa
--- /dev/null
@@ -0,0 +1,62 @@
+// 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_util.h"
+
+#include "base/strings/utf_string_conversions.h"
+
+GenlistCallbackData::GenlistCallbackData(
+    int index,
+    SelectPickerBase* select_picker,
+    blink::mojom::MenuItemPtr menu_item,
+    Evas_Object* genlist,
+    const Elm_Genlist_Item_Class* item_class,
+    const Elm_Genlist_Item_Class* group_class,
+    bool is_multiple_selection,
+    Evas_Smart_Cb item_selected_cb)
+    : index_(index),
+      select_picker_(select_picker),
+      menu_item_(std::move(menu_item)) {
+  bool is_option_type =
+      (menu_item_->type == blink::mojom::MenuItem::Type::kOption);
+  elm_item_ = elm_genlist_item_append(
+      genlist, is_option_type ? item_class : group_class, this, nullptr,
+      ELM_GENLIST_ITEM_NONE, is_multiple_selection ? nullptr : item_selected_cb,
+      is_multiple_selection ? nullptr : this);
+  if (!is_option_type)
+    elm_genlist_item_select_mode_set(elm_item_,
+                                     ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+  if (is_multiple_selection && menu_item_->checked)
+    elm_genlist_item_selected_set(elm_item_, EINA_TRUE);
+  elm_object_item_disabled_set(elm_item_, !menu_item_->enabled);
+}
+
+GenlistCallbackData::~GenlistCallbackData() {
+  if (elm_item_)
+    elm_object_item_del(elm_item_);
+}
+
+void GenlistCallbackData::SetSelection(bool selected) {
+  elm_genlist_item_selected_set(elm_item_, selected ? EINA_TRUE : EINA_FALSE);
+}
+
+void GenlistCallbackData::ScrollToTop() {
+  elm_genlist_item_show(elm_item_, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+}
+
+int GenlistCallbackData::GetIndex() const {
+  return index_;
+}
+
+const std::string& GenlistCallbackData::GetLabel() const {
+  return menu_item_->label.value();
+}
+
+SelectPickerBase* GenlistCallbackData::GetSelectPicker() const {
+  return select_picker_;
+}
+
+bool GenlistCallbackData::IsEnabled() const {
+  return menu_item_->enabled;
+}
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
new file mode 100644 (file)
index 0000000..77ad829
--- /dev/null
@@ -0,0 +1,43 @@
+// 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_UTIL_H_
+#define CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_UTIL_H_
+
+#include <Elementary.h>
+
+#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
+
+class SelectPickerBase;
+
+class GenlistCallbackData {
+ public:
+  GenlistCallbackData(int index,
+                      SelectPickerBase* select_picker,
+                      blink::mojom::MenuItemPtr menu_item,
+                      Evas_Object* genlist,
+                      const Elm_Genlist_Item_Class* item_class,
+                      const Elm_Genlist_Item_Class* group_class,
+                      bool is_multiple_selection,
+                      Evas_Smart_Cb item_selected_cb);
+  ~GenlistCallbackData();
+
+  GenlistCallbackData(const GenlistCallbackData&) = delete;
+  GenlistCallbackData& operator=(const GenlistCallbackData&) = delete;
+
+  void SetSelection(bool selected);
+  void ScrollToTop();
+  int GetIndex() const;
+  const std::string& GetLabel() const;
+  SelectPickerBase* GetSelectPicker() const;
+  bool IsEnabled() const;
+
+ private:
+  int index_;
+  SelectPickerBase* select_picker_;
+  Elm_Object_Item* elm_item_;
+  blink::mojom::MenuItemPtr menu_item_;
+};
+
+#endif  // CONTENT_BROWSER_SELECT_PICKER_SELECT_PICKER_UTIL_H_
index bd7edce..eb655d8 100644 (file)
@@ -36,7 +36,7 @@ String LayoutThemeChromiumTizen::ExtraDefaultStyleSheet() {
 }
 
 bool LayoutThemeChromiumTizen::DelegatesMenuListRendering() const {
-  return IsTvProfile() ? false : true;
+  return true;
 }
 
 Color LayoutThemeChromiumTizen::PlatformTapHighlightColor() const {
index 3679350..bbb71dc 100755 (executable)
@@ -329,11 +329,10 @@ shared_library("chromium-ewk") {
     "browser/password_manager/password_store_factory.cc",
     "browser/password_manager/password_store_factory.h",
     "browser/policy_response_params.h",
-    "browser/selectpicker/popup_menu_item.cc",
-    "browser/selectpicker/popup_menu_item.h",
-    "browser/selectpicker/popup_menu_item_private.h",
-    "browser/selectpicker/popup_picker.cc",
-    "browser/selectpicker/popup_picker.h",
+    "browser/select_picker/select_picker_mobile.cc",
+    "browser/select_picker/select_picker_mobile.h",
+    "browser/select_picker/select_picker_tv.cc",
+    "browser/select_picker/select_picker_tv.h",
     "browser/vibration/vibration_provider_client.cc",
     "browser/vibration/vibration_provider_client.h",
     "browser/web_cache_efl/web_cache_manager_efl.cc",
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
new file mode 100644 (file)
index 0000000..4b507f0
--- /dev/null
@@ -0,0 +1,45 @@
+// 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 "browser/select_picker/select_picker_mobile.h"
+
+#include "common/render_messages_ewk.h"
+#include "eweb_view.h"
+
+SelectPickerMobile::SelectPickerMobile(EWebView* web_view,
+                                       int selected_index,
+                                       bool is_multiple_selection)
+    : SelectPickerMobileBase(web_view->evas_object(),
+                             selected_index,
+                             is_multiple_selection),
+      web_view_(web_view) {}
+
+content::WebContentsViewAura* SelectPickerMobile::wcva() const {
+  return web_view_->wcva();
+}
+
+void SelectPickerMobile::HidePopupMenu() {
+  web_view_->HidePopupMenu();
+}
+
+void SelectPickerMobile::FormNavigate(bool direction) {
+  auto* rfh = static_cast<content::RenderFrameHostImpl*>(
+      web_view_->web_contents().GetFocusedFrame());
+  if (!rfh)
+    return;
+
+  web_view_->DidCancelPopupMenu();
+  rfh->Send(new EwkFrameMsg_MoveToNextOrPreviousSelectElement(
+      rfh->GetRoutingID(), direction));
+}
+
+void SelectPickerMobile::RequestFormNavigationInformation() {
+  auto* rfh = static_cast<content::RenderFrameHostImpl*>(
+      web_view_->web_contents().GetFocusedFrame());
+  if (!rfh)
+    return;
+
+  rfh->Send(
+      new EwkFrameMsg_RequestSelectCollectionInformation(rfh->GetRoutingID()));
+}
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
new file mode 100644 (file)
index 0000000..96a3c38
--- /dev/null
@@ -0,0 +1,34 @@
+// 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 EWK_EFL_INTEGRATION_BROWSER_SELECT_PICKER_SELECT_PICKER_H_
+#define EWK_EFL_INTEGRATION_BROWSER_SELECT_PICKER_SELECT_PICKER_H_
+
+#include "content/browser/select_picker/select_picker_mobile_base.h"
+
+class EWebView;
+
+class SelectPickerMobile : public SelectPickerMobileBase {
+ public:
+  explicit SelectPickerMobile(EWebView* web_view,
+                              int selected_index,
+                              bool is_multiple_selection);
+  virtual ~SelectPickerMobile() override {}
+
+  SelectPickerMobile(const SelectPickerMobile&) = delete;
+  SelectPickerMobile& operator=(const SelectPickerMobile&) = delete;
+
+ private:
+  // FormNavigablePicker
+  void FormNavigate(bool direction) override;
+  void RequestFormNavigationInformation() override;
+  void HidePopupMenu() override;
+
+  // SelectPickerBase
+  content::WebContentsViewAura* wcva() const override;
+
+  EWebView* web_view_;
+};
+
+#endif  // EWK_EFL_INTEGRATION_BROWSER_SELECT_PICKER_SELECT_PICKER_H_
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
new file mode 100644 (file)
index 0000000..70fd877
--- /dev/null
@@ -0,0 +1,49 @@
+// 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 "browser/select_picker/select_picker_tv.h"
+
+#include "common/render_messages_ewk.h"
+#include "eweb_view.h"
+
+SelectPickerTv::SelectPickerTv(EWebView* web_view,
+                               int selected_index,
+                               bool is_multiple_selection)
+    : SelectPickerTvBase(web_view->evas_object(),
+                         selected_index,
+                         is_multiple_selection),
+      web_view_(web_view) {}
+
+SelectPickerTv::~SelectPickerTv() {
+  UnregisterCallbacks();
+}
+
+content::WebContentsViewAura* SelectPickerTv::wcva() const {
+  return web_view_->wcva();
+}
+
+void SelectPickerTv::FormNavigate(bool direction) {
+  auto* rfh = static_cast<content::RenderFrameHostImpl*>(
+      web_view_->web_contents().GetFocusedFrame());
+  if (!rfh)
+    return;
+
+  web_view_->DidCancelPopupMenu();
+  rfh->Send(new EwkFrameMsg_MoveToNextOrPreviousSelectElement(
+      rfh->GetRoutingID(), direction));
+}
+
+void SelectPickerTv::RequestFormNavigationInformation() {
+  auto* rfh = static_cast<content::RenderFrameHostImpl*>(
+      web_view_->web_contents().GetFocusedFrame());
+  if (!rfh)
+    return;
+
+  rfh->Send(
+      new EwkFrameMsg_RequestSelectCollectionInformation(rfh->GetRoutingID()));
+}
+
+void SelectPickerTv::HidePopupMenu() {
+  web_view_->HidePopupMenu();
+}
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
new file mode 100644 (file)
index 0000000..a9f1ad1
--- /dev/null
@@ -0,0 +1,34 @@
+// 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 EWK_EFL_INTEGRATION_BROWSER_SELECT_PICKER_SELECT_PICKER_TV_H_
+#define EWK_EFL_INTEGRATION_BROWSER_SELECT_PICKER_SELECT_PICKER_TV_H_
+
+#include "content/browser/select_picker/select_picker_tv_base.h"
+
+class EWebView;
+
+class SelectPickerTv : public SelectPickerTvBase {
+ public:
+  explicit SelectPickerTv(EWebView* web_view,
+                          int selected_index,
+                          bool is_multiple_selection);
+  virtual ~SelectPickerTv() override;
+
+  SelectPickerTv(const SelectPickerTv&) = delete;
+  SelectPickerTv& operator=(const SelectPickerTv&) = delete;
+
+ private:
+  // FormNavigablePicker
+  void FormNavigate(bool direction) override;
+  void RequestFormNavigationInformation() override;
+  void HidePopupMenu() override;
+
+  // SelectPickerBase
+  content::WebContentsViewAura* wcva() const override;
+
+  EWebView* web_view_;
+};
+
+#endif  // EWK_EFL_INTEGRATION_BROWSER_SELECT_PICKER_SELECT_PICKER_TV_H_
diff --git a/tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.cc b/tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.cc
deleted file mode 100644 (file)
index 376b9bf..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2014 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 "base/strings/utf_string_conversions.h"
-#include "popup_menu_item.h"
-#include "popup_menu_item_private.h"
-#include "base/logging.h"
-
-Popup_Menu_Item::Popup_Menu_Item(blink::mojom::MenuItemPtr item)
-    : type(static_cast<Popup_Menu_Item_Type>(item->type)),
-      textDirection(item->text_direction ? base::i18n::RIGHT_TO_LEFT
-                                         : base::i18n::LEFT_TO_RIGHT),
-      hasTextDirectionOverride(item->has_text_direction_override),
-      isEnabled(item->enabled),
-      isLabel(true),
-      isSelected(item->checked),
-      text(item->label.value()),
-      toolTip(item->tool_tip.value()),
-      accessibilityText(item->label.value()) {}
-
-Popup_Menu_Item_Type popup_menu_item_type_get(const Popup_Menu_Item* item) {
-  EINA_SAFETY_ON_NULL_RETURN_VAL(item, POPUP_MENU_UNKNOWN);
-
-  return item->type;
-}
-
-const char* popup_menu_item_text_get(const Popup_Menu_Item* item) {
-  EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
-
-  return item->text.c_str();
-}
-
-base::i18n::TextDirection popup_menu_item_text_direction_get(
-    const Popup_Menu_Item* item) {
-  EINA_SAFETY_ON_NULL_RETURN_VAL(item, base::i18n::LEFT_TO_RIGHT);
-
-  return item->textDirection;
-}
-
-Eina_Bool popup_menu_item_text_direction_override_get(
-    const Popup_Menu_Item* item) {
-  EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
-
-  return item->hasTextDirectionOverride;
-}
-
-const char* popup_menu_item_tooltip_get(const Popup_Menu_Item* item) {
-  EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
-
-  return item->toolTip.c_str();
-}
-
-const char* popup_menu_item_accessibility_text_get(
-    const Popup_Menu_Item* item) {
-  EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0);
-
-  return item->accessibilityText.c_str();
-}
-
-Eina_Bool popup_menu_item_enabled_get(const Popup_Menu_Item* item) {
-  EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
-
-  return item->isEnabled;
-}
-
-Eina_Bool popup_menu_item_is_label_get(const Popup_Menu_Item* item) {
-  EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
-
-  return item->isLabel;
-}
-
-Eina_Bool popup_menu_item_selected_get(const Popup_Menu_Item* item) {
-  EINA_SAFETY_ON_NULL_RETURN_VAL(item, false);
-
-  return item->isSelected;
-}
diff --git a/tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.h b/tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item.h
deleted file mode 100644 (file)
index d4607c8..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2014 Samsung Electronics. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- * Boston, MA  02110-1301, USA.
- *
- */
-
-#ifndef popup_menu_item_h
-#define popup_menu_item_h
-
-#include <Eina.h>
-#include <string>
-
-#include "base/i18n/rtl.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Enum values containing type of popup menu item. */
-typedef enum {
-    POPUP_MENU_OPTION,
-    POPUP_MENU_CHECKABLE_OPTION,
-    POPUP_MENU_GROUP,
-    POPUP_MENU_SEPARATOR,
-    POPUP_MENU_SUBMENU,
-    POPUP_MENU_UNKNOWN = -1
-} Popup_Menu_Item_Type;
-
-/** Creates a type name for Ewk_Popup_Menu_Item */
-typedef struct Popup_Menu_Item Popup_Menu_Item;
-
-/**
- * Returns type of the popup menu item.
- *
- * @param item the popup menu item instance
- *
- * @return the type of the @a item or @c EWK_POPUP_MENU_UNKNOWN in case of error.
- */
-Popup_Menu_Item_Type popup_menu_item_type_get(const Popup_Menu_Item *item);
-
-/**
- * Returns text of the popup menu item.
- *
- * @param item the popup menu item instance
- *
- * @return the text of the @a item or @c NULL in case of error. This pointer is
- *         guaranteed to be eina_stringshare, so whenever possible
- *         save yourself some cpu cycles and use
- *         eina_stringshare_ref() instead of eina_stringshare_add() or
- *         strdup()
- */
-const char *popup_menu_item_text_get(const Popup_Menu_Item *item);
-
-/**
- * Returns text direction of the popup menu item.
- *
- * @param item the popup menu item instance
- *
- * @return the text direction of the @a item.
- */
-base::i18n::TextDirection popup_menu_item_text_direction_get(
-    const Popup_Menu_Item* item);
-
-/**
- * Returns whether the popup menu item has text direction override.
- *
- * @param item the popup menu item instance
- *
- * @return @c EINA_TRUE if the popup menu item has text direction override,
- *         @c EINA_FALSE otherwise.
- */
-Eina_Bool popup_menu_item_text_direction_override_get(const Popup_Menu_Item *item);
-
-/**
- * Returns tooltip of the popup menu item.
- *
- * @param item the popup menu item instance
- *
- * @return the tooltip of the @a item or @c NULL in case of error. This pointer is
- *         guaranteed to be eina_stringshare, so whenever possible
- *         save yourself some cpu cycles and use
- *         eina_stringshare_ref() instead of eina_stringshare_add() or
- *         strdup()
- */
-const char *popup_menu_item_tooltip_get(const Popup_Menu_Item *item);
-
-/**
- * Returns accessibility text of the popup menu item.
- *
- * @param item the popup menu item instance
- *
- * @return the accessibility text of the @a item or @c NULL in case of error.
- *         This pointer is guaranteed to be eina_stringshare, so whenever
- *         possible save yourself some cpu cycles and use
- *         eina_stringshare_ref() instead of eina_stringshare_add() or
- *         strdup()
- */
-const char *popup_menu_item_accessibility_text_get(const Popup_Menu_Item *item);
-
-/**
- * Returns whether the popup menu item is enabled or not.
- *
- * @param item the popup menu item instance
- *
- * @return @c EINA_TRUE if the popup menu item is enabled, @c EINA_FALSE otherwise.
- */
-Eina_Bool popup_menu_item_enabled_get(const Popup_Menu_Item *item);
-
-/**
- * Returns whether the popup menu item is label or not.
- *
- * @param item the popup menu item instance
- *
- * @return @c EINA_TRUE if the popup menu item is label, @c EINA_FALSE otherwise.
- */
-Eina_Bool popup_menu_item_is_label_get(const Popup_Menu_Item *item);
-
-/**
- * Returns whether the popup menu item is selected or not.
- *
- * @param item the popup menu item instance
- *
- * @return @c EINA_TRUE if the popup menu item is selected, @c EINA_FALSE otherwise.
- */
-Eina_Bool popup_menu_item_selected_get(const Popup_Menu_Item *item);
-
-#ifdef __cplusplus
-}
-#endif
-#endif // popup_menu_item_h
diff --git a/tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item_private.h b/tizen_src/ewk/efl_integration/browser/selectpicker/popup_menu_item_private.h
deleted file mode 100644 (file)
index aba52b1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2014 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 popup_menu_item_private_h
-#define popup_menu_item_private_h
-
-#include "base/i18n/rtl.h"
-#include "popup_menu_item.h"
-#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
-
-#include <string>
-
-/**
- * \struct  Popup_Menu_Item
- * @brief   Contains the popup menu data.
- */
-class Popup_Menu_Item {
-public:
- explicit Popup_Menu_Item(blink::mojom::MenuItemPtr menuitem);
-
- Popup_Menu_Item_Type type;
- base::i18n::TextDirection textDirection;
-
- bool hasTextDirectionOverride;
- bool isEnabled;
- bool isLabel;
- bool isSelected;
-
- std::string text;
- std::string toolTip;
- std::string accessibilityText;
-};
-
-#endif // popup_menu_item_private_h
diff --git a/tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.cc b/tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.cc
deleted file mode 100644 (file)
index 90c0b96..0000000
+++ /dev/null
@@ -1,492 +0,0 @@
-// Copyright 2014 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 "popup_picker.h"
-
-#include <ecore_x_wayland_wrapper.h>
-
-#include "base/files/file_path.h"
-#include "base/logging.h"
-#include "base/path_service.h"
-#include "common/web_contents_utils.h"
-#include "content/common/paths_efl.h"
-#include "eweb_view.h"
-#include "popup_menu_item.h"
-#include "ui/display/screen.h"
-#include "ui/gfx/geometry/dip_util.h"
-
-#include <Elementary.h>
-#include <libintl.h>
-#include "ecore_x_wayland_wrapper.h"
-#if BUILDFLAG(IS_TIZEN)
-#include <dlfcn.h>
-#include <efl_extension.h>
-
-extern void* EflExtensionHandle;
-#endif
-
-int compareChangedItems(const void* a, const void* b) {
-  const int* left = static_cast<const int*>(a);
-  const int* right = static_cast<const int*>(b);
-  return (*left - *right);
-}
-
-static void __picker_radio_icon_changed_cb(void* data, Evas_Object* obj, void* event_info) {
-  genlist_callback_data *callback_data = static_cast<genlist_callback_data*>(data);
-
-  elm_genlist_item_selected_set(callback_data->it, true);
-}
-
-static char* __picker_label_get_cb(void* data, Evas_Object* obj, const char* part) {
-  genlist_callback_data *callback_data = static_cast<genlist_callback_data*>(data);
-  Popup_Menu_Item* menuItem = static_cast<Popup_Menu_Item*>(callback_data->menuItem);
-
-  if (!strncmp(part, "elm.text", strlen("elm.text")))
-    return elm_entry_utf8_to_markup(popup_menu_item_text_get(menuItem));
-
-  return 0;
-}
-
-static Evas_Object* __picker_icon_get_cb(void* data, Evas_Object* obj, const char* part) {
-  genlist_callback_data *callback_data = static_cast<genlist_callback_data*>(data);
-  Popup_Picker* picker = static_cast<Popup_Picker*>(callback_data->user_data);
-
-  if (!strcmp(part, "elm.swallow.end") &&
-      popup_menu_item_enabled_get(callback_data->menuItem) == EINA_TRUE) {
-    Evas_Object *radio = elm_radio_add(obj);
-    elm_object_focus_allow_set(radio, false);
-    elm_radio_state_value_set(radio, callback_data->index);
-    elm_radio_group_add(radio, picker->radioMain);
-
-    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->radioMain, picker->selectedIndex);
-    evas_object_smart_callback_add(radio, "changed", __picker_radio_icon_changed_cb, (void *)data);
-    return radio;
-  }
-  return 0;
-}
-
-static void __picker_item_selected_cb(void* data, Evas_Object* obj, void* event_info) {
-  genlist_callback_data *callback_data = static_cast<genlist_callback_data*>(data);
-  Popup_Picker* picker = static_cast<Popup_Picker*>(callback_data->user_data);
-  Evas_Object* radio_icon = elm_object_item_part_content_get((Elm_Object_Item *)event_info, "elm.swallow.end");
-
-  int index = callback_data->index;
-  elm_genlist_item_selected_set(callback_data->it, false);
-
-  if (popup_menu_item_enabled_get(callback_data->menuItem) == EINA_TRUE) {
-    elm_radio_value_set(radio_icon, callback_data->index);
-    picker->selectedIndex = index;
-    view_popup_menu_select(picker->web_view_, index);
-  }
-}
-
-void clear_genlist_callback_data(Popup_Picker* picker) {
-  if (picker && picker->m_genlist_callback_data_list) {
-    Eina_List* list;
-    void* data;
-
-    EINA_LIST_FOREACH(picker->m_genlist_callback_data_list, list, data) {
-      if (data)
-        free ((genlist_callback_data *)data);
-    }
-    eina_list_free(picker->m_genlist_callback_data_list);
-    picker->m_genlist_callback_data_list = NULL;
-  }
-}
-
-void menuItemActivated(void* data, Evas_Object* obj, void* event_info) {
-  Popup_Picker* picker = static_cast<Popup_Picker*>(data);
-  Elm_Object_Item* selected = static_cast<Elm_Object_Item*>(event_info);
-  int index = elm_genlist_item_index_get(selected);
-#if BUILDFLAG(IS_TIZEN)
-  // elm_genlist_item_index_get iterrate starting from 1
-  if (index > 0)
-    index--;
-#endif
-
-  if (picker->multiSelect) {
-    int pos = eina_inarray_search(picker->changedList, &index, compareChangedItems);
-    if (pos == -1)
-      eina_inarray_insert_sorted(picker->changedList, &index, compareChangedItems);
-    else
-      eina_inarray_remove(picker->changedList, &index);
-  }
-
-  view_popup_menu_multiple_select(picker->web_view_, picker->changedList);
-}
-
-void menuItemDeactivated(void* data, Evas_Object* obj, void* event_info) {
-  Popup_Picker* picker = static_cast<Popup_Picker*>(data);
-  Elm_Object_Item* deselectedItem = static_cast<Elm_Object_Item*>(event_info);
-
-  int deselectedIndex = elm_genlist_item_index_get(deselectedItem);
-#if BUILDFLAG(IS_TIZEN)
-  // elm_genlist_item_index_get iterrate starting from 1
-  if (deselectedIndex > 0)
-    deselectedIndex--;
-#endif
-
-  int pos = eina_inarray_search(picker->changedList, &deselectedIndex, compareChangedItems);
-
-  if (pos == -1)
-    eina_inarray_insert_sorted(picker->changedList, &deselectedIndex, compareChangedItems);
-  else
-    eina_inarray_remove(picker->changedList, &deselectedIndex);
-
-  view_popup_menu_multiple_select(picker->web_view_, picker->changedList);
-}
-
-void listClosed(void* data, Evas_Object* obj, const char* emission, const char* source) {
-  Popup_Picker* picker = static_cast<Popup_Picker*>(data);
-
-  if (picker->multiSelect)
-    view_popup_menu_multiple_select(picker->web_view_, picker->changedList);
-  else
-    view_popup_menu_select(picker->web_view_, picker->selectedIndex);
-
-  if (picker->changedList) {
-    eina_inarray_free(picker->changedList);
-    picker->changedList = 0;
-  }
-
-  // FIXME: remove this check
-  if (!picker->multiSelect)
-    clear_genlist_callback_data(picker);
-
-  view_popup_menu_close(picker->web_view_);
-}
-
-void navigateToNext(void *data, Evas_Object *obj, const char *emission, const char *source)
-{
-  Popup_Picker* picker = static_cast<Popup_Picker*>(data);
-  elm_genlist_clear(picker->popupList);
-  picker->web_view_->FormNavigate(true);
-}
-
-void navigateToPrev(void *data, Evas_Object *obj, const char *emission, const char *source)
-{
-  Popup_Picker* picker = static_cast<Popup_Picker*>(data);
-  elm_genlist_clear(picker->popupList);
-  picker->web_view_->FormNavigate(false);
-}
-
-static char* _listLabelGet(void* data, Evas_Object* obj, const char* part)
-{
-  Popup_Menu_Item* menuItem = static_cast<Popup_Menu_Item*>(data);
-
-  if (!strncmp(part, "elm.text", strlen("elm.text")) && popup_menu_item_text_get(menuItem))
-    return elm_entry_utf8_to_markup(popup_menu_item_text_get(menuItem));
-  return 0;
-}
-
-static void popupMenuHwBackKeyCallback(void* data, Evas_Object* obj, void* eventInfo) {
-  listClosed(data, obj, 0, 0);
-}
-
-static void createAndShowPopupList(Evas_Object* win, Popup_Picker* picker, Eina_List* items, int selectedIndex) {
-  picker->selectedIndex = selectedIndex;
-  picker->popupList = elm_genlist_add(win);
-  evas_object_size_hint_weight_set(picker->popupList, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-  evas_object_size_hint_align_set(picker->popupList, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
-  if (picker->multiSelect)
-  {
-    eina_inarray_flush(picker->changedList);
-    elm_genlist_multi_select_set(picker->popupList, true);
-  }
-  static Elm_Genlist_Item_Class itemClass;
-  void* itemv;
-  const Eina_List* l;
-  picker->firstItem = 0;
-
-  picker->m_genlist_callback_data_list = NULL;
-
-  // If it is multiselect, use the old implementation.
-  //FIXME: remove this check, once picker with buttons is implemented for multiselect.
-  if (!picker->multiSelect) {
-    picker->radioMain = elm_radio_add(picker->popupList);
-    if (!picker->radioMain) {
-      LOG(ERROR) << "elm_radio_add failed. ";
-      return;
-    }
-
-    elm_radio_state_value_set(picker->radioMain, 0);
-    elm_radio_value_set(picker->radioMain, 0);
-
-    itemClass.item_style = "default";
-    itemClass.func.text_get = __picker_label_get_cb;
-    itemClass.func.content_get = __picker_icon_get_cb;
-    itemClass.func.state_get = 0;
-    itemClass.func.del = 0;
-
-    int index = 0;
-    Eina_Bool has_problem = EINA_FALSE;
-    EINA_LIST_FOREACH(items, l, itemv) {
-      genlist_callback_data *data = (genlist_callback_data *)malloc(sizeof(genlist_callback_data));
-      if (!data) {
-        has_problem = EINA_TRUE;
-        break;
-      }
-
-      memset(data, 0x00, sizeof(genlist_callback_data));
-      data->index = index;
-      data->user_data = picker;
-      data->menuItem = static_cast<Popup_Menu_Item*>(itemv);
-      data->it =  elm_genlist_item_append(picker->popupList, &itemClass, data, NULL, ELM_GENLIST_ITEM_NONE, __picker_item_selected_cb, data);
-      picker->m_genlist_callback_data_list = eina_list_append(picker->m_genlist_callback_data_list, data);
-
-      if (!index)
-        picker->firstItem = data->it;
-
-      if (selectedIndex == index) {
-        elm_radio_value_set(picker->radioMain, index);
-        elm_genlist_item_bring_in(data->it, ELM_GENLIST_ITEM_SCROLLTO_IN);
-      }
-      index++;
-    }
-
-    if (has_problem == EINA_TRUE) {
-      clear_genlist_callback_data(picker);
-      return;
-    }
-    evas_object_smart_callback_add(picker->popupList, "changed", __picker_radio_icon_changed_cb, picker);
-  } else {
-    itemClass.item_style = "default";
-    itemClass.func.text_get = _listLabelGet;
-    itemClass.func.content_get = 0;
-    itemClass.func.state_get = 0;
-    itemClass.func.del = 0;
-
-    void* itemv;
-    const Eina_List* l;
-
-    picker->firstItem = 0;
-    int index = 0;
-    EINA_LIST_FOREACH(items, l, itemv) {
-      Popup_Menu_Item* menuItem = static_cast<Popup_Menu_Item*>(itemv);
-      Elm_Object_Item* itemObject = elm_genlist_item_append(picker->popupList, &itemClass, menuItem, 0, ELM_GENLIST_ITEM_NONE, 0, 0);
-      if (!index)
-        picker->firstItem = itemObject;
-
-      if (popup_menu_item_selected_get(menuItem)) {
-        eina_inarray_push(picker->changedList, &index);
-        elm_genlist_item_selected_set(itemObject, EINA_TRUE);
-      }
-      if (!(popup_menu_item_enabled_get(menuItem)))
-        elm_object_item_disabled_set(itemObject, EINA_TRUE);
-      index++;
-    }
-
-    evas_object_smart_callback_add(picker->popupList, "selected", menuItemActivated, picker);
-
-    if (picker->multiSelect)
-      evas_object_smart_callback_add(picker->popupList, "unselected", menuItemDeactivated, picker);
-  }
-
-  elm_object_focus_allow_set(picker->popupList, false);
-  evas_object_show(picker->popupList);
-
-  Evas_Object *bgcolor = elm_bg_add(picker->container);
-  elm_object_part_content_set(picker->container, "bg", bgcolor);
-  elm_object_part_content_set(picker->container, "elm.swallow.content", picker->popupList);
-
-  // DJKim : FIXME
-  edje_object_part_text_set(elm_layout_edje_get(picker->container), "elm.text.done", "Done");
-}
-
-static void resizeAndShowPicker(Popup_Picker* picker) {
-  /* resize picker to window */
-  Eina_Rectangle windowRect;
-  Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(picker->container));
-  ecore_evas_geometry_get(ee, &windowRect.x, &windowRect.y, &windowRect.w, &windowRect.h);
-
-  evas_object_resize(picker->container, windowRect.w, windowRect.h);
-  evas_object_move(picker->container, windowRect.x, windowRect.y);
-  evas_object_show(picker->container);
-}
-
-void popupPickerKeyUpCallback(void* data, Evas*, Evas_Object* obj, void* event_info) {
-  Evas_Event_Key_Up* key_struct = static_cast<Evas_Event_Key_Up*>(event_info);
-  if (!web_contents_utils::MapsToHWBackKey(key_struct->keyname))
-    return;
-
-  popupMenuHwBackKeyCallback(data, obj, event_info);
-}
-
-Popup_Picker* popup_picker_new(EWebView* web_view, Evas_Object* parent, Eina_List* items, int selectedIndex, Eina_Bool multiple) {
-  Popup_Picker* picker = new Popup_Picker;
-  picker->parent = parent;
-  picker->web_view_ = web_view;
-  picker->multiSelect = multiple;
-  picker->changedList = eina_inarray_new(sizeof(int), 0);
-
-  Evas_Object* obj = elm_object_parent_widget_get(parent);
-  if (obj == NULL)
-    obj = parent;
-  picker->win = elm_object_top_widget_get(obj);
-
-  picker->container = elm_layout_add(picker->win);
-  evas_object_size_hint_weight_set(picker->container, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-  elm_win_resize_object_add(picker->win, picker->container);
-
-  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("control.edj"));
-
-  if (!elm_layout_file_set(picker->container, control_edj.AsUTF8Unsafe().c_str(), "elm/picker"))
-    LOG(ERROR) << "error elm_layout_file_set, control_edj " ;
-  else {
-    edje_object_signal_callback_add(elm_layout_edje_get(picker->container),
-      "mouse,clicked,1", "elm.image.done_bg", listClosed, picker);
-    edje_object_signal_callback_add(elm_layout_edje_get(picker->container),
-      "mouse,clicked,1", "dimm", listClosed, picker);
-    edje_object_signal_callback_add(elm_layout_edje_get(picker->container),
-      "mouse,clicked,1", "elm.image.prev_bg", navigateToPrev, picker);
-    edje_object_signal_callback_add(elm_layout_edje_get(picker->container),
-      "mouse,clicked,1", "elm.image.next_bg", navigateToNext, picker);
-  }
-
-#if BUILDFLAG(IS_TIZEN)
-  if (EflExtensionHandle) {
-    void (*webkit_eext_object_event_callback_add)(Evas_Object *,
-        Eext_Callback_Type, Eext_Event_Cb func, void *);
-    webkit_eext_object_event_callback_add = (void (*)(Evas_Object *,
-        Eext_Callback_Type, Eext_Event_Cb func, void *))dlsym(EflExtensionHandle,
-        "eext_object_event_callback_add");
-    (*webkit_eext_object_event_callback_add)(picker->container,
-        EEXT_CALLBACK_BACK, popupMenuHwBackKeyCallback, picker);
-  }
-#endif
-  evas_object_event_callback_add(picker->parent, EVAS_CALLBACK_KEY_UP,
-                                 popupPickerKeyUpCallback, picker);
-
-  createAndShowPopupList(picker->win, picker, items, selectedIndex);
-  evas_object_propagate_events_set(picker->container, false);
-
-  resizeAndShowPicker(picker);
-  edje_object_signal_emit(elm_layout_edje_get(picker->container), "show,picker,signal", "");
-  edje_object_signal_emit(elm_layout_edje_get(picker->container), "show,prev_button,signal", "");
-  edje_object_signal_emit(elm_layout_edje_get(picker->container), "show,next_button,signal", "");
-
-  return picker;
-}
-
-void popup_picker_resize(Popup_Picker* picker) {
-  resizeAndShowPicker(picker);
-}
-
-void popup_picker_resize(Popup_Picker* picker, int width, int height) {
-  if (!picker->container)
-    return;
-
-  evas_object_resize(picker->container, width, height);
-  evas_object_move(picker->container, 0, 0);
-}
-
-void popup_picker_del(Popup_Picker* picker) {
-  if (!picker->multiSelect) {
-    evas_object_smart_callback_del(picker->popupList, "changed", __picker_radio_icon_changed_cb);
-    clear_genlist_callback_data(picker);
-  }
-  evas_object_smart_callback_del(picker->popupList, "selected", menuItemActivated);
-  evas_object_del(picker->popupList);
-  evas_object_del(picker->container);
-
-  picker->popupList = 0;
-  picker->firstItem = 0;
-  picker->web_view_ = 0;
-
-  evas_object_event_callback_del(picker->parent, EVAS_CALLBACK_KEY_UP, popupPickerKeyUpCallback);
-
-  delete picker;
-}
-
-void popup_picker_geometry_get(Popup_Picker* picker,
-                               int* x,
-                               int* y,
-                               int* width,
-                               int* height) {
-  int p_x, p_y, p_width, p_height;
-  p_x = p_y = p_width = p_height = 0;
-  edje_object_part_geometry_get(elm_layout_edje_get(picker->container), "bg",
-                                &p_x, &p_y, &p_width, &p_height);
-
-  gfx::Rect scaled_rect = gfx::ToEnclosingRect(gfx::ConvertRectToDips(
-      gfx::Rect(p_x, p_y, p_width, p_height),
-      display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor()));
-
-  if (x)
-    *x = scaled_rect.x();
-  if (y)
-    *y = scaled_rect.y();
-  if (width)
-    *width = scaled_rect.width();
-  if (height)
-    *height = scaled_rect.height();
-}
-
-void popup_picker_update(Evas_Object* parent, Popup_Picker* picker, Eina_List* items, int selectedIndex) {
-  // FIXME: A check should be made if the items are changed instead of directly changing them.
-  // Another issue is that if the list is scrolled, the old scroll position is not retained as
-  // the list is replaced directly.
-  evas_object_del(picker->popupList);
-
-  picker->changedList = eina_inarray_new(sizeof(int), 0);
-  createAndShowPopupList(picker->win, picker, items, selectedIndex);
-}
-
-void popup_picker_buttons_update(Popup_Picker* picker, int position, int count, bool enable) {
-  Evas_Object* layoutObj = elm_layout_edje_get(picker->container);
-  if (enable) {
-    if (position == 0) {
-      edje_object_signal_emit(layoutObj, "enable,prev_button,signal", "");
-      edje_object_signal_callback_add(elm_layout_edje_get(picker->container),
-        "mouse,clicked,1", "elm.image.prev_bg", navigateToPrev, picker);
-    }
-    if (position == count - 1) {
-      edje_object_signal_emit(layoutObj, "enable,next_button,signal", "");
-      edje_object_signal_callback_add(elm_layout_edje_get(picker->container),
-        "mouse,clicked,1", "elm.image.next_bg", navigateToNext, picker);
-    }
-  } else {
-    if (position == 0) {
-      edje_object_signal_emit(layoutObj, "disable,prev_button,signal", "");
-      edje_object_signal_callback_del(elm_layout_edje_get(picker->container),
-        "mouse,clicked,1", "elm.image.prev_bg", navigateToPrev);
-    }
-    if (position == count - 1) {
-      edje_object_signal_emit(layoutObj, "disable,next_button,signal", "");
-      edje_object_signal_callback_del(elm_layout_edje_get(picker->container),
-        "mouse,clicked,1", "elm.image.next_bg", navigateToNext);
-    }
-  }
-}
-
-void view_popup_menu_select(EWebView* web_view, int selectedIndex) {
-  web_view->DidSelectPopupMenuItem(selectedIndex);
-}
-
-void view_popup_menu_multiple_select(EWebView* web_view, Eina_Inarray* changeList) {
-  std::vector<int> selectedIndices;
-  Eina_Iterator* itr;
-  void* data;
-  itr = eina_inarray_iterator_new(changeList);
-
-  EINA_ITERATOR_FOREACH(itr, data) {
-    int* pData = static_cast<int*>(data);
-    selectedIndices.push_back(*pData);
-  }
-  eina_iterator_free(itr);
-
-  web_view->DidMultipleSelectPopupMenuItem(selectedIndices);
-}
-
-void view_popup_menu_close(EWebView* web_view) {
-  web_view->PopupMenuClose();
-}
diff --git a/tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.h b/tizen_src/ewk/efl_integration/browser/selectpicker/popup_picker.h
deleted file mode 100644 (file)
index 028954e..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 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 popup_picker_h
-#define popup_picker_h
-
-#include <Elementary.h>
-
-typedef struct Popup_Menu_Item Popup_Menu_Item;
-
-namespace WebKit {
-class WebPopupMenuProxyEfl;
-}
-
-class EWebView;
-
-struct _Popup_Picker {
-    _Popup_Picker()
-        : container(NULL)
-        , parent(NULL)
-        , popupList(NULL)
-        , win(NULL)
-        , web_view_(NULL)
-        , radioMain(NULL)
-        , m_genlist_callback_data_list(NULL)
-        , firstItem(NULL)
-        , changedList(NULL) {}
-    Evas_Object* container;
-    Evas_Object* parent;
-    Evas_Object* popupList;
-    Evas_Object* win;
-    EWebView* web_view_;
-    Evas_Object* radioMain;
-    Eina_List* m_genlist_callback_data_list;
-    Elm_Object_Item* firstItem;
-    int selectedIndex;
-    Eina_Bool multiSelect;
-    Eina_Inarray* changedList;
-};
-typedef struct _Popup_Picker Popup_Picker;
-
-typedef struct _genlist_callback_data {
-    _genlist_callback_data() : user_data(NULL), it(NULL), menuItem(NULL) {}
-    int index;
-    void* user_data;
-    Elm_Object_Item* it;
-    Popup_Menu_Item* menuItem;
-} genlist_callback_data;
-
-Popup_Picker* popup_picker_new(EWebView* web_view, Evas_Object* parent, Eina_List* items, int selectedIndex, Eina_Bool multiple);
-void popup_picker_resize(Popup_Picker* picker);
-void popup_picker_resize(Popup_Picker* picker, int width, int height);
-void popup_picker_del(Popup_Picker* picker);
-void popup_picker_geometry_get(Popup_Picker* picker,
-                               int* x,
-                               int* y,
-                               int* width,
-                               int* height);
-void popup_picker_update(Evas_Object* parent, Popup_Picker* picker, Eina_List* items, int selectedIndex);
-void popupPickerKeyUpCallback(void* data, Evas* e, Evas_Object* obj, void* event_info);
-void listClosed(void *data, Evas_Object *obj, const char *emission, const char *source);
-void popup_picker_buttons_update(Popup_Picker* picker, int position, int count, bool enable);
-void view_popup_menu_select(EWebView* web_view, int selectedIndex);
-void view_popup_menu_multiple_select(EWebView* web_view, Eina_Inarray* changeList);
-void view_popup_menu_close(EWebView* web_view);
-
-#endif // popup_picker_h
index dd8834a..96a0cd3 100644 (file)
@@ -118,6 +118,17 @@ class WebViewBrowserMessageFilterPrivate
     web_view_->ShowContentsDetectedPopup(content_url.spec().c_str());
   }
 
+  void OnRequestSelectCollectionInformationUpdateACK(int formElementCount,
+                                                     int currentNodeIndex,
+                                                     bool prevState,
+                                                     bool nextState) {
+    if (!web_view_)
+      return;
+
+    web_view_->GetSelectPicker()->UpdateFormNavigation(formElementCount,
+                                                       currentNodeIndex);
+  }
+
   void Observe(int type, const content::NotificationSource& source,
       const content::NotificationDetails& details) override {
 #if !defined(EWK_BRINGUP)  // FIXME: m94 bringup
index a614933..8569807 100644 (file)
@@ -22,8 +22,9 @@
 #include "browser/javascript_interface/gin_native_bridge_dispatcher_host.h"
 #include "browser/navigation_policy_handler_efl.h"
 #include "browser/quota_permission_context_efl.h"
-#include "browser/selectpicker/popup_menu_item.h"
-#include "browser/selectpicker/popup_menu_item_private.h"
+#include "browser/scoped_allow_wait_for_legacy_web_view_api.h"
+#include "browser/select_picker/select_picker_mobile.h"
+#include "browser/select_picker/select_picker_tv.h"
 #include "browser/web_view_browser_message_filter.h"
 #include "browser/web_view_evas_handler.h"
 #include "browser_context_efl.h"
@@ -161,6 +162,28 @@ base::FilePath GenerateMHTMLFilePath(const GURL& url,
   return base::FilePath();
 }
 
+SelectPickerBase* CreateSelectPicker(
+    EWebView* web_view,
+    int selected_index,
+    std::vector<blink::mojom::MenuItemPtr> items,
+    bool is_multiple_selection,
+    const gfx::Rect& bounds) {
+  SelectPickerBase* picker;
+  if (IsTvProfile()) {
+    picker =
+        new SelectPickerTv(web_view, selected_index, is_multiple_selection);
+  } else {
+    picker =
+        new SelectPickerMobile(web_view, selected_index, is_multiple_selection);
+  }
+  // Create two separate Elm_Genlist_Item_Class classes, because EFL cannot swap
+  // item_style at runtime.
+  picker->InitializeItemClass();
+  picker->InitializeGroupClass();
+  picker->Init(std::move(items), bounds);
+  return picker;
+}
+
 }  // namespace
 
 class WebViewAsyncRequestHitTestDataCallback {
@@ -251,7 +274,6 @@ EWebView::EWebView(Ewk_Context* context, Evas_Object* object)
       native_view_(object),
       mouse_events_enabled_(false),
       text_zoom_factor_(1.0),
-      formIsNavigating_(false),
       current_find_request_id_(find_request_id_counter_++),
       progress_(0.0),
       hit_test_completion_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
@@ -307,15 +329,6 @@ void EWebView::Initialize() {
       blink::UserAgentOverride::UserAgentOnly(user_agent),
       false /* override_in_new_tabs */);
 
-  popupMenuItems_ = 0;
-  popupPicker_ = 0;
-
-  formNavigation_.count = 1;
-  formNavigation_.position = 0;
-  formNavigation_.prevState = false;
-  formNavigation_.nextState = false;
-
-  // allow this object and its children to get a focus
   elm_object_tree_focus_allow_set(native_view_, EINA_TRUE);
   is_initialized_ = true;
 
@@ -371,21 +384,10 @@ EWebView::~EWebView() {
   eweb_accessibility_.reset();
 #endif
 
+  select_picker_.reset();
   context_menu_.reset();
   mhtml_callback_map_.Clear();
 
-  ReleasePopupMenuList();
-
-  if (popupPicker_)
-    popup_picker_del(popupPicker_);
-
-  formNavigation_.count = 1;
-  formNavigation_.position = 0;
-  formNavigation_.prevState = false;
-  formNavigation_.nextState = false;
-
-  //  evas_object_del(evas_object());
-
   // Release manually those scoped pointers to
   // make sure they are released in correct order
   web_contents_.reset();
@@ -408,18 +410,6 @@ EWebView::~EWebView() {
   }
 }
 
-void EWebView::ReleasePopupMenuList() {
-  if (!popupMenuItems_)
-    return;
-
-  void* dummyItem;
-  EINA_LIST_FREE(popupMenuItems_, dummyItem) {
-    delete static_cast<Popup_Menu_Item*>(dummyItem);
-  }
-
-  popupMenuItems_ = 0;
-}
-
 content::RenderWidgetHostViewAura* EWebView::rwhva() const {
   return static_cast<content::RenderWidgetHostViewAura*>(
       web_contents_->GetRenderWidgetHostView());
@@ -687,8 +677,6 @@ void EWebView::SetOrientation(int orientation) {
       popup_controller_->SetPopupSize(width, height);
     if (JavaScriptDialogManagerEfl* dialogMG = GetJavaScriptDialogManagerEfl())
       dialogMG->SetPopupSize(width, height);
-    if (popupPicker_)
-      popup_picker_resize(popupPicker_, width, height);
   }
 }
 
@@ -1088,154 +1076,35 @@ void EWebView::InvokeLoadError(const GURL& url,
 
 void EWebView::HandlePopupMenu(std::vector<blink::mojom::MenuItemPtr> items,
                                int selectedIndex,
-                               bool multiple) {
-  // Request form navigation information as early as possible,
-  // given that is renderer will ping-back with actual requested data.
-  RenderFrameHostImpl* render_frame_host =
-      static_cast<RenderFrameHostImpl*>(web_contents_->GetPrimaryMainFrame());
-  if (render_frame_host)
-    render_frame_host->Send(new EwkFrameMsg_RequestSelectCollectionInformation(
-        render_frame_host->GetRoutingID()));
-
-  Eina_List* popupItems = 0;
-  const size_t size = items.size();
-  for (size_t i = 0; i < size; ++i) {
-    popupItems =
-        eina_list_append(popupItems, new Popup_Menu_Item(std::move(items[i])));
-  }
-
-  ReleasePopupMenuList();
-  popupMenuItems_ = popupItems;
-
-  if (popupPicker_ && FormIsNavigating()) {
-    popupPicker_->multiSelect = multiple;
-    PopupMenuUpdate(popupMenuItems_, selectedIndex);
-    SetFormIsNavigating(false);
-    return;
+                               bool multiple,
+                               const gfx::Rect& bounds) {
+  if (!select_picker_) {
+    select_picker_.reset(CreateSelectPicker(
+        this, selectedIndex, std::move(items), multiple, bounds));
+
+    // Picker has been shown on top of webview and the page content gets
+    // partially overlapped. Decrease viewport while showing picker.
+    AdjustViewPortHeightToPopupMenu(true /* is_popup_menu_visible */);
+  } else {
+    select_picker_->UpdatePickerData(selectedIndex, std::move(items), multiple);
   }
 
-  if (popupPicker_)
-    popup_picker_del(popupPicker_);
-  popupPicker_ = 0;
-
-  if (multiple)
-    popupPicker_ =
-        popup_picker_new(this, evas_object(), popupMenuItems_, 0, multiple);
-  else
-    popupPicker_ = popup_picker_new(this, evas_object(), popupMenuItems_,
-                                    selectedIndex, multiple);
-
-  popup_picker_buttons_update(popupPicker_, formNavigation_.position,
-                              formNavigation_.count, false);
-
-  // Picker has been shown on top of webview and the page content gets
-  // partially overlapped. Decrease viewport while showing picker.
-  AdjustViewPortHeightToPopupMenu(true /* is_popup_menu_visible */);
-  ScrollFocusedNodeIntoView();
+  select_picker_->Show();
 }
 
 void EWebView::HidePopupMenu() {
-  if (!popupPicker_)
-    return;
-
-  if (FormIsNavigating())
+  if (!select_picker_)
     return;
 
   AdjustViewPortHeightToPopupMenu(false /* is_popup_menu_visible */);
-  popup_picker_del(popupPicker_);
-  popupPicker_ = 0;
-}
-
-void EWebView::UpdateFormNavigation(int formElementCount,
-                                    int currentNodeIndex,
-                                    bool prevState,
-                                    bool nextState) {
-  formNavigation_.count = formElementCount;
-  formNavigation_.position = currentNodeIndex;
-  formNavigation_.prevState = prevState;
-  formNavigation_.nextState = nextState;
-}
-
-void EWebView::SetFormIsNavigating(bool formIsNavigating) {
-  formIsNavigating_ = formIsNavigating;
+  select_picker_.reset();
 }
 
-Eina_Bool EWebView::PopupMenuUpdate(Eina_List* items, int selectedIndex) {
-  if (!popupPicker_)
-    return false;
-
-  popup_picker_update(evas_object(), popupPicker_, items, selectedIndex);
-  popup_picker_buttons_update(popupPicker_, formNavigation_.position,
-                              formNavigation_.count, false);
-  return true;
-}
-
-void EWebView::FormNavigate(bool direction) {
-  RenderFrameHostImpl* render_frame_host =
-      static_cast<RenderFrameHostImpl*>(web_contents_->GetPrimaryMainFrame());
-  if (!render_frame_host)
-    return;
-
-  popup_picker_buttons_update(popupPicker_, formNavigation_.position,
-                              formNavigation_.count, true);
-
-  if ((direction && formNavigation_.nextState) ||
-      (!direction && formNavigation_.prevState))
-    SetFormIsNavigating(true);
-
-  listClosed(popupPicker_, 0, 0, 0);
-  render_frame_host->Send(new EwkFrameMsg_MoveToNextOrPreviousSelectElement(
-      render_frame_host->GetRoutingID(), direction));
+void EWebView::DidSelectPopupMenuItems(std::vector<int>& indices) {
+  wcva()->wcva_helper()->DidSelectPopupMenuItems(indices);
 }
 
-Eina_Bool EWebView::DidSelectPopupMenuItem(int selectedIndex) {
-  RenderFrameHostImpl* render_frame_host =
-      static_cast<RenderFrameHostImpl*>(web_contents_->GetPrimaryMainFrame());
-  if (!render_frame_host)
-    return false;
-
-  if (!popupMenuItems_)
-    return false;
-
-  // 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 (selectedIndex != -1 &&
-      selectedIndex >= (int)eina_list_count(popupMenuItems_))
-    return false;
-
-  // In order to reuse RenderFrameHostImpl::DidSelectPopupMenuItems() method in
-  // Android,
-  // put selectedIndex into std::vector<int>.
-  std::vector<int> selectedIndices;
-  selectedIndices.push_back(selectedIndex);
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
-  render_frame_host->DidSelectPopupMenuItems(selectedIndices);
-#endif
-  return true;
-}
-
-Eina_Bool EWebView::DidMultipleSelectPopupMenuItem(
-    std::vector<int>& selectedIndices) {
-  RenderFrameHostImpl* render_frame_host =
-      static_cast<RenderFrameHostImpl*>(web_contents_->GetPrimaryMainFrame());
-  if (!render_frame_host)
-    return false;
-
-  if (!popupMenuItems_)
-    return false;
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
-  render_frame_host->DidSelectPopupMenuItems(selectedIndices);
-#endif
-  return true;
-}
-
-void EWebView::PopupMenuClose() {
-  HidePopupMenu();
-  ReleasePopupMenuList();
+void EWebView::DidCancelPopupMenu() {
   wcva()->wcva_helper()->DidCancelPopupMenu();
 }
 
@@ -1339,19 +1208,23 @@ void EWebView::ScrollFocusedNodeIntoView() {
 }
 
 void EWebView::AdjustViewPortHeightToPopupMenu(bool is_popup_menu_visible) {
-  DCHECK(popupPicker_);
+  if (!rwhva() || !IsMobileProfile() ||
+      settings_->getPreferences().TizenCompatibilityModeEnabled()) {
+    return;
+  }
 
-  int picker_height = 0;
-  popup_picker_geometry_get(popupPicker_, 0, 0, 0, &picker_height);
+  int picker_height = select_picker_->GetGeometryDIP().height();
+  gfx::Rect screen_rect =
+      display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
+  gfx::Rect view_rect = rwhva()->offscreen_helper()->GetViewBounds();
+  int bottom_height =
+      screen_rect.height() - (view_rect.y() + view_rect.height());
 
-  gfx::Rect rect = rwhva()->offscreen_helper()->GetViewBounds();
-  // FIXME(g.czajkowski): detect the need of resizing viewport.
-  // Checking the position of focused <select> 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;
 }
 
index 9d87a7a..ee88fa3 100644 (file)
@@ -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<blink::mojom::MenuItemPtr> 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<int>& selectedIndices);
-  void PopupMenuClose();
+  void DidSelectPopupMenuItems(std::vector<int>& 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<content::ContextMenuControllerEfl> context_menu_;
 #if !defined(EWK_BRINGUP)  // FIXME: m71 bringup
   std::unique_ptr<content::FileChooserControllerEfl> file_chooser_;
@@ -863,6 +845,7 @@ class EWebView {
   content::AcceptLanguagesHelper::AcceptLangsChangedCallback
       accept_langs_changed_callback_;
 
+  std::unique_ptr<SelectPickerBase> select_picker_;
   std::unique_ptr<aura::WindowTreeHost> host_;
   std::unique_ptr<aura::client::FocusClient> focus_client_;
   std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_;
index 154762e..19fc4e7 100644 (file)
@@ -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<int>& selected_indices) {
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
-  RenderFrameImpl* render_frame_impl_ = static_cast<RenderFrameImpl*>(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;
index 045c65d..9f3dfe2 100644 (file)
@@ -60,9 +60,6 @@ class RenderFrameObserverEfl : public RenderFrameObserver {
                   RenderFrame* frame) override;
 
  private:
-  void OnSelectPopupMenuItems(bool canceled,
-                              const std::vector<int>& selected_indices);
-
   void OnLoadNotFoundErrorPage(std::string errorUrl);
 
   void OnMoveToNextOrPreviousSelectElement(bool direction);
index 33f8000..493a38c 100644 (file)
@@ -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",
   ]
 }
index 9f3e959..8989867 100644 (file)
@@ -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 (file)
index 0000000..0ff54ea
--- /dev/null
@@ -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 (file)
index 0000000..aeed88a
Binary files /dev/null and b/tizen_src/ewk/efl_integration/resource/images/highlight_stroke.png differ
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 (file)
index 0000000..23cc8ee
Binary files /dev/null and b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down.png differ
diff --git a/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down_f.png b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down_f.png
new file mode 100644 (file)
index 0000000..127a565
Binary files /dev/null and b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_down_f.png differ
diff --git a/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up.png b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up.png
new file mode 100644 (file)
index 0000000..fda9464
Binary files /dev/null and b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up.png differ
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 (file)
index 0000000..2526337
Binary files /dev/null and b/tizen_src/ewk/efl_integration/resource/images/obe_list_scroll_up_f.png differ
index b6ce1c7..a4ecb2c 100644 (file)
@@ -34,7 +34,7 @@ void WebContentsEflDelegateEwk::ShowPopupMenu(
     bool right_aligned,
     bool allow_multiple_selection) {
   web_view_->HandlePopupMenu(std::move(items), selected_item,
-                             allow_multiple_selection);
+                             allow_multiple_selection, bounds);
 }
 
 void WebContentsEflDelegateEwk::HidePopupMenu() {
index c48e996..8917a69 100644 (file)
@@ -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,