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.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index d6c3b37ad..1458c25ff 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -396,7 +396,7 @@ QSharedPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavig
// Set up the file access rights for the selected navigation entry.
// TODO(joth): This is duplicated from chrome/.../session_restore.cc and
// should be shared e.g. in NavigationController. http://crbug.com/68222
- const int id = newWebContents->GetMainFrame()->GetProcess()->GetID();
+ const int id = newWebContents->GetPrimaryMainFrame()->GetProcess()->GetID();
const blink::PageState& pageState = controller.GetActiveEntry()->GetPageState();
const std::vector<base::FilePath>& filePaths = pageState.GetReferencedFiles();
for (std::vector<base::FilePath>::const_iterator file = filePaths.begin(); file != filePaths.end(); ++file)
@@ -505,7 +505,7 @@ void WebContentsAdapter::initialize(content::SiteInstance *site)
// Create a RenderView with the initial empty document
content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
Q_ASSERT(rvh);
- if (!m_webContents->GetMainFrame()->IsRenderFrameLive())
+ if (!m_webContents->GetPrimaryMainFrame()->IsRenderFrameLive())
static_cast<content::WebContentsImpl*>(m_webContents.get())->CreateRenderViewForRenderManager(
rvh, absl::nullopt, nullptr);
@@ -589,7 +589,7 @@ void WebContentsAdapter::reload()
bool wasDiscarded = (m_lifecycleState == LifecycleState::Discarded);
setLifecycleState(LifecycleState::Active);
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetMainFrame());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
WebEngineSettings *settings = WebEngineSettings::get(m_adapterClient->webEngineSettings());
settings->doApply();
if (!wasDiscarded) // undiscard() already triggers a reload
@@ -604,7 +604,7 @@ void WebContentsAdapter::reloadAndBypassCache()
bool wasDiscarded = (m_lifecycleState == LifecycleState::Discarded);
setLifecycleState(LifecycleState::Active);
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetMainFrame());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
WebEngineSettings *settings = WebEngineSettings::get(m_adapterClient->webEngineSettings());
settings->doApply();
if (!wasDiscarded) // undiscard() already triggers a reload
@@ -636,7 +636,7 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request)
setLifecycleState(LifecycleState::Active);
}
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetMainFrame());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
WebEngineSettings::get(m_adapterClient->webEngineSettings())->doApply();
@@ -724,7 +724,7 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT
else
setLifecycleState(LifecycleState::Active);
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetMainFrame());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
WebEngineSettings::get(m_adapterClient->webEngineSettings())->doApply();
@@ -875,7 +875,7 @@ void WebContentsAdapter::navigateBack()
{
CHECK_INITIALIZED();
base::RecordAction(base::UserMetricsAction("Back"));
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetMainFrame());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
if (!m_webContents->GetController().CanGoBack())
return;
m_webContents->GetController().GoBack();
@@ -886,7 +886,7 @@ void WebContentsAdapter::navigateForward()
{
CHECK_INITIALIZED();
base::RecordAction(base::UserMetricsAction("Forward"));
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetMainFrame());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
if (!m_webContents->GetController().CanGoForward())
return;
m_webContents->GetController().GoForward();
@@ -896,7 +896,7 @@ void WebContentsAdapter::navigateForward()
void WebContentsAdapter::navigateToIndex(int offset)
{
CHECK_INITIALIZED();
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetMainFrame());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
m_webContents->GetController().GoToIndex(offset);
focusIfNecessary();
}
@@ -904,7 +904,7 @@ void WebContentsAdapter::navigateToIndex(int offset)
void WebContentsAdapter::navigateToOffset(int offset)
{
CHECK_INITIALIZED();
- CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetMainFrame());
+ CHECK_VALID_RENDER_WIDGET_HOST_VIEW(m_webContents->GetPrimaryMainFrame());
m_webContents->GetController().GoToOffset(offset);
focusIfNecessary();
}
@@ -982,7 +982,7 @@ void WebContentsAdapter::setZoomFactor(qreal factor)
content::HostZoomMap *zoomMap = content::HostZoomMap::GetForWebContents(m_webContents.get());
if (zoomMap) {
- int render_process_id = m_webContents->GetMainFrame()->GetProcess()->GetID();
+ int render_process_id = m_webContents->GetPrimaryMainFrame()->GetProcess()->GetID();
int render_view_id = m_webContents->GetRenderViewHost()->GetRoutingID();
zoomMap->SetTemporaryZoomLevel(render_process_id, render_view_id, zoomLevel);
}
@@ -1020,7 +1020,7 @@ QWebEngineUrlRequestInterceptor* WebContentsAdapter::requestInterceptor() const
QAccessibleInterface *WebContentsAdapter::browserAccessible()
{
CHECK_INITIALIZED(nullptr);
- content::RenderFrameHostImpl *rfh = static_cast<content::RenderFrameHostImpl *>(m_webContents->GetMainFrame());
+ content::RenderFrameHostImpl *rfh = static_cast<content::RenderFrameHostImpl *>(m_webContents->GetPrimaryMainFrame());
if (!rfh)
return nullptr;
content::BrowserAccessibilityManager *manager = rfh->GetOrCreateBrowserAccessibilityManager();
@@ -1035,7 +1035,7 @@ QAccessibleInterface *WebContentsAdapter::browserAccessible()
void WebContentsAdapter::runJavaScript(const QString &javaScript, quint32 worldId)
{
CHECK_INITIALIZED();
- content::RenderFrameHost *rfh = m_webContents->GetMainFrame();
+ content::RenderFrameHost *rfh = m_webContents->GetPrimaryMainFrame();
Q_ASSERT(rfh);
if (worldId == 0)
rfh->ExecuteJavaScript(toString16(javaScript), base::NullCallback());
@@ -1046,7 +1046,7 @@ void WebContentsAdapter::runJavaScript(const QString &javaScript, quint32 worldI
quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript, quint32 worldId)
{
CHECK_INITIALIZED(0);
- content::RenderFrameHost *rfh = m_webContents->GetMainFrame();
+ content::RenderFrameHost *rfh = m_webContents->GetPrimaryMainFrame();
Q_ASSERT(rfh);
content::RenderFrameHost::JavaScriptResultCallback callback = base::BindOnce(&callbackOnEvaluateJS, m_adapterClient, m_nextRequestId);
if (worldId == 0)
@@ -1158,7 +1158,7 @@ qint64 WebContentsAdapter::renderProcessPid() const
{
CHECK_INITIALIZED(0);
- content::RenderProcessHost *renderProcessHost = m_webContents->GetMainFrame()->GetProcess();
+ content::RenderProcessHost *renderProcessHost = m_webContents->GetPrimaryMainFrame()->GetProcess();
const base::Process &process = renderProcessHost->GetProcess();
if (!process.IsValid())
return 0;
@@ -1168,7 +1168,7 @@ qint64 WebContentsAdapter::renderProcessPid() const
void WebContentsAdapter::copyImageAt(const QPoint &location)
{
CHECK_INITIALIZED();
- m_webContents->GetMainFrame()->CopyImageAt(location.x(), location.y());
+ m_webContents->GetPrimaryMainFrame()->CopyImageAt(location.x(), location.y());
}
static blink::mojom::MediaPlayerActionType toBlinkMediaPlayerActionType(WebContentsAdapter::MediaPlayerAction action)
@@ -1195,7 +1195,7 @@ void WebContentsAdapter::executeMediaPlayerActionAt(const QPoint &location, Medi
if (action == MediaPlayerNoAction)
return;
blink::mojom::MediaPlayerAction blinkAction(toBlinkMediaPlayerActionType(action), enable);
- m_webContents->GetMainFrame()->ExecuteMediaPlayerActionAtLocation(toGfx(location), blinkAction);
+ m_webContents->GetPrimaryMainFrame()->ExecuteMediaPlayerActionAtLocation(toGfx(location), blinkAction);
}
void WebContentsAdapter::inspectElementAt(const QPoint &location)
@@ -1813,7 +1813,7 @@ void WebContentsAdapter::viewSource()
{
CHECK_INITIALIZED();
base::RecordAction(base::UserMetricsAction("ViewSource"));
- m_webContents->GetMainFrame()->ViewSource();
+ m_webContents->GetPrimaryMainFrame()->ViewSource();
}
bool WebContentsAdapter::canViewSource()
@@ -2000,7 +2000,7 @@ void WebContentsAdapter::discard()
nullContents->SetWasDiscarded(true);
// Kill render process if this is the only page it's got.
- content::RenderProcessHost *renderProcessHost = m_webContents->GetMainFrame()->GetProcess();
+ content::RenderProcessHost *renderProcessHost = m_webContents->GetPrimaryMainFrame()->GetProcess();
renderProcessHost->FastShutdownIfPossible(/* page_count */ 1u,
/* skip_unload_handlers */ false);
@@ -2037,7 +2037,7 @@ void WebContentsAdapter::undiscard()
// Create a RenderView with the initial empty document
content::RenderViewHost *rvh = m_webContents->GetRenderViewHost();
Q_ASSERT(rvh);
- if (!m_webContents->GetMainFrame()->IsRenderFrameLive())
+ if (!m_webContents->GetPrimaryMainFrame()->IsRenderFrameLive())
static_cast<content::WebContentsImpl *>(m_webContents.get())
->CreateRenderViewForRenderManager(rvh, absl::nullopt, nullptr);
m_webContentsDelegate->RenderViewHostChanged(nullptr, rvh);