summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 081505d7f..5b880d31a 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1772,6 +1772,20 @@ void WebContentsAdapter::resetTouchSelectionController()
rwhv->resetTouchSelectionController();
}
+void WebContentsAdapter::changeTextDirection(bool leftToRight)
+{
+ CHECK_INITIALIZED();
+ if (auto rwhv = static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView())) {
+ auto textInputManager = rwhv->GetTextInputManager();
+ if (!textInputManager)
+ return;
+ if (auto activeWidget = textInputManager->GetActiveWidget()) {
+ activeWidget->UpdateTextDirection(leftToRight ? base::i18n::TextDirection::LEFT_TO_RIGHT : base::i18n::TextDirection::RIGHT_TO_LEFT);
+ activeWidget->NotifyTextDirection();
+ }
+ }
+}
+
WebContentsAdapterClient::RenderProcessTerminationStatus
WebContentsAdapterClient::renderProcessExitStatus(int terminationStatus) {
auto status = WebContentsAdapterClient::RenderProcessTerminationStatus(-1);