void SetCursor(const ui::Cursor& cursor) override;
#if BUILDFLAG(IS_TIZEN_TV)
void DidEdgeScrollBy(const gfx::Point& point, bool handled) override {}
+ void MoveFocusToBrowser(int direction) override {}
void NotifyTrackInfoToBrowser(int active_track_id,
const std::string& url,
const std::string& lang) override {}
view_->DidEdgeScrollBy(offset, handled);
}
+void RenderWidgetHostImpl::MoveFocusToBrowser(int direction) {
+ if (!GetView())
+ return;
+
+ view_->MoveFocusToBrowser(direction);
+}
+
void RenderWidgetHostImpl::SetTranslatedURL(const std::string& url) {
if (!blink_widget_)
return;
#if BUILDFLAG(IS_TIZEN_TV)
//Browser edge scroll
void DidEdgeScrollBy(const gfx::Point& point, bool handled) override;
+ void MoveFocusToBrowser(int direction) override;
void NotifyTrackInfoToBrowser(int active_track_id,
const std::string& url,
const std::string& lang) override;
efl_helper_->DidEdgeScrollBy(offset, handled);
}
+void RenderWidgetHostViewAura::MoveFocusToBrowser(int direction) {
+ if (aura_efl_helper()) {
+ aura_efl_helper()->MoveFocusToBrowser(direction);
+ }
+}
+
void RenderWidgetHostViewAura::NotifyTrackInfoToBrowser(
int active_track_id,
const std::string& url,
#if BUILDFLAG(IS_TIZEN_TV)
//Browser edge scroll
void DidEdgeScrollBy(const gfx::Point& offset, bool handled) override ;
+ void MoveFocusToBrowser(int direction) override;
void NotifyTrackInfoToBrowser(int active_track_id,
const std::string& url,
const std::string& lang) override;
#if BUILDFLAG(IS_TIZEN_TV)
//Browser edge scroll
virtual void DidEdgeScrollBy(const gfx::Point& offset, bool handled) {}
+ virtual void MoveFocusToBrowser(int direction) {}
+
// notify web browser video playing status
virtual void VideoPlayingStatusReceived(bool is_playing, int callback_id) {}
#if BUILDFLAG(IS_TIZEN_TV)
virtual void DidEdgeScrollBy(const gfx::Point& offset, bool handled) {}
+ virtual void MoveFocusToBrowser(int direction) {}
virtual void ShowMicOpenedNotification(bool show) {}
#endif
//Browser edge scroll
DidEdgeScrollBy(gfx.mojom.Point offset, bool handled);
+ [EnableIf=is_tizen_tv]
+ MoveFocusToBrowser(int32 direction);
+
// Sent by a widget to the browser to set the tooltip text for the current
// cursor position. An empty |tooltip_text| will hide the tooltip view.
UpdateTooltipUnderCursor(mojo_base.mojom.String16 tooltip_text,
<< " url:" << url << " lang:" << lang;
widget_base_->NotifyTrackInfoToBrowser(active_track_id, url, lang);
}
+
+void WebFrameWidgetImpl::MoveFocusToBrowser(int direction) {
+ widget_base_->MoveFocusToBrowser(direction);
+}
#endif
#if BUILDFLAG(IS_TIZEN)
void NotifyTrackInfoToBrowser(int active_track_id,
const std::string& url,
const std::string& lang);
+ void MoveFocusToBrowser(int direction);
#endif
protected:
enum class SpatialNavigationDirection { kNone, kUp, kRight, kDown, kLeft };
+// The direction value in WebFocusType (before Tizen 5.5) is different from
+// SpatialNavigationDirection. While ewk callback is using the int value of
+// them, if can not change ewk interface then we need compatible adaptation
+enum CompatibilityFocusType {
+ kFocusTypeNone = 0,
+ // Spatial navigation.
+ kFocusTypeUp = 3,
+ kFocusTypeDown,
+ kFocusTypeLeft,
+ kFocusTypeRight
+};
+
constexpr double kMaxDistance = std::numeric_limits<double>::max();
CORE_EXPORT bool IsSpatialNavigationEnabled(const LocalFrame*);
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#if BUILDFLAG(IS_TIZEN_TV)
+#include "third_party/blink/renderer/core/frame/web_frame_widget_impl.h"
#include "third_party/blink/renderer/platform/keyboard_codes.h"
#endif
visitor->Trace(page_);
}
+int SpatialNavigationController::ToCompatibilityFocusType(
+ SpatialNavigationDirection direction) {
+ switch (direction) {
+ case SpatialNavigationDirection::kUp:
+ return CompatibilityFocusType::kFocusTypeUp;
+ case SpatialNavigationDirection::kDown:
+ return CompatibilityFocusType::kFocusTypeDown;
+ case SpatialNavigationDirection::kLeft:
+ return CompatibilityFocusType::kFocusTypeLeft;
+ case SpatialNavigationDirection::kRight:
+ return CompatibilityFocusType::kFocusTypeRight;
+ case SpatialNavigationDirection::kNone:
+ return CompatibilityFocusType::kFocusTypeNone;
+ default:
+ NOTREACHED();
+ return CompatibilityFocusType::kFocusTypeNone;
+ }
+}
+
bool SpatialNavigationController::Advance(
SpatialNavigationDirection direction) {
Node* interest_node = StartingNode();
document->UpdateStyleAndLayout(DocumentUpdateReason::kSpatialNavigation);
}
+#if BUILDFLAG(IS_TIZEN_TV)
+ Frame* frame = page_->GetFocusController().FocusedOrMainFrame();
+ auto* local_frame = DynamicTo<LocalFrame>(frame);
+ if (!local_frame)
+ return false;
+ WebFrameWidgetImpl* wfwgt =
+ static_cast<WebFrameWidgetImpl*>(local_frame->GetWidgetForLocalRoot());
+ if (!wfwgt)
+ return false;
+ wfwgt->MoveFocusToBrowser(ToCompatibilityFocusType(direction));
+#endif
+
return false;
}
#endif
private:
+ int ToCompatibilityFocusType(SpatialNavigationDirection direction);
// Entry-point into SpatialNavigation advancement. Will return true if an
// action (moving interest or scrolling), false otherwise.
bool Advance(SpatialNavigationDirection direction);
widget_host_->DidEdgeScrollBy(offset, handled);
}
+void WidgetBase::MoveFocusToBrowser(int direction) {
+ widget_host_->MoveFocusToBrowser(direction);
+}
+
void WidgetBase::NotifyTrackInfoToBrowser(int active_track_id,
const std::string& url,
const std::string& lang) {
#if BUILDFLAG(IS_TIZEN_TV)
//Browser edge scroll
void DidEdgeScrollBy(const gfx::Point& offset, bool handled);
+ void MoveFocusToBrowser(int direction);
void NotifyTrackInfoToBrowser(int active_track_id,
const std::string& url,
const std::string& lang);
web_contents_->GetDelegate()->DidEdgeScrollBy(offset, handled);
}
+void RWHVAuraCommonHelperEfl::MoveFocusToBrowser(int direction) {
+ if (web_contents_)
+ web_contents_->GetDelegate()->MoveFocusToBrowser(direction);
+}
+
void RWHVAuraCommonHelperEfl::SetParentalRatingResult(const std::string& url,
bool is_pass) {
if (rwhv_aura_)
#if BUILDFLAG(IS_TIZEN_TV)
//Browser edge scroll
void DidEdgeScrollBy(const gfx::Point& offset, bool handled);
+ void MoveFocusToBrowser(int direction);
void SetPopupMenuVisible(const bool visible);
void SetPopupMenuBounds(const gfx::Rect& popup_bounds);
void SetCursorByClient(bool enable) { cursor_set_by_client_ = enable; }
NewWindowNavigationPolicyDecision,
#endif // IS_TIZEN
#if BUILDFLAG(IS_TIZEN_TV)
+ AtkKeyEventNotHandled,
HoverOverLink,
HoverOutLink,
ParentalRatingInfo,
#if BUILDFLAG(IS_TIZEN_TV)
DECLARE_EWK_VIEW_CALLBACK(ParentalRatingInfo, "on,parentalrating,info", void*);
+DECLARE_EWK_VIEW_CALLBACK(AtkKeyEventNotHandled,
+ "atk,keyevent,nothandled",
+ int*);
DECLARE_EWK_VIEW_CALLBACK(HoverOverLink, "hover,over,link", const char*);
DECLARE_EWK_VIEW_CALLBACK(HoverOutLink, "hover,out,link", const char*);
DECLARE_EWK_VIEW_CALLBACK(LoginFormSubmitted,
web_view_->InvokeEdgeScrollByCallback(offset, handled);
}
+void WebContentsDelegateEfl::MoveFocusToBrowser(int direction) {
+ if (web_view_) {
+ web_view_->SmartCallback<EWebViewCallbacks::AtkKeyEventNotHandled>().call(
+ &direction);
+ }
+}
+
void WebContentsDelegateEfl::WillDraw(int new_rotation,
gfx::Size frame_data_output_size) {
if (web_view_) {
#if BUILDFLAG(IS_TIZEN_TV)
//Browser edge scroll
void DidEdgeScrollBy(const gfx::Point& offset, bool handled) override;
+ void MoveFocusToBrowser(int direction) override;
void NotifyDownloadableFontInfo(const std::string& scheme_id_uri,
const std::string& value,
const std::string& data,