Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures& windowFeatures, const NavigationAction& navigationAction) { uint32_t modifiers = modifiersForNavigationAction(navigationAction); int32_t mouseButton = mouseButtonForNavigationAction(navigationAction); uint64_t newPageID = 0; WebPageCreationParameters parameters; if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::CreateNewPage(windowFeatures, modifiers, mouseButton), Messages::WebPageProxy::CreateNewPage::Reply(newPageID, parameters), m_page->pageID())) return 0; if (!newPageID) return 0; WebProcess::shared().createWebPage(newPageID, parameters); return WebProcess::shared().webPage(newPageID)->corePage(); }
void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction& navigationAction, const ResourceRequest& request, PassRefPtr<FormState>, const String& frameName) { WebPage* webPage = m_frame->page(); if (!webPage) return; uint64_t listenerID = m_frame->setUpPolicyListener(function); // FIXME: Pass more than just the navigation action type. // FIXME: Pass the frame name. const String& url = request.url().string(); // FIXME: Pass entire request. uint32_t modifiers = modifiersForNavigationAction(navigationAction); WebProcess::shared().connection()->send(WebPageProxyMessage::DecidePolicyForNewWindowAction, webPage->pageID(), CoreIPC::In(m_frame->frameID(), (uint32_t)navigationAction.type(), modifiers, url, listenerID)); }
InjectedBundleNavigationAction::InjectedBundleNavigationAction(WebFrame* frame, const NavigationAction& navigationAction, PassRefPtr<FormState> prpFormState) : m_navigationType(navigationAction.type()) , m_modifiers(modifiersForNavigationAction(navigationAction)) , m_mouseButton(WebMouseEvent::NoButton) , m_downloadAttribute(navigationAction.downloadAttribute()) , m_shouldOpenExternalURLs(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow || navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes) , m_shouldTryAppLinks(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow) { if (const MouseEvent* mouseEvent = mouseEventForNavigationAction(navigationAction)) { m_hitTestResult = InjectedBundleHitTestResult::create(frame->coreFrame()->eventHandler().hitTestResultAtPoint(mouseEvent->absoluteLocation())); m_mouseButton = mouseButtonForMouseEvent(mouseEvent); } RefPtr<FormState> formState = prpFormState; if (formState) { ASSERT(formState->form()); m_formElement = InjectedBundleNodeHandle::getOrCreate(formState->form()); } }
void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& navigationAction, const ResourceRequest& request, PassRefPtr<FormState>) { if (m_frame->coreFrame()->loader()->documentLoader()->url().isEmpty() && request.url() == blankURL()) { // WebKit2 loads initial about:blank documents synchronously, without consulting the policy delegate ASSERT(m_frame->coreFrame()->loader()->stateMachine()->committingFirstRealLoad()); (m_frame->coreFrame()->loader()->policyChecker()->*function)(PolicyUse); return; } WebPage* webPage = m_frame->page(); if (!webPage) return; uint64_t listenerID = m_frame->setUpPolicyListener(function); // FIXME: Pass more than just the navigation action type. const String& url = request.url().string(); // FIXME: Pass entire request. uint32_t modifiers = modifiersForNavigationAction(navigationAction); WebProcess::shared().connection()->send(WebPageProxyMessage::DecidePolicyForNavigationAction, webPage->pageID(), CoreIPC::In(m_frame->frameID(), (uint32_t)navigationAction.type(), modifiers, url, listenerID)); }