Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: third_party/WebKit/Source/web/LocalFrameClientImpl.cpp

Issue 2781723007: Plumb initiator out of Blink. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 void LocalFrameClientImpl::dispatchWillCommitProvisionalLoad() { 420 void LocalFrameClientImpl::dispatchWillCommitProvisionalLoad() {
421 if (m_webFrame->client()) 421 if (m_webFrame->client())
422 m_webFrame->client()->willCommitProvisionalLoad(); 422 m_webFrame->client()->willCommitProvisionalLoad();
423 } 423 }
424 424
425 void LocalFrameClientImpl::dispatchDidStartProvisionalLoad( 425 void LocalFrameClientImpl::dispatchDidStartProvisionalLoad(
426 DocumentLoader* loader, 426 DocumentLoader* loader,
427 ResourceRequest& request) { 427 ResourceRequest& request) {
428 if (m_webFrame->client()) { 428 if (m_webFrame->client()) {
429 WrappedResourceRequest wrappedRequest(request); 429 WrappedResourceRequest wrappedRequest(request);
430 DCHECK(!loader->originDocument() || loader->originDocument()->frame());
431 WebLocalFrame* initiatorFrame =
432 loader->originDocument()
433 ? WebLocalFrameImpl::fromFrame(loader->originDocument()->frame())
434 : nullptr;
430 m_webFrame->client()->didStartProvisionalLoad( 435 m_webFrame->client()->didStartProvisionalLoad(
431 WebDataSourceImpl::fromDocumentLoader(loader), 436 initiatorFrame, WebDataSourceImpl::fromDocumentLoader(loader),
432 wrappedRequest); 437 wrappedRequest);
433 } 438 }
434 if (WebDevToolsAgentImpl* devTools = devToolsAgent()) 439 if (WebDevToolsAgentImpl* devTools = devToolsAgent())
435 devTools->didStartProvisionalLoad(m_webFrame->frame()); 440 devTools->didStartProvisionalLoad(m_webFrame->frame());
436 } 441 }
437 442
438 void LocalFrameClientImpl::dispatchDidReceiveTitle(const String& title) { 443 void LocalFrameClientImpl::dispatchDidReceiveTitle(const String& title) {
439 if (m_webFrame->client()) { 444 if (m_webFrame->client()) {
440 m_webFrame->client()->didReceiveTitle(m_webFrame, title, 445 m_webFrame->client()->didReceiveTitle(m_webFrame, title,
441 WebTextDirectionLeftToRight); 446 WebTextDirectionLeftToRight);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 bool meta = inputEvent->modifiers() & WebMouseEvent::MetaKey; 526 bool meta = inputEvent->modifiers() & WebMouseEvent::MetaKey;
522 527
523 NavigationPolicy userPolicy; 528 NavigationPolicy userPolicy;
524 if (!navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta, 529 if (!navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta,
525 &userPolicy)) 530 &userPolicy))
526 return false; 531 return false;
527 return userPolicy == NavigationPolicyNewBackgroundTab; 532 return userPolicy == NavigationPolicyNewBackgroundTab;
528 } 533 }
529 534
530 NavigationPolicy LocalFrameClientImpl::decidePolicyForNavigation( 535 NavigationPolicy LocalFrameClientImpl::decidePolicyForNavigation(
536 Document* originDocument,
531 const ResourceRequest& request, 537 const ResourceRequest& request,
532 DocumentLoader* loader, 538 DocumentLoader* loader,
533 NavigationType type, 539 NavigationType type,
534 NavigationPolicy policy, 540 NavigationPolicy policy,
535 bool replacesCurrentHistoryItem, 541 bool replacesCurrentHistoryItem,
536 bool isClientRedirect, 542 bool isClientRedirect,
537 HTMLFormElement* form, 543 HTMLFormElement* form,
538 ContentSecurityPolicyDisposition 544 ContentSecurityPolicyDisposition
539 shouldCheckMainWorldContentSecurityPolicy) { 545 shouldCheckMainWorldContentSecurityPolicy) {
540 if (!m_webFrame->client()) 546 if (!m_webFrame->client())
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 if (WebFrameClient* client = m_webFrame->client()) { 726 if (WebFrameClient* client = m_webFrame->client()) {
721 client->didMatchCSS(m_webFrame, WebVector<WebString>(addedSelectors), 727 client->didMatchCSS(m_webFrame, WebVector<WebString>(addedSelectors),
722 WebVector<WebString>(removedSelectors)); 728 WebVector<WebString>(removedSelectors));
723 } 729 }
724 } 730 }
725 731
726 DocumentLoader* LocalFrameClientImpl::createDocumentLoader( 732 DocumentLoader* LocalFrameClientImpl::createDocumentLoader(
727 LocalFrame* frame, 733 LocalFrame* frame,
728 const ResourceRequest& request, 734 const ResourceRequest& request,
729 const SubstituteData& data, 735 const SubstituteData& data,
730 ClientRedirectPolicy clientRedirectPolicy) { 736 ClientRedirectPolicy clientRedirectPolicy,
737 Document* originDocument) {
731 DCHECK(frame); 738 DCHECK(frame);
732 739
733 WebDataSourceImpl* ds = 740 WebDataSourceImpl* ds = WebDataSourceImpl::create(
734 WebDataSourceImpl::create(frame, request, data, clientRedirectPolicy); 741 frame, request, data, clientRedirectPolicy, originDocument);
735 if (m_webFrame->client()) 742 if (m_webFrame->client())
736 m_webFrame->client()->didCreateDataSource(m_webFrame, ds); 743 m_webFrame->client()->didCreateDataSource(m_webFrame, ds);
737 return ds; 744 return ds;
738 } 745 }
739 746
740 String LocalFrameClientImpl::userAgent() { 747 String LocalFrameClientImpl::userAgent() {
741 WebString override = 748 WebString override =
742 m_webFrame->client() ? m_webFrame->client()->userAgentOverride() : ""; 749 m_webFrame->client() ? m_webFrame->client()->userAgentOverride() : "";
743 if (!override.isEmpty()) 750 if (!override.isEmpty())
744 return override; 751 return override;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 if (m_webFrame->client()) 1040 if (m_webFrame->client())
1034 m_webFrame->client()->setHasReceivedUserGesture(); 1041 m_webFrame->client()->setHasReceivedUserGesture();
1035 } 1042 }
1036 1043
1037 void LocalFrameClientImpl::abortClientNavigation() { 1044 void LocalFrameClientImpl::abortClientNavigation() {
1038 if (m_webFrame->client()) 1045 if (m_webFrame->client())
1039 m_webFrame->client()->abortClientNavigation(); 1046 m_webFrame->client()->abortClientNavigation();
1040 } 1047 }
1041 1048
1042 } // namespace blink 1049 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/LocalFrameClientImpl.h ('k') | third_party/WebKit/Source/web/RemoteFrameClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698