void RenderWidgetHostViewAura::UpdateTooltipUnderCursor(
const std::u16string& tooltip_text) {
+ if (efl_helper_)
+ efl_helper_->UpdateTooltipUnderCursor(tooltip_text);
if (GetCursorManager()->IsViewUnderCursor(this))
UpdateTooltip(tooltip_text);
}
virtual void MoveFocusToBrowser(int direction) {}
virtual void ShowMicOpenedNotification(bool show) {}
#endif
+ virtual void UpdateTooltipUnderCursor(const std::u16string& text) {}
// Returns a pointer to a service to manage JavaScript dialogs. May return
// nullptr in which case dialogs aren't shown.
void ChromeClientImpl::UpdateTooltipUnderCursor(LocalFrame& frame,
const String& tooltip_text,
TextDirection dir) {
+ // Only set tool tip text if it has changed since the last time this function
+ // was called.
+ if (tooltip_text == cached_tooltip_text_)
+ return;
+ cached_tooltip_text_ = tooltip_text;
+
WebFrameWidgetImpl* widget =
WebLocalFrameImpl::FromFrame(frame)->LocalRootFrameWidget();
if (!tooltip_text.empty()) {
bool did_request_non_empty_tool_tip_;
absl::optional<bool> before_unload_confirm_panel_result_for_testing_;
HeapHashSet<WeakMember<CommitObserver>> commit_observers_;
+ String cached_tooltip_text_;
FRIEND_TEST_ALL_PREFIXES(FileChooserQueueTest, DerefQueuedChooser);
};
web_contents_->GetDelegate()->OnDidChangeFocusedNodeBounds(rect);
}
+void RWHVAuraCommonHelperEfl::UpdateTooltipUnderCursor(
+ const std::u16string& text) {
+ web_contents_->GetDelegate()->UpdateTooltipUnderCursor(text);
+}
+
void RWHVAuraCommonHelperEfl::BackgroundColorReceived(
int callback_id, SkColor bg_color) {
web_contents_->GetDelegate()->BackgroundColorReceived(callback_id, bg_color);
void OnGetMainFrameScrollbarVisible(int callback_id, bool visible);
void TextInputStateChanged(const ui::mojom::TextInputState& params);
void OnSelectionRectReceived(const gfx::Rect& selection_rect);
+ void UpdateTooltipUnderCursor(const std::u16string&);
protected:
void SetOffscreenMode() { is_offscreen_mode_ = true; }
DCHECK_CURRENTLY_ON(BrowserThread::UI);
const GURL last_url = GetURL();
bool callback_handled = false;
+ SmartCallback<EWebViewCallbacks::TooltipTextUnset>().call();
SmartCallback<EWebViewCallbacks::WebProcessCrashed>().call(&callback_handled);
if (!callback_handled)
LoadHTMLString(kRendererCrashedHTMLMessage, NULL,
DECLARE_EWK_VIEW_CALLBACK(ProvisionalLoadFailed, "load,provisional,failed", Ewk_Error*);
DECLARE_EWK_VIEW_CALLBACK(NavigationPolicyDecision, "policy,decision,navigation", Ewk_Navigation_Policy_Decision*);
DECLARE_EWK_VIEW_CALLBACK(TextFound, "text,found", unsigned*);
-DECLARE_EWK_VIEW_CALLBACK(TooltipTextUnset, "tooltip,text,unset", void);
DECLARE_EWK_VIEW_CALLBACK(Vibrate, "vibrate", uint32_t*);
*/
DECLARE_EWK_VIEW_CALLBACK(URIChanged, "uri,changed", const char*);
DECLARE_EWK_VIEW_CALLBACK(LoadProgress, "load,progress", double*);
DECLARE_EWK_VIEW_CALLBACK(TooltipTextSet, "tooltip,text,set", const char*);
+DECLARE_EWK_VIEW_CALLBACK(TooltipTextUnset, "tooltip,text,unset", void);
DECLARE_EWK_VIEW_CALLBACK(EnterFullscreen, "fullscreen,enterfullscreen", void);
DECLARE_EWK_VIEW_CALLBACK(ExitFullscreen, "fullscreen,exitfullscreen", void);
DECLARE_EWK_VIEW_CALLBACK(UserMediaPermission, "usermedia,permission,request", _Ewk_User_Media_Permission_Request*);
LOG(INFO) << "web_view_ is null";
}
#endif
+
+void WebContentsDelegateEfl::UpdateTooltipUnderCursor(
+ const std::u16string& text) {
+ std::string tooltip = base::UTF16ToUTF8(text);
+ LOG(INFO) << __func__ << " " << tooltip.c_str();
+ if (tooltip.empty()) {
+ web_view_->SmartCallback<EWebViewCallbacks::TooltipTextUnset>().call();
+ } else {
+ web_view_->SmartCallback<EWebViewCallbacks::TooltipTextSet>().call(
+ tooltip.c_str());
+ }
+}
} // namespace content
const std::string& url) override;
void WillDraw(int rotation, gfx::Size frame_data_output_size) override;
#endif
+ void UpdateTooltipUnderCursor(const std::u16string& text) override;
+
void RequestCertificateConfirm(
WebContents* web_contents,
int cert_error,