예제 #1
0
// Called by WebInspectorProxy messages
void WebInspectorProxy::createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters& inspectorPageParameters)
{
    inspectorPageID = 0;

    if (!m_page)
        return;

    m_isAttached = shouldOpenAttached();
    m_attachmentSide = static_cast<AttachmentSide>(inspectorPageGroup()->preferences()->inspectorAttachmentSide());

    WebPageProxy* inspectorPage = platformCreateInspectorPage();
    ASSERT(inspectorPage);
    if (!inspectorPage)
        return;

    inspectorPageID = inspectorPage->pageID();
    inspectorPageParameters = inspectorPage->creationParameters();

    WKPagePolicyClientV1 policyClient = {
        { 1, this },
        0, /* decidePolicyForNavigationAction_deprecatedForUseWithV0 */
        0, /* decidePolicyForNewWindowAction */
        0, /* decidePolicyForResponse_deprecatedForUseWithV0 */
        0, /* unableToImplementPolicy */
        decidePolicyForNavigationAction,
        0, /* decidePolicyForResponse */
    };

    WKPageSetPagePolicyClient(toAPI(inspectorPage), &policyClient.base);

    String url = inspectorPageURL();

    url.append("?dockSide=");

    if (m_isAttached) {
        switch (m_attachmentSide) {
        case AttachmentSideBottom:
            url.append("bottom");
            m_page->process().send(Messages::WebInspector::AttachedBottom(), m_page->pageID());
            break;
        case AttachmentSideRight:
            url.append("right");
            m_page->process().send(Messages::WebInspector::AttachedRight(), m_page->pageID());
            break;
        }
    } else
        url.append("undocked");

    m_page->process().assumeReadAccessToBaseURL(inspectorBaseURL());

    inspectorPage->loadRequest(URL(URL(), url));

    m_createdInspectorPage = true;
}
예제 #2
0
// Called by WebInspectorProxy messages
void WebInspectorProxy::createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters& inspectorPageParameters)
{
    inspectorPageID = 0;

    if (!m_page)
        return;

    WebPageProxy* inspectorPage = platformCreateInspectorPage();
    ASSERT(inspectorPage);
    if (!inspectorPage)
        return;

    inspectorPageID = inspectorPage->pageID();
    inspectorPageParameters = inspectorPage->creationParameters(IntSize(0, 0));

    inspectorPage->loadURL(inspectorPageURL());
}
// Called by WebInspectorProxy messages
void WebInspectorProxy::createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters& inspectorPageParameters)
{
    inspectorPageID = 0;

    if (!m_page)
        return;

    m_isAttached = shouldOpenAttached();

    WebPageProxy* inspectorPage = platformCreateInspectorPage();
    ASSERT(inspectorPage);
    if (!inspectorPage)
        return;

    inspectorPageID = inspectorPage->pageID();
    inspectorPageParameters = inspectorPage->creationParameters();

    String url = inspectorPageURL();
    if (m_isAttached)
        url += "?docked=true";
    m_page->process()->assumeReadAccessToBaseURL(inspectorBaseURL());
    inspectorPage->loadURL(url);
}