From 8c10136c6676d3790ad64b3d448a1a1f09a9ff76 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 6 Jul 2021 15:46:38 +0200 Subject: Remove outdated QT_VERSION_CHECKs Change-Id: I4c4b78af0bd7da5912b5e0136f9cfdb3c4268a7e Reviewed-by: Kirill Burtsev (cherry picked from commit e62dde53f093dd2c404a65cf99e854081396632b) Reviewed-by: Qt Cherry-pick Bot --- src/core/profile_io_data_qt.h | 5 ----- src/core/render_widget_host_view_qt.cpp | 4 ---- src/core/render_widget_host_view_qt_delegate_client.cpp | 4 ---- src/core/web_event_factory.cpp | 14 -------------- 4 files changed, 27 deletions(-) (limited to 'src/core') diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h index ab5c588f5..326c50d26 100644 --- a/src/core/profile_io_data_qt.h +++ b/src/core/profile_io_data_qt.h @@ -137,12 +137,7 @@ private: QString m_httpCachePath; QString m_storageName; bool m_inMemoryOnly; -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - QMutex m_mutex{QMutex::Recursive}; - using QRecursiveMutex = QMutex; -#else QRecursiveMutex m_mutex; -#endif int m_httpCacheMaxSize = 0; BrowsingDataRemoverObserverQt m_removerObserver; QString m_dataPath; diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 04d0ceda1..192ab460d 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -706,11 +706,7 @@ void RenderWidgetHostViewQt::OnUpdateTextInputStateCalled(content::TextInputMana } ui::TextInputType type = getTextInputType(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) m_delegate->setInputMethodHints(toQtInputMethodHints(getTextInputType()) | Qt::ImhNoPredictiveText | Qt::ImhNoTextHandles | Qt::ImhNoEditMenu); -#else - m_delegate->setInputMethodHints(toQtInputMethodHints(getTextInputType()) | Qt::ImhNoPredictiveText); -#endif QString surroundingText = toQt(state->value); // Remove IME composition text from the surrounding text if (state->composition.has_value()) diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp index eb0a0ff12..0f218ab6c 100644 --- a/src/core/render_widget_host_view_qt_delegate_client.cpp +++ b/src/core/render_widget_host_view_qt_delegate_client.cpp @@ -406,12 +406,8 @@ QVariant RenderWidgetHostViewQtDelegateClient::inputMethodQuery(Qt::InputMethodQ // TODO: Implement this return QVariant(); // No limit. case Qt::ImHints: -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) return int(toQtInputMethodHints(m_rwhv->getTextInputType()) | Qt::ImhNoPredictiveText | Qt::ImhNoTextHandles | Qt::ImhNoEditMenu); -#else - return int(toQtInputMethodHints(m_rwhv->getTextInputType()) | Qt::ImhNoPredictiveText); -#endif default: return QVariant(); } diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index aa5ea4036..b82877bac 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -950,7 +950,6 @@ static ui::DomKey domKeyForQtKey(int qtKey) return ui::DomKey::ZENKAKU; case Qt::Key_Zenkaku_Hankaku: return ui::DomKey::ZENKAKU_HANKAKU; -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) // Dead keys (ui/events/keycodes/keyboard_code_conversion_xkb.cc) case Qt::Key_Dead_Grave: return ui::DomKey::DeadKeyFromCombiningCharacter(0x0300); @@ -1018,7 +1017,6 @@ static ui::DomKey domKeyForQtKey(int qtKey) return ui::DomKey::DeadKeyFromCombiningCharacter(0x00A4); case Qt::Key_Dead_Greek: return ui::DomKey::DeadKeyFromCombiningCharacter(0x037E); -#endif // General-Purpose Function Keys case Qt::Key_F1: return ui::DomKey::F1; @@ -1580,9 +1578,7 @@ blink::WebMouseWheelEvent::Phase toBlinkPhase(QWheelEvent *ev) { switch (ev->phase()) { case Qt::NoScrollPhase: -#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) case Qt::ScrollMomentum: -#endif return blink::WebMouseWheelEvent::kPhaseNone; case Qt::ScrollBegin: return blink::WebMouseWheelEvent::kPhaseBegan; @@ -1601,15 +1597,10 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev) webEvent.SetType(webEventTypeForEvent(ev)); webEvent.SetModifiers(modifiersForEvent(ev)); webEvent.SetTimeStamp(base::TimeTicks::Now()); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - webEvent.SetPositionInWidget(ev->x(), ev->y()); - webEvent.SetPositionInScreen(ev->globalX(), ev->globalY()); -#else webEvent.SetPositionInWidget(static_cast(ev->position().x()), static_cast(ev->position().y())); webEvent.SetPositionInScreen(static_cast(ev->globalPosition().x()), static_cast(ev->globalPosition().y())); -#endif webEvent.wheel_ticks_x = static_cast(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep; webEvent.wheel_ticks_y = static_cast(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep; @@ -1640,15 +1631,10 @@ bool WebEventFactory::coalesceWebWheelEvent(blink::WebMouseWheelEvent &webEvent, #endif webEvent.SetTimeStamp(base::TimeTicks::Now()); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - webEvent.SetPositionInWidget(ev->x(), ev->y()); - webEvent.SetPositionInScreen(ev->globalX(), ev->globalY()); -#else webEvent.SetPositionInWidget(static_cast(ev->position().x()), static_cast(ev->position().y())); webEvent.SetPositionInScreen(static_cast(ev->globalPosition().x()), static_cast(ev->globalPosition().y())); -#endif webEvent.wheel_ticks_x += static_cast(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep; webEvent.wheel_ticks_y += static_cast(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep; -- cgit v1.2.3