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

Side by Side Diff: Source/web/FrameLoaderClientImpl.cpp

Issue 1140153006: Remove Navigation Transitions from Blink. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed layout tests. Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebDocument.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #include "public/web/WebCachedURLRequest.h" 79 #include "public/web/WebCachedURLRequest.h"
80 #include "public/web/WebContentSettingsClient.h" 80 #include "public/web/WebContentSettingsClient.h"
81 #include "public/web/WebDOMEvent.h" 81 #include "public/web/WebDOMEvent.h"
82 #include "public/web/WebDocument.h" 82 #include "public/web/WebDocument.h"
83 #include "public/web/WebFormElement.h" 83 #include "public/web/WebFormElement.h"
84 #include "public/web/WebFrameClient.h" 84 #include "public/web/WebFrameClient.h"
85 #include "public/web/WebNode.h" 85 #include "public/web/WebNode.h"
86 #include "public/web/WebPlugin.h" 86 #include "public/web/WebPlugin.h"
87 #include "public/web/WebPluginParams.h" 87 #include "public/web/WebPluginParams.h"
88 #include "public/web/WebPluginPlaceholder.h" 88 #include "public/web/WebPluginPlaceholder.h"
89 #include "public/web/WebTransitionElementData.h"
90 #include "public/web/WebViewClient.h" 89 #include "public/web/WebViewClient.h"
91 #include "web/DevToolsEmulator.h" 90 #include "web/DevToolsEmulator.h"
92 #include "web/PluginPlaceholderImpl.h" 91 #include "web/PluginPlaceholderImpl.h"
93 #include "web/SharedWorkerRepositoryClientImpl.h" 92 #include "web/SharedWorkerRepositoryClientImpl.h"
94 #include "web/WebDataSourceImpl.h" 93 #include "web/WebDataSourceImpl.h"
95 #include "web/WebDevToolsAgentImpl.h" 94 #include "web/WebDevToolsAgentImpl.h"
96 #include "web/WebDevToolsFrontendImpl.h" 95 #include "web/WebDevToolsFrontendImpl.h"
97 #include "web/WebLocalFrameImpl.h" 96 #include "web/WebLocalFrameImpl.h"
98 #include "web/WebPluginContainerImpl.h" 97 #include "web/WebPluginContainerImpl.h"
99 #include "web/WebPluginLoadObserver.h" 98 #include "web/WebPluginLoadObserver.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 if (m_webFrame->client()) 406 if (m_webFrame->client())
408 m_webFrame->client()->didNavigateWithinPage(m_webFrame, WebHistoryItem(i tem), static_cast<WebHistoryCommitType>(commitType)); 407 m_webFrame->client()->didNavigateWithinPage(m_webFrame, WebHistoryItem(i tem), static_cast<WebHistoryCommitType>(commitType));
409 } 408 }
410 409
411 void FrameLoaderClientImpl::dispatchWillClose() 410 void FrameLoaderClientImpl::dispatchWillClose()
412 { 411 {
413 if (m_webFrame->client()) 412 if (m_webFrame->client())
414 m_webFrame->client()->willClose(m_webFrame); 413 m_webFrame->client()->willClose(m_webFrame);
415 } 414 }
416 415
417 void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad(bool isTransitionNav igation, double triggeringEventTime) 416 void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad(double triggeringEve ntTime)
418 { 417 {
419 if (m_webFrame->client()) 418 if (m_webFrame->client())
420 m_webFrame->client()->didStartProvisionalLoad(m_webFrame, isTransitionNa vigation, triggeringEventTime); 419 m_webFrame->client()->didStartProvisionalLoad(m_webFrame, triggeringEven tTime);
421 } 420 }
422 421
423 void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title) 422 void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title)
424 { 423 {
425 if (m_webFrame->client()) 424 if (m_webFrame->client())
426 m_webFrame->client()->didReceiveTitle(m_webFrame, title, WebTextDirectio nLeftToRight); 425 m_webFrame->client()->didReceiveTitle(m_webFrame, title, WebTextDirectio nLeftToRight);
427 } 426 }
428 427
429 void FrameLoaderClientImpl::dispatchDidChangeIcons(IconType type) 428 void FrameLoaderClientImpl::dispatchDidChangeIcons(IconType type)
430 { 429 {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 bool shift = inputEvent->modifiers & WebMouseEvent::ShiftKey; 522 bool shift = inputEvent->modifiers & WebMouseEvent::ShiftKey;
524 bool alt = inputEvent->modifiers & WebMouseEvent::AltKey; 523 bool alt = inputEvent->modifiers & WebMouseEvent::AltKey;
525 bool meta = inputEvent->modifiers & WebMouseEvent::MetaKey; 524 bool meta = inputEvent->modifiers & WebMouseEvent::MetaKey;
526 525
527 NavigationPolicy userPolicy; 526 NavigationPolicy userPolicy;
528 if (!navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta, &u serPolicy)) 527 if (!navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta, &u serPolicy))
529 return false; 528 return false;
530 return userPolicy == NavigationPolicyNewBackgroundTab; 529 return userPolicy == NavigationPolicyNewBackgroundTab;
531 } 530 }
532 531
533 NavigationPolicy FrameLoaderClientImpl::decidePolicyForNavigation(const Resource Request& request, DocumentLoader* loader, NavigationPolicy policy, bool isTransi tionNavigation) 532 NavigationPolicy FrameLoaderClientImpl::decidePolicyForNavigation(const Resource Request& request, DocumentLoader* loader, NavigationPolicy policy)
534 { 533 {
535 if (!m_webFrame->client()) 534 if (!m_webFrame->client())
536 return NavigationPolicyIgnore; 535 return NavigationPolicyIgnore;
537 536
538 if (policy == NavigationPolicyNewBackgroundTab && !allowCreatingBackgroundTa bs() && !UIEventWithKeyState::newTabModifierSetFromIsolatedWorld()) 537 if (policy == NavigationPolicyNewBackgroundTab && !allowCreatingBackgroundTa bs() && !UIEventWithKeyState::newTabModifierSetFromIsolatedWorld())
539 policy = NavigationPolicyNewForegroundTab; 538 policy = NavigationPolicyNewForegroundTab;
540 539
541 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(loader); 540 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(loader);
542 541
543 WrappedResourceRequest wrappedResourceRequest(request); 542 WrappedResourceRequest wrappedResourceRequest(request);
544 WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest); 543 WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest);
545 navigationInfo.frame = m_webFrame; 544 navigationInfo.frame = m_webFrame;
546 navigationInfo.extraData = ds->extraData(); 545 navigationInfo.extraData = ds->extraData();
547 navigationInfo.navigationType = ds->navigationType(); 546 navigationInfo.navigationType = ds->navigationType();
548 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy); 547 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy);
549 navigationInfo.isRedirect = ds->isRedirect(); 548 navigationInfo.isRedirect = ds->isRedirect();
550 navigationInfo.isTransitionNavigation = isTransitionNavigation;
551 549
552 WebNavigationPolicy webPolicy = m_webFrame->client()->decidePolicyForNavigat ion(navigationInfo); 550 WebNavigationPolicy webPolicy = m_webFrame->client()->decidePolicyForNavigat ion(navigationInfo);
553 return static_cast<NavigationPolicy>(webPolicy); 551 return static_cast<NavigationPolicy>(webPolicy);
554 } 552 }
555 553
556 void FrameLoaderClientImpl::dispatchAddNavigationTransitionData(const Document:: TransitionElementData& data)
557 {
558 if (!m_webFrame->client())
559 return;
560
561 WebVector<WebTransitionElement> webElements(data.elements.size());
562 for (size_t i = 0; i < data.elements.size(); ++i) {
563 webElements[i].id = data.elements[i].id;
564 webElements[i].rect = data.elements[i].rect;
565 }
566 WebTransitionElementData webData(data.scope, data.selector, data.markup, web Elements);
567 m_webFrame->client()->addNavigationTransitionData(webData);
568 }
569
570 void FrameLoaderClientImpl::dispatchWillRequestResource(FetchRequest* request) 554 void FrameLoaderClientImpl::dispatchWillRequestResource(FetchRequest* request)
571 { 555 {
572 if (m_webFrame->client()) { 556 if (m_webFrame->client()) {
573 WebCachedURLRequest urlRequest(request); 557 WebCachedURLRequest urlRequest(request);
574 m_webFrame->client()->willRequestResource(m_webFrame, urlRequest); 558 m_webFrame->client()->willRequestResource(m_webFrame, urlRequest);
575 } 559 }
576 } 560 }
577 561
578 void FrameLoaderClientImpl::dispatchWillSendSubmitEvent(HTMLFormElement* form) 562 void FrameLoaderClientImpl::dispatchWillSendSubmitEvent(HTMLFormElement* form)
579 { 563 {
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 955
972 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type) 956 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type)
973 { 957 {
974 if (m_webFrame->client()) { 958 if (m_webFrame->client()) {
975 m_webFrame->client()->suddenTerminationDisablerChanged( 959 m_webFrame->client()->suddenTerminationDisablerChanged(
976 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type)); 960 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type));
977 } 961 }
978 } 962 }
979 963
980 } // namespace blink 964 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698