summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_view_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/web_contents_view_qt.cpp')
-rw-r--r--src/core/web_contents_view_qt.cpp32
1 files changed, 8 insertions, 24 deletions
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index 6b68a9569..3c4465ae3 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -39,15 +39,18 @@
#include "web_contents_view_qt.h"
-#include "browser_context_adapter.h"
+#include "profile_adapter.h"
#include "content_browser_client_qt.h"
#include "render_widget_host_view_qt_delegate.h"
+#include "render_widget_host_view_qt.h"
#include "type_conversion.h"
#include "web_contents_adapter.h"
#include "web_engine_context.h"
-#include "components/spellcheck/spellcheck_build_features.h"
+#include "components/spellcheck/spellcheck_buildflags.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/renderer_host/render_widget_host_impl.h"
+#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/common/context_menu_params.h"
#include <ui/gfx/image/image_skia.h>
@@ -75,8 +78,6 @@ content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForWidget(conten
view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view));
if (m_client)
view->setAdapterClient(m_client);
- // Tell the RWHV delegate to attach itself to the native view container.
- view->InitAsChild(0);
return view;
}
@@ -92,17 +93,6 @@ content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForPopupWidget(c
return view;
}
-void WebContentsViewQt::RenderViewCreated(content::RenderViewHost* host)
-{
- // The render process is done creating the RenderView and it's ready to be routed
- // messages at this point.
- if (m_client && m_webContents) {
- content::RenderWidgetHostView* rwhv = m_webContents->GetRenderWidgetHostView();
- if (rwhv)
- rwhv->SetBackgroundColor(toSk(m_client->backgroundColor()));
- }
-}
-
void WebContentsViewQt::CreateView(const gfx::Size& initial_size, gfx::NativeView context)
{
// This is passed through content::WebContents::CreateParams::context either as the native view's client
@@ -184,7 +174,7 @@ static inline WebEngineContextMenuData fromParams(const content::ContextMenuPara
ret.setEditFlags((WebEngineContextMenuData::EditFlags)params.edit_flags);
ret.setSuggestedFileName(toQt(params.suggested_filename.data()));
ret.setIsEditable(params.is_editable);
-#if BUILDFLAG(ENABLE_SPELLCHECK)
+#if QT_CONFIG(webengine_spellchecker)
ret.setMisspelledWord(toQt(params.misspelled_word));
ret.setSpellCheckerSuggestions(fromVector(params.dictionary_suggestions));
#endif
@@ -197,7 +187,7 @@ static inline WebEngineContextMenuData fromParams(const content::ContextMenuPara
void WebContentsViewQt::ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams &params)
{
WebEngineContextMenuData contextMenuData(fromParams(params));
-#if BUILDFLAG(ENABLE_SPELLCHECK)
+#if QT_CONFIG(webengine_spellchecker)
// Do not use params.spellcheck_enabled, since it is never
// correctly initialized for chrome asynchronous spellchecking.
// Even fixing the initialization in ContextMenuClientImpl::showContextMenu
@@ -205,7 +195,7 @@ void WebContentsViewQt::ShowContextMenu(content::RenderFrameHost *, const conten
// must be initialized to true due to the way how the initialization sequence
// in SpellCheck works ie. typing the first word triggers the creation
// of the SpellcheckService. Use user preference store instead.
- contextMenuData.setIsSpellCheckerEnabled(m_client->browserContextAdapter()->isSpellCheckEnabled());
+ contextMenuData.setIsSpellCheckerEnabled(m_client->profileAdapter()->isSpellCheckEnabled());
#endif
m_client->contextMenuRequested(contextMenuData);
}
@@ -262,12 +252,6 @@ void WebContentsViewQt::TakeFocus(bool reverse)
m_client->passOnFocus(reverse);
}
-void WebContentsViewQt::GetScreenInfo(content::ScreenInfo* results) const
-{
- if (auto rwhv = static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView()))
- rwhv->GetScreenInfo(results);
-}
-
void WebContentsViewQt::FocusThroughTabTraversal(bool reverse)
{
content::WebContentsImpl *web_contents = static_cast<content::WebContentsImpl*>(m_webContents);